39 #ifndef RECOVERY_BEHAVIORS_H__ 40 #define RECOVERY_BEHAVIORS_H__ 43 #include <boost/circular_buffer.hpp> 44 #include <geometry_msgs/Twist.h> 87 void update(
const geometry_msgs::Twist& twist,
double v_max,
double v_backwards_max,
double omega_max,
double v_eps,
double omega_eps);
122 bool detect(
double v_eps,
double omega_eps);
126 boost::circular_buffer<VelMeasurement>
buffer_;
bool detect(double v_eps, double omega_eps)
Detect if the robot got stucked based on the current buffer content.
FailureDetector()
Default constructor.
bool isOscillating() const
Check if the robot got stucked.
void setBufferLength(int length)
Set buffer length (measurement history)
~FailureDetector()
destructor.
void update(const geometry_msgs::Twist &twist, double v_max, double v_backwards_max, double omega_max, double v_eps, double omega_eps)
Add a new twist measurement to the internal buffer and compute a new decision.
boost::circular_buffer< VelMeasurement > buffer_
Circular buffer to store the last measurements.
void clear()
Clear the current internal state.
bool oscillating_
Current state: true if robot is oscillating.
This class implements methods in order to detect if the robot got stucked or is oscillating.