Skip to content

Commit

Permalink
Don't block until waiting for service
Browse files Browse the repository at this point in the history
Signed-off-by: Christoph Froehlich <[email protected]>
  • Loading branch information
christophfroehlich committed Mar 25, 2024
1 parent 1ef462e commit 4f59b3a
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,11 @@ class BtServiceNode : public BT::ActionNodeBase
auto remaining = server_timeout_ - elapsed;

if (remaining > std::chrono::milliseconds(0)) {
auto timeout = remaining > bt_loop_duration_ ? bt_loop_duration_ : remaining;

rclcpp::FutureReturnCode rc;
rc = callback_group_executor_.spin_until_future_complete(future_result_, timeout);
rc = callback_group_executor_.spin_until_future_complete(
future_result_, std::chrono::milliseconds(
0)); // don't wait for the future to complete, just check if it has
if (rc == rclcpp::FutureReturnCode::SUCCESS) {
request_sent_ = false;
BT::NodeStatus status = on_completion(future_result_.get());
Expand Down

0 comments on commit 4f59b3a

Please sign in to comment.