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

Preventing move base from executing a queued-up goal

asked Nov 24 '11

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.

Preview: (hide)

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  ( Jan 4 '12 )edit
using actionlib
PKG gravatar image PKG  ( Jan 16 '12 )edit

1 Answer

Sort by » oldest newest most voted
1

answered Jan 4 '12

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

Preview: (hide)

Question Tools

Stats

Asked: Nov 24 '11

Seen: 532 times

Last updated: Jan 03 '12