EasyFleet
A simple-by-default framework for multi-robot, multi-capability fleets built on ROS 2
Loading...
Searching...
No Matches
Throttle Class Reference

Value-semantics rate limiter: copies (e.g. More...

#include <throttle.hpp>

Public Member Functions

 Throttle (std::chrono::milliseconds interval)
 Constructs a throttle with the given minimum interval.
bool ready () const
 Whether at least interval has elapsed since the last call that returned true.

Detailed Description

Value-semantics rate limiter: copies (e.g.

captured by value into a std::function) share the same underlying clock, so a feedback callback that fires at, say, 20 Hz can be throttled down to a readable printing rate without flooding the terminal.

Constructor & Destructor Documentation

◆ Throttle()

Throttle ( std::chrono::milliseconds interval)
inlineexplicit

Constructs a throttle with the given minimum interval.

Parameters
intervalMinimum time between two calls returning true.

Member Function Documentation

◆ ready()

bool ready ( ) const
inline

Whether at least interval has elapsed since the last call that returned true.

Returns
Whether at least interval has elapsed since the last call (across every copy of this Throttle) that returned true.

The documentation for this class was generated from the following file:
  • easyfleet_mission_manager/include/easyfleet_mission_manager/throttle.hpp