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

Publishing to /move_base_simple/goal

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

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
24

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

Lorenz gravatar image

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

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
5

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

bergercookie gravatar image

updated 2019-05-14 14:14:13 -0600

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
1

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

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 } } }'

Thanks

edit flag offensive delete link more

Comments

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 -0600 )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 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2012-11-11 05:21:03 -0600

Seen: 33,306 times

Last updated: May 14 '19