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

rostopic pub /topic_name sensor_msgs/JointState [arguments]

asked 2015-08-12 20:17:39 -0500

Emilio gravatar image

updated 2015-08-13 01:32:46 -0500

mgruhler gravatar image

Hi !

I run this command line:

rostopic pub servo sensor_msgs/JointState '{header: {seq:0, stamp: {secs:0, nsecs:0}, frame_id:""}, name:["art1"],position:[150.0], velocity:[0.0], effort:[0.0]}' --once

and i get the following error:


emilio@emilio-N61Vg:~/catkin_ws$ rostopic pub servo sensor_msgs/JointState '{header: {seq:0, stamp: {secs:0, nsecs:0}, frame_id:""}, name:["art1"],position:[150.0], velocity:[0.0], effort:[0.0]}' --once

Usage: rostopic pub /topic type [args...]

rostopic: error: Argument error: while scanning a plain scalar

  in "<string>", line 1, column 11:

    {header: {seq:0, stamp: {secs:0, nsecs:0}, ... 
              ^

found unexpected ':'

  in "<string>", line 1, column 14:

    {header: {seq:0, stamp: {secs:0, nsecs:0}, fr ... 
                 ^

Please check http://pyyaml.org/wiki/YAMLColonInFlowContext for details.
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-08-13 01:36:54 -0500

mgruhler gravatar image

updated 2015-08-13 01:37:52 -0500

I guess the question is "What is wrong with this command?", right?

Try with:

rostopic pub servo sensor_msgs/JointState '{header: {seq: 0, stamp: {secs: 0, nsecs: 0}, frame_id: ""}, name: ["art1"], position: [150.0], velocity: [0.0], effort: [0.0]}' --once

Note the space after each :. This is mandatory!

edit flag offensive delete link more

Comments

That works, thank you!

Emilio gravatar image Emilio  ( 2015-08-13 05:48:08 -0500 )edit

please mark the answer as correct, if it helped :-)

mgruhler gravatar image mgruhler  ( 2015-08-13 06:12:34 -0500 )edit

sorry, this is the first time i post here ;)

Emilio gravatar image Emilio  ( 2015-08-13 06:16:15 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-08-12 20:17:39 -0500

Seen: 4,176 times

Last updated: Aug 13 '15