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

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

Anonymous

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
0

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

Comments

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: http://wiki.ros.org/ROS/Tutorials and http://wiki.ros.org/navigation/Tutorials

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

Question Tools

1 follower

Stats

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

Seen: 1,877 times

Last updated: Feb 25 '16