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

Preventing move base from executing a queued-up goal

asked 2011-11-24 10:20:39 -0500

PKG gravatar image

I have a problem where I have a set of goals sent to my (physical) robot every few seconds , from a subscriber's callback. The robot is slow and takes a while to reach the next goal. By this time, a huge list of goals have piled up in the action client's queue.

How can I get only the last goal (i.e. the one at the tail end of the queue) to execute?

I want to drop all intermediate goals.

edit retag flag offensive close merge delete


How are you setting the goals? Using an actionlib client or just using move_base_simple/goal topic?
Eric Perko gravatar image Eric Perko  ( 2012-01-04 15:02:03 -0500 )edit
using actionlib
PKG gravatar image PKG  ( 2012-01-16 12:45:18 -0500 )edit

1 Answer

Sort by » oldest newest most voted

answered 2012-01-03 23:59:11 -0500

Procópio gravatar image

Extracted from here:

template<class M>
ros::Subscriber subscribe(const std::string& topic, uint32_t queue_size, 
<callback, which may involve multiple arguments>, const ros::TransportHints&
transport_hints = ros::TransportHints());

You can set the queue size for receiving the messages, if you have a queue size of 1, you will only store the latest message

edit flag offensive delete link more

Question Tools


Asked: 2011-11-24 10:20:39 -0500

Seen: 522 times

Last updated: Jan 03 '12