0
$\begingroup$

Rosanswers logo

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


Originally posted by Ammar on ROS Answers with karma: 289 on 2012-11-11

Post score: 7

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Lorenz with karma: 22731 on 2012-11-11

This answer was ACCEPTED on the original site

Post score: 24

$\endgroup$
0
$\begingroup$

Rosanswers logo

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


Originally posted by Ammar with karma: 289 on 2012-11-11

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by Gagan on 2022-01-18:
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?

Comment by faisalam1n on 2022-09-20:
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.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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

Originally posted by bergercookie with karma: 257 on 2019-05-14

This answer was NOT ACCEPTED on the original site

Post score: 5

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.