3232#include " rclcpp/executors/executor_notify_waitable.hpp"
3333#include " rcpputils/scope_exit.hpp"
3434
35+ #include " rclcpp/condition_wait_return_code.hpp"
3536#include " rclcpp/context.hpp"
3637#include " rclcpp/contexts/default_context.hpp"
3738#include " rclcpp/guard_condition.hpp"
@@ -361,7 +362,7 @@ class Executor
361362 * \return The return code, one of `SUCCESS`, `INTERRUPTED`, or `TIMEOUT`.
362363 */
363364 template <typename TimeRepT = int64_t , typename TimeT = std::milli>
364- FutureReturnCode
365+ ConditionWaitReturnCode
365366 spin_until_complete (
366367 const std::function<bool (void )> & condition,
367368 std::chrono::duration<TimeRepT, TimeT> timeout = std::chrono::duration<TimeRepT, TimeT>(-1 ))
@@ -376,7 +377,7 @@ class Executor
376377
377378 // Preliminary check, finish if condition is done already.
378379 if (condition ()) {
379- return FutureReturnCode ::SUCCESS;
380+ return ConditionWaitReturnCode ::SUCCESS;
380381 }
381382
382383 if (spinning.exchange (true )) {
@@ -388,7 +389,7 @@ class Executor
388389 spin_once_impl (timeout_left);
389390
390391 if (condition ()) {
391- return FutureReturnCode ::SUCCESS;
392+ return ConditionWaitReturnCode ::SUCCESS;
392393 }
393394 // If the original timeout is < 0, then this is blocking, never TIMEOUT.
394395 if (timeout_ns < std::chrono::nanoseconds::zero ()) {
@@ -397,14 +398,14 @@ class Executor
397398 // Otherwise check if we still have time to wait, return TIMEOUT if not.
398399 auto now = std::chrono::steady_clock::now ();
399400 if (now >= end_time) {
400- return FutureReturnCode ::TIMEOUT;
401+ return ConditionWaitReturnCode ::TIMEOUT;
401402 }
402403 // Subtract the elapsed time from the original timeout.
403404 timeout_left = std::chrono::duration_cast<std::chrono::nanoseconds>(end_time - now);
404405 }
405406
406407 // The condition did not pass before ok() returned false, return INTERRUPTED.
407- return FutureReturnCode ::INTERRUPTED;
408+ return ConditionWaitReturnCode ::INTERRUPTED;
408409 }
409410
410411 // / Spin (blocking) for at least the given amount of duration.
@@ -413,7 +414,7 @@ class Executor
413414 */
414415 template <typename TimeRepT = int64_t , typename TimeT = std::milli>
415416 void
416- spin_for (std::chrono::duration<TimeRepT, TimeT> timeout duration)
417+ spin_for (std::chrono::duration<TimeRepT, TimeT> duration)
417418 {
418419 (void )spin_until_complete ([]() {return false ;}, duration);
419420 }
0 commit comments