Ask Your Question

How do I publish the message to the rostopic /turtlesim/pose so that the turtle goes to the origin?

asked 2016-02-25 12:25:13 -0500

anonymous user


updated 2016-02-25 12:43:06 -0500

kv@kv:~$ rostopic pub -1 /turtle1/pose turtlesim/Pose -- ['0.0','0.0','0.0','2.0','0.0']
ERROR: Not enough arguments:
 * Given: [[0.0, 0.0, 0.0, 2.0, 0.0]]
 * Expected: ['x', 'y', 'theta', 'linear_velocity', 'angular_velocity']

Args are: [x y theta linear_velocity angular_velocity]
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2016-02-25 13:24:46 -0500

spmaniato gravatar image

updated 2016-02-25 13:26:01 -0500

Two part answer:

1) You are publishing incorrectly. The command should be something like:

rostopic pub --once /turtle1/pose turtlesim/Pose "{x: 0.0, y: 0.0, theta: 0.0, linear_velocity: 0.0, angular_velocity: 0.0}"

2) You cannot teleport the turtle by publishing to the pose topic. You need to use a service call:

rosservice call /turtle1/teleport_absolute ... # Use tab-tab and it will auto-fill the '...'
edit flag offensive delete link more


Thanks..that worked! How can I generate trajectory for the turtle to move between two given co-ordinates?

anonymous userAnonymous ( 2016-02-25 13:35:43 -0500 )edit

You would need to write a planner/controller to do that. Or use one of the existing ones. I highly recommend you (at least) skim through most of the ROS tutorials: and

spmaniato gravatar image spmaniato  ( 2016-02-25 13:53:37 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-02-25 12:25:13 -0500

Seen: 1,389 times

Last updated: Feb 25 '16