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

Revision history [back]

click to hide/show revision 1
initial version

rostopic is not the right command for republishing the content of one topic as a separate message on another topic since it does not evaluate the arguments passed ('[chatter, 0.0, 0.0]' '[0.0, 0.0, 1.8]').

rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist -- '[chatter, 0.0, 0.0]' '[0.0, 0.0, 1.8]'

The relay_field node from topic_tools (http://wiki.ros.org/topic_tools) is more appropriate for your purpose as it provides this functionality. The command for this would be

rosrun topic_tools relay_field /chatter /turtle1/cmd_vel geometry_msgs/Twist "linear: x: m.data y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 1.8"

click to hide/show revision 2
No.2 Revision

rostopic is not the right command for republishing the content of one topic as a separate message on another topic since it does not evaluate the arguments passed ('[chatter, 0.0, 0.0]' '[0.0, 0.0, 1.8]').

rostopic pub -1 /turtle1/cmd_vel geometry_msgs/Twist -- '[chatter, 0.0, 0.0]' '[0.0, 0.0, 1.8]'

1.8]'

The relay_field node from topic_tools (http://wiki.ros.org/topic_tools) is more appropriate for your purpose as it provides this functionality. The command for this would be

rosrun topic_tools relay_field /chatter /turtle1/cmd_vel geometry_msgs/Twist "linear:
  x: m.data
  y: 0.0
  z: 0.0
angular:
  x: 0.0
  y: 0.0
  z: 1.8"1.8"