#include <timer.hpp>
◆ TimerBase()
rclcpp::TimerBase::TimerBase |
( |
Clock::SharedPtr |
clock, |
|
|
std::chrono::nanoseconds |
period, |
|
|
rclcpp::Context::SharedPtr |
context |
|
) |
| |
|
explicit |
TimerBase constructor.
- Parameters
-
clock | A clock to use for time and sleeping |
period | The interval at which the timer fires |
context | node context |
◆ ~TimerBase()
virtual rclcpp::TimerBase::~TimerBase |
( |
| ) |
|
|
virtual |
◆ cancel()
void rclcpp::TimerBase::cancel |
( |
| ) |
|
Cancel the timer.
- Exceptions
-
◆ is_canceled()
bool rclcpp::TimerBase::is_canceled |
( |
| ) |
|
Return the timer cancellation state.
- Returns
- true if the timer has been cancelled, false otherwise
- Exceptions
-
◆ reset()
void rclcpp::TimerBase::reset |
( |
| ) |
|
Reset the timer.
- Exceptions
-
◆ execute_callback()
virtual void rclcpp::TimerBase::execute_callback |
( |
| ) |
|
|
pure virtual |
◆ get_timer_handle()
◆ time_until_trigger()
Check how long the timer has until its next scheduled callback.
- Returns
- A std::chrono::duration representing the relative time until the next callback.
- Exceptions
-
◆ is_steady()
virtual bool rclcpp::TimerBase::is_steady |
( |
| ) |
|
|
pure virtual |
◆ is_ready()
bool rclcpp::TimerBase::is_ready |
( |
| ) |
|
Check if the timer is ready to trigger the callback.
This function expects its caller to immediately trigger the callback after this function, since it maintains the last time the callback was triggered.
- Returns
- True if the timer needs to trigger.
- Exceptions
-
◆ exchange_in_use_by_wait_set_state()
bool rclcpp::TimerBase::exchange_in_use_by_wait_set_state |
( |
bool |
in_use_state | ) |
|
Exchange the "in use by wait set" state for this timer.
This is used to ensure this timer is not used by multiple wait sets at the same time.
- Parameters
-
[in] | in_use_state | the new state to exchange into the state, true indicates it is now in use by a wait set, and false is that it is no longer in use by a wait set. |
- Returns
- the previous state.
◆ clock_
Clock::SharedPtr rclcpp::TimerBase::clock_ |
|
protected |
◆ timer_handle_
◆ in_use_by_wait_set_
std::atomic<bool> rclcpp::TimerBase::in_use_by_wait_set_ {false} |
|
protected |
The documentation for this class was generated from the following file: