Skip to content

Commit 3644195

Browse files
authored
add note about problems with spin_until_future_complete (#2849)
* add note indicating that spin_until_future_complete should be used only with futures generated by ROS entities Signed-off-by: Alberto Soragna <[email protected]> * fix indentation and improve explanation of consequences Signed-off-by: Alberto Soragna <[email protected]> --------- Signed-off-by: Alberto Soragna <[email protected]>
1 parent bdab46d commit 3644195

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rclcpp/include/rclcpp/executor.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,9 @@ class Executor
371371
* If the time spent inside the blocking loop exceeds this timeout, return a TIMEOUT return
372372
* code.
373373
* \return The return code, one of `SUCCESS`, `INTERRUPTED`, or `TIMEOUT`.
374+
* \note This method will check the future and the timeout only when the executor is woken up.
375+
* If this future is unrelated to an executor's entity, this method will not correctly detect
376+
* when it's completed and therefore may wait forever and never time out.
374377
*/
375378
template<typename FutureT, typename TimeRepT = int64_t, typename TimeT = std::milli>
376379
FutureReturnCode

0 commit comments

Comments
 (0)