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

Treating move_base/goal as simple subscriber rather than ActionServer?

asked 2012-11-16 04:57:41 -0500

Ammar gravatar image

Hello All, I have a fairly basic question regarding utilizing move_base. I know I can publish a simple goal using move_base_simple/goal and not monitor the result. However I would like to get an update on when the goal is reached. Using an ActionClient can be a problem for me since I am commanding multiple robots from a single process. The ActionClient will block my process till the task has been completed. I was wondering if it is possible for me to publish directly the move_base/goal and then simply subscribe to the topic "move_base/result". I other words completely bypass the ActionClient and incorporate a truly publish/subscribe relation. This way I can command several robots within the same node. Please let me know if this is possible or what are other better ways? Thanks! Ammar

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-11-18 06:54:12 -0500

Lorenz gravatar image

Actionlib will certainly not block unless you want it to block. Besides the ability to preempt goals, that's one of the most important advantages of actionlib.

For instance, you can use the action client method sendGoal. It will just send the goal and return immediately.

Of course it is also possible to directly publish on the action server's goal topic. That's what actionlib does internally. I would not suggest to do that though.

edit flag offensive delete link more


So if I use the action client sendGoal, will I be able to create a subscriber to listen to move_base/status or move_base/result, I would like to know when the goal gets completed as well. Thanks!

Ammar gravatar image Ammar  ( 2012-11-19 01:27:55 -0500 )edit

The action client library always subscribes to the status topic anyway. Have a look at the API docs. You can pass callbacks that are executed when a goal is done or when feedback is received.

Lorenz gravatar image Lorenz  ( 2012-11-19 01:35:42 -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-16 04:57:41 -0500

Seen: 1,852 times

Last updated: Nov 18 '12