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?
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.
Asked: Feb 21
Seen: 86 times
Last updated: Feb 22
ROS Answers is licensed under Creative Commons Attribution 3.0 Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.