Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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