add method to reset a timer in TimerBase (#326)
This commit is contained in:
parent
100417a98d
commit
5777bbee79
2 changed files with 12 additions and 0 deletions
|
@ -55,6 +55,10 @@ public:
|
|||
void
|
||||
cancel();
|
||||
|
||||
RCLCPP_PUBLIC
|
||||
void
|
||||
reset();
|
||||
|
||||
RCLCPP_PUBLIC
|
||||
virtual void
|
||||
execute_callback() = 0;
|
||||
|
|
|
@ -40,6 +40,14 @@ TimerBase::cancel()
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
TimerBase::reset()
|
||||
{
|
||||
if (rcl_timer_reset(&timer_handle_) != RCL_RET_OK) {
|
||||
throw std::runtime_error(std::string("Couldn't reset timer: ") + rcl_get_error_string_safe());
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
TimerBase::is_ready()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue