47 virtual void reset() = 0;
64 bool jumpedBack(const ::ros::Time& stamp, const ::ros::Time& previousStamp)
const;
87 void reset()
override;
114 explicit TokenBucketLimiter(const ::ros::Rate&
rate,
size_t bucketCapacity = 2,
double initialTokensAvailable = 1.0);
125 double initialTokensAvailable = 1.0);
128 void reset()
override;
virtual bool shouldPublish(const ::ros::Time &stamp)=0
Call this function whenever a message is received. It tells whether the message has passed the rate-l...
RateLimiter(const ::ros::Rate &rate)
Create limiter with the given rate.
size_t bucketCapacity
Number of tokens that can fit into the bucket. This influences the maximum burst size.
::ros::Rate rate
The desired rate (1/period).
Generic rate-limiter interface.
The (not so clever) algorithm used by topic_tools/throttle node.
void setJumpBackTolerance(const ::ros::Duration &tolerance)
Set the limit for telling between small and large backwards time jumps. Small jumps result in ignorin...
::ros::Duration period
The desired period between message (1/rate).
double initialTokensAvailable
The number of tokens that are initially in the buffer (and after reset).
ros::Duration tokensAvailable
The number of currently available tokens. This units of this number are actually not seconds...
Token bucket rate limiting algorithm.
::ros::Duration jumpBackTolerance
Threshold for jump back detection.
bool jumpedBack(const ::ros::Time &stamp, const ::ros::Time &previousStamp) const
Decide whether the newly coming message should be treated as a backwards jump in time.
virtual void reset()=0
Reset the rate-limiter as if it were newly created with the same parameters.