rostopic pub -data format [closed]

asked 2015-07-09 05:50:53 -0600

metRo_ gravatar image

Hello,

I was trying the turtlesim example and wanted to pub to cmd_vel topic. I tried the following from a tutorial

pc3:~$ rostopic pub -r 1 /turtle1/cmd_vel geometry_msgs/Twist '[2,0,0]''[0,0,2]'
Usage: rostopic pub /topic type [args...]

rostopic: error: Argument error: expected '<document start>', but found '['
  in "<string>", line 1, column 8:
    [2,0,0][0,0,2]
             ^

but I got the error above and can't identify what is wrong on the format.

After some research on internet I found a working message format: rostopic pub -r 100 /turtle1/cmd_vel geometry_msgs/Twist '{linear: {x: 0.5, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 0.5}}'

Is it because I'm on Indigo and tutorial was done on a previous version?

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by tfoote
close date 2015-07-09 07:00:01.600387

Comments

1

Can you provide some links? Is hard to tell if we do not know where you got the info from.

Javier V. Gómez gravatar image Javier V. Gómez  ( 2015-07-09 06:40:38 -0600 )edit

This looks like a duplicate: http://answers.ros.org/question/21324...

tfoote gravatar image tfoote  ( 2015-07-09 06:59:53 -0600 )edit

I'm reading the book "A Gentle Introduction to ROS"

metRo_ gravatar image metRo_  ( 2015-07-09 07:40:25 -0600 )edit