Ask Your Question
0

namespace renaming

asked Feb 21

cassander gravatar image cassander
61 5

updated Feb 21

I have the turtlesim node running at /ajsim/turtle1 It is subscribing to the topic /ajsim/turtle1/command_velocity

I started another node called turtle_teleop_key which publishes the topic /turtle1/command_velocity

The problem is that the node in /ajsim/turtle1 cannot subscribe to the topic at /turtle1/command_velocity

I tried the command, [code] rosrun turtlesim turtle_teleop_key command_velocity:=ajsim/turtle1/command_velocity [/code]

but it doesn't work and the wiki is a little unclear about how the change the namespace. Could someone please tell me how I can make sure they are in the same namespace?

delete close flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered Feb 21

DimitriProsser gravatar image DimitriProsser flag of United States
6817 23 59 126

updated Feb 22

Have a look at this tutorial.

You could also use:

export ROS_NAMESPACE=/ajsim
rosrun turtlesim turtle_teleop_key

This would run the teleop node under the ajsim namespace, and would allow you to subscribe to the topic.

EDIT:

I do not know of a way to change a node's namespace while it's running. If you don't want to use the ROS_NAMESPACE variable, then you would want to use roslaunch.

link delete flag offensive edit

Comments

thank you. That worked. I was wondering if there is a way to change the namespace of a node while it is executing... so that it can continue publishing the messages in the new namespace?

cassander (Feb 21)edit

To change the namespace while a node is running?

DimitriProsser (Feb 22)edit

Yes.. is it possible to change the namespace of a node while it is running? If that is not possible, then is it possible to change the namespace of a node while it is being launched on the command line using rosrun without having the export the ROS_NAMESPACE variable?

cassander (Feb 22)edit

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Follow

subscribe to rss feed

Stats

Asked: Feb 21

Seen: 86 times

Last updated: Feb 22