Ask Your Question
2

namespace renaming

asked 2012-02-21 06:59:10 -0500

cassander gravatar image

updated 2012-02-21 07:02:45 -0500

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
7

answered 2012-02-21 07:48:13 -0500

DimitriProsser gravatar image

updated 2012-02-22 06:53:24 -0500

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.

edit flag offensive delete link more

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 gravatar imagecassander ( 2012-02-21 12:09:34 -0500 )edit

To change the namespace while a node is running?

DimitriProsser gravatar imageDimitriProsser ( 2012-02-22 02:51:10 -0500 )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 gravatar imagecassander ( 2012-02-22 05:16:32 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-02-21 06:59:10 -0500

Seen: 5,880 times

Last updated: Feb 22 '12