Set rmw_wait timeout using ros timers too (#357)
This commit is contained in:
parent
e5df9aa428
commit
3b7c208bba
1 changed files with 11 additions and 11 deletions
|
@ -506,10 +506,11 @@ rcl_wait(rcl_wait_set_t * wait_set, int64_t timeout)
|
|||
rmw_gcs->guard_conditions[rmw_gcs->guard_condition_count] =
|
||||
rmw_gcs->guard_conditions[gc_idx];
|
||||
++(rmw_gcs->guard_condition_count);
|
||||
} else {
|
||||
// No guard condition, instead use to set the rmw_wait timeout
|
||||
}
|
||||
// use timer time to to set the rmw_wait timeout
|
||||
// TODO(sloretz) fix spurious wake-ups on ROS_TIME timers with ROS_TIME enabled
|
||||
int64_t timer_timeout = INT64_MAX;
|
||||
rcl_ret_t ret = rcl_timer_get_time_until_next_call(wait_set->timers[i], &timer_timeout);
|
||||
ret = rcl_timer_get_time_until_next_call(wait_set->timers[i], &timer_timeout);
|
||||
if (ret != RCL_RET_OK) {
|
||||
return ret; // The rcl error state should already be set.
|
||||
}
|
||||
|
@ -519,7 +520,6 @@ rcl_wait(rcl_wait_set_t * wait_set, int64_t timeout)
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (timeout == 0) {
|
||||
// Then it is non-blocking, so set the temporary storage to 0, 0 and pass it.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue