Skip to content

Commit 9db4e67

Browse files
jmachowinskiJanosch Machowinski
authored andcommitted
fix: Fixed compilation after API change of TimerBase::execute (ros2#375)
Signed-off-by: Janosch Machowinski <[email protected]> Co-authored-by: Janosch Machowinski <[email protected]>
1 parent cbeb313 commit 9db4e67

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

rclcpp/topics/minimal_subscriber/time_triggered_wait_set_subscriber.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ class TimeTriggeredWaitSetSubscriber : public rclcpp::Node
7171
case rclcpp::WaitResultKind::Ready:
7272
{
7373
if (wait_result.get_wait_set().get_rcl_wait_set().timers[0U]) {
74-
timer_->execute_callback();
74+
if (auto data = timer_->call()) {
75+
timer_->execute_callback(data);
76+
}
7577
}
7678
break;
7779
}

rclcpp/wait_set/src/wait_set_topics_and_timer.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ int32_t main(const int32_t argc, char ** const argv)
7171
const auto wait_result = wait_set.wait(2s);
7272
if (wait_result.kind() == rclcpp::WaitResultKind::Ready) {
7373
if (wait_result.get_wait_set().get_rcl_wait_set().timers[0U]) {
74-
// The timer callback is executed manually here
75-
one_off_timer->execute_callback();
74+
if (auto data = one_off_timer->call()) {
75+
// The timer callback is executed manually here
76+
one_off_timer->execute_callback(data);
77+
}
7678
} else {
7779
std_msgs::msg::String msg;
7880
rclcpp::MessageInfo msg_info;

0 commit comments

Comments
 (0)