ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Hi, how can I subscribe the node(topic cmd_vel) of turtlesim to the node of my model?

asked 2016-11-27 13:59:45 -0500

manju gravatar image

Hi, I have build a model in gazebo ROS which is moving through teleop keyboard. I want to subscribe cmd_vel of turtlesim to my model and move turtlesim along with my model. Do you have any idea how can I subscribe the node of turtlesim to the node of my model?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-11-27 14:45:41 -0500

petern3 gravatar image

via command line:

You can remap topics with /old_topic:=/new_topic. In your case:

rosrun turtlesim turtlesim_node /turtle1/cmd_vel:=/my_gazebo_robot/cmd_vel

via launch file:

Within the node, you can use the remap tag.

<node pkg="turtlesim" type="turtlesim_node" name="sim">
  <remap from="/turtle1/cmd_vel" to="/my_gazebo_robot/cmd_vel" />
</node>

You can check if either method worked with rostopic list and rostopic info /my_gazebo_robot/cmd_vel. Note that /my_gazebo_robot might be several directories deep (such as if you have a base controller).

edit flag offensive delete link more

Comments

Hey, Thank you very much for the help. Its working!!

manju gravatar image manju  ( 2016-11-27 15:54:43 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2016-11-27 13:59:45 -0500

Seen: 525 times

Last updated: Nov 27 '16