Skip to content

Commit

Permalink
fix(bt_nodes): Correct default server_timeout behavior by using `ge…
Browse files Browse the repository at this point in the history
…tInputPortOrBlackboard()`
  • Loading branch information
alanxuefei committed Aug 25, 2024
1 parent c38fefd commit b064eb5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,8 @@ class BtActionNode : public BT::ActionNodeBase
// Get the required items from the blackboard
auto bt_loop_duration =
config().blackboard->template get<std::chrono::milliseconds>("bt_loop_duration");
server_timeout_ =
config().blackboard->template get<std::chrono::milliseconds>("server_timeout");
getInput<std::chrono::milliseconds>("server_timeout", server_timeout_);
server_timeout_ = BT::getInputPortOrBlackboard<std::chrono::milliseconds>(
"server_timeout", config().blackboard->template get<std::chrono::milliseconds>("server_timeout"), config().blackboard);
wait_for_service_timeout_ =
config().blackboard->template get<std::chrono::milliseconds>("wait_for_service_timeout");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ class BtCancelActionNode : public BT::ActionNodeBase
callback_group_executor_.add_callback_group(callback_group_, node_->get_node_base_interface());

// Get the required items from the blackboard
server_timeout_ =
config().blackboard->template get<std::chrono::milliseconds>("server_timeout");
getInput<std::chrono::milliseconds>("server_timeout", server_timeout_);
server_timeout_ = BT::getInputPortOrBlackboard<std::chrono::milliseconds>(
"server_timeout", config().blackboard->template get<std::chrono::milliseconds>("server_timeout"), config().blackboard);
wait_for_service_timeout_ =
config().blackboard->template get<std::chrono::milliseconds>("wait_for_service_timeout");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ class BtServiceNode : public BT::ActionNodeBase
// Get the required items from the blackboard
auto bt_loop_duration =
config().blackboard->template get<std::chrono::milliseconds>("bt_loop_duration");
server_timeout_ =
config().blackboard->template get<std::chrono::milliseconds>("server_timeout");
getInput<std::chrono::milliseconds>("server_timeout", server_timeout_);
server_timeout_ = BT::getInputPortOrBlackboard<std::chrono::milliseconds>(
"server_timeout", config().blackboard->template get<std::chrono::milliseconds>("server_timeout"), config().blackboard);
wait_for_service_timeout_ =
config().blackboard->template get<std::chrono::milliseconds>("wait_for_service_timeout");

Expand Down

0 comments on commit b064eb5

Please sign in to comment.