Skip to content

Commit

Permalink
fix: Fixed compilation after API change of TimerBase::execute
Browse files Browse the repository at this point in the history
Signed-off-by: Janosch Machowinski <J.Machowinski@cellumation.com>
  • Loading branch information
Janosch Machowinski authored and Janosch Machowinski committed Mar 29, 2024
1 parent b94c739 commit 375e0e2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ class TimeTriggeredWaitSetSubscriber : public rclcpp::Node
case rclcpp::WaitResultKind::Ready:
{
if (wait_result.get_wait_set().get_rcl_wait_set().timers[0U]) {
timer_->execute_callback();
if (auto data = timer_->call()) {
timer_->execute_callback(data);
}
}
break;
}
Expand Down
6 changes: 4 additions & 2 deletions rclcpp/wait_set/src/wait_set_topics_and_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ int32_t main(const int32_t argc, char ** const argv)
const auto wait_result = wait_set.wait(2s);
if (wait_result.kind() == rclcpp::WaitResultKind::Ready) {
if (wait_result.get_wait_set().get_rcl_wait_set().timers[0U]) {
// The timer callback is executed manually here
one_off_timer->execute_callback();
if (auto data = one_off_timer->call()) {
// The timer callback is executed manually here
one_off_timer->execute_callback(data);
}
} else {
std_msgs::msg::String msg;
rclcpp::MessageInfo msg_info;
Expand Down

0 comments on commit 375e0e2

Please sign in to comment.