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,17 +506,17 @@ rcl_wait(rcl_wait_set_t * wait_set, int64_t timeout)
|
||||||
rmw_gcs->guard_conditions[rmw_gcs->guard_condition_count] =
|
rmw_gcs->guard_conditions[rmw_gcs->guard_condition_count] =
|
||||||
rmw_gcs->guard_conditions[gc_idx];
|
rmw_gcs->guard_conditions[gc_idx];
|
||||||
++(rmw_gcs->guard_condition_count);
|
++(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
|
||||||
int64_t timer_timeout = INT64_MAX;
|
// TODO(sloretz) fix spurious wake-ups on ROS_TIME timers with ROS_TIME enabled
|
||||||
rcl_ret_t ret = rcl_timer_get_time_until_next_call(wait_set->timers[i], &timer_timeout);
|
int64_t timer_timeout = INT64_MAX;
|
||||||
if (ret != RCL_RET_OK) {
|
ret = rcl_timer_get_time_until_next_call(wait_set->timers[i], &timer_timeout);
|
||||||
return ret; // The rcl error state should already be set.
|
if (ret != RCL_RET_OK) {
|
||||||
}
|
return ret; // The rcl error state should already be set.
|
||||||
if (timer_timeout < min_timeout) {
|
}
|
||||||
is_timer_timeout = true;
|
if (timer_timeout < min_timeout) {
|
||||||
min_timeout = timer_timeout;
|
is_timer_timeout = true;
|
||||||
}
|
min_timeout = timer_timeout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue