ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Publishing to /move_base_simple/goal

asked 2012-11-11 05:21:03 -0500

Ammar gravatar image

Hello All, This is a fairly straightforward question, however I have not been able to find it so far. Could someone please tell me the terminal command to publish move_base_simple/goal. I know it is something like: rostopic pub /move_base_simple/goal geometry_msgs/PoseStamped ..........

Really appreciate it. Thank you Ammar

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2012-11-11 05:52:15 -0500

Lorenz gravatar image

updated 2012-11-11 05:53:29 -0500

rostopic pub /move_base_simple/goal geometry_msgs/PoseStamped '{header: {stamp: now, frame_id: "map"}, pose: {position: {x: 1.0, y: 0.0, z: 0.0}, orientation: {w: 1.0}}}'

See here for an overview of the command line yaml syntax.

But if you want to send goals programmatically, consider using actionlib. It allows you to preempt goals, i.e. stop the robot, while it is moving. Have a look at this tutorial.

edit flag offensive delete link more

answered 2019-05-14 14:13:48 -0500

bergercookie gravatar image

updated 2019-05-14 14:14:13 -0500

For the sake of completeness and given that this is something rather useful to do especially for debugging reasons, here's the same command in ROS 2:

ros2 topic pub /move_base_simple/goal geometry_msgs/PoseStamped '{header: {stamp: {sec: 0, nanosec: 0}, frame_id: "map"}, pose: {position: {x: 1.0, y: 0.0, z: 0.0}, orientation: {w: 1.0}}}'
edit flag offensive delete link more

answered 2012-11-11 05:53:59 -0500

Ammar gravatar image

Never mind! Found the answer. It is simply:

rostopic pub /robot_0/move_base_simple/goal geometry_msgs/PoseStamped '{ header: { frame_id: "/map" }, pose: { position: { x: 0.25, y: 0 }, orientation: { x: 0, y: 0, z: 0, w: 1 } } }'


edit flag offensive delete link more


Hi Ammr,

If possible can you explain how did you manage to fix this by adding robot_0 in your command? Why did you choose to do that?

Gagan gravatar image Gagan  ( 2022-01-18 06:54:02 -0500 )edit

Hi @Gagan, I don't know why Ammar did /robot_0/ but I'm also doing it because I'm launching multiple turtlebots that's why I have to specify which robot I'm giving the goal pos to.

faisalam1n gravatar image faisalam1n  ( 2022-09-20 01:02:48 -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: 2012-11-11 05:21:03 -0500

Seen: 30,669 times

Last updated: May 14 '19