Ask Your Question
0

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

Comments

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
1

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

Procópio gravatar image

Extracted from here: http://www.ros.org/wiki/roscpp/Overview/Publishers%20and%20Subscribers#Subscriber_Options

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 390 times

Last updated: Jan 03 '12