Interface for resettable nodes and nodelets. Automatic reset on time jumps. More...
#include <resettable.h>
Public Member Functions | |
void | checkTimeJump () |
Check if ROS time has not jumped back. If it did, call reset(). More... | |
virtual void | checkTimeJump (const ::ros::Time &now) |
Check if ROS time has not jumped back. If it did, call reset(). More... | |
void | initRos (const ::ros::NodeHandle &pnh) override |
Initialize the ROS part of the interface - subscriber to /reset and ~reset topics, read time jump limits. More... | |
void | startAutoCheckTimeJump () |
Start a background 1 Hz timer that automatically checks for time jumps. More... | |
virtual void | startAutoCheckTimeJump (const ::ros::WallRate &rate) |
Start a background timer that automatically checks for time jumps. More... | |
virtual void | stopAutoCheckTimeJump () |
Stop the timer that automatically checks for time jumps. More... | |
TimeJumpResettable (const ::cras::LogHelperPtr &log) | |
Create the resettable interface. To also wire up to the reset topics and time jump resets, call initRos(). More... | |
~TimeJumpResettable () override | |
Public Member Functions inherited from cras::Resettable | |
virtual void | reset ()=0 |
Do the resetting. Subclasses have to implement the logic. More... | |
Resettable (const ::cras::LogHelperPtr &log) | |
Create the resettable interface. To also wire up to the reset topics, call initRos(). More... | |
virtual | ~Resettable () |
Private Attributes | |
::std::unique_ptr<::cras::TimeJumpResettablePrivate > | data |
Private implementation (PIMPL) data. More... | |
Interface for resettable nodes and nodelets. Automatic reset on time jumps.
This class reads the following ROS parameters when initRos() is called:
/jump_back_tolerance
(float, default 3.0 s in wall time and 0.0 s in sim time): Threshold for ROS time jump back detection.~jump_back_tolerance
(float, default from /jump_back_tolerance
): Threshold for ROS time jump back detection.~reset_on_time_jump_back
(bool, default True): Whether to call reset() when ROS time jumps back./jump_forward_tolerance
(float, default 10.0 s in sim time and max duration in wall time): Threshold for ROS time jump forward detection.~jump_forward_tolerance
(float, default from /jump_forward_tolerance
): Threshold for ROS time jump forward detection.~reset_on_time_jump_forward
(bool, default True in sim time and False in wall time): Whether to call reset() when ROS time jumps forward.This class subscribes the following topics:
/reset
(any type): When a message is received on this topic, reset() is called.~reset
(any type): When a message is received on this topic, reset() is called. Definition at line 78 of file resettable.h.
|
explicit |
Create the resettable interface. To also wire up to the reset topics and time jump resets, call initRos().
[in] | log | The logger to use for message logging. |
|
override |
void cras::TimeJumpResettable::checkTimeJump | ( | ) |
Check if ROS time has not jumped back. If it did, call reset().
|
virtual |
Check if ROS time has not jumped back. If it did, call reset().
[in] | now | The timestamp that should be interpreted as current time. |
|
overridevirtual |
Initialize the ROS part of the interface - subscriber to /reset and ~reset topics, read time jump limits.
[in] | pnh | The (private) node handle to setup the interface for. |
Reimplemented from cras::Resettable.
void cras::TimeJumpResettable::startAutoCheckTimeJump | ( | ) |
Start a background 1 Hz timer that automatically checks for time jumps.
|
virtual |
Start a background timer that automatically checks for time jumps.
[in] | rate | Checking rate |
|
virtual |
Stop the timer that automatically checks for time jumps.
|
private |
Private implementation (PIMPL) data.
Definition at line 126 of file resettable.h.