-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Bug report
The default_server_timeout parameter in bt_navigator is always overridden by the server_timeout port in each BT action node.
As a result, the default_server_timeout never takes effect because the server_timeout in each BT action node is mandatory and supersedes the default value.
Please refer to
https://github.com/ros-navigation/navigation2/blob/main/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server_impl.hpp#L185
The code
server_timeout_ = config().blackboard->template get<std::chrono::milliseconds>("server_timeout");
getInput<std::chrono::milliseconds>("server_timeout", server_timeout_);
may be changed as follows:
if (!getInput<std::chrono::milliseconds>("server_timeout", server_timeout_)) {
server_timeout_ = config().blackboard->template get<std::chrono::milliseconds>("server_timeout");
}Required Info:
- Operating System:
- Ubuntu 22.04
- ROS2 Version:
- Humble binaries
- Version or commit hash:
- Main
- DDS implementation:
- Fast-RTPS
Steps to reproduce issue
- Create a Behavior Tree (BT) action node in a Nav2 configuration file.
- Set a default
server_timeoutvalue in the corresponding YAML file. - Execute the BT with the action node.
- Observe that the default value of
server_timeoutfrom the YAML file is not applied.
// Code in bt_action_node.hpp:
server_timeout_ = config().blackboard->template get<std::chrono::milliseconds>("server_timeout");
getInput<std::chrono::milliseconds>("server_timeout", server_timeout_);Expected behavior
The default value of server_timeout specified in the YAML file should be applied unless overridden by a specific BT action node configuration.
Actual behavior
The default value of server_timeout from the YAML file is never applied because server_timeout_ is required to be explicitly set for each BT action node, which overrides the default.
Additional information
This bug prevents the default server_timeout value specified in the YAML configuration from being used in BT action nodes. As a result, users must manually set server_timeout for each node, leading to potential inconsistencies and additional configuration overhead.