Skip to content

Commit

Permalink
Refine wait_for_valid signature
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <methylDragon@gmail.com>
  • Loading branch information
methylDragon committed Nov 3, 2022
1 parent 6face35 commit 5d6d65b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions rclcpp/include/rclcpp/clock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class Clock
/**
* Wait for clock to become valid.
*
* \param context the context to wait in.
* \param context the context to wait in
* \return true if clock was or became valid
* \throws std::runtime_error if the context is invalid or clock is not rcl_clock_valid
*/
Expand All @@ -178,15 +178,15 @@ class Clock
* \param timeout the maximum time to wait for.
* \param context the context to wait in.
* \param wait_tick_ns the time to wait between each iteration of the wait loop (in nanoseconds).
* \return true if the clock is active
* \return true if clock was or became valid
* \throws std::runtime_error if the context is invalid or clock is not rcl_clock_valid
*/
RCLCPP_PUBLIC
bool
wait_for_valid(
const rclcpp::Duration & timeout,
Context::SharedPtr context = contexts::get_global_default_context(),
Duration wait_tick_ns = Duration(0, static_cast<uint32_t>(1e7)));
const rclcpp::Duration & wait_tick_ns = rclcpp::Duration(0, static_cast<uint32_t>(1e7)));

/**
* Returns the clock of the type `RCL_ROS_TIME` is active.
Expand Down
2 changes: 1 addition & 1 deletion rclcpp/src/rclcpp/clock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ bool
Clock::wait_for_valid(
const Duration & timeout,
Context::SharedPtr context,
Duration wait_tick_ns)
const Duration & wait_tick_ns)
{
if (!context || !context->is_valid()) {
throw std::runtime_error("context cannot be slept with because it's invalid");
Expand Down

0 comments on commit 5d6d65b

Please sign in to comment.