diff --git a/.circleci/config.yml b/.circleci/config.yml
index d6766347816..841d60042d1 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -33,12 +33,12 @@ _commands:
- restore_cache:
name: Restore Cache << parameters.key >>
keys:
- - "<< parameters.key >>-v36\
+ - "<< parameters.key >>-v39\
-{{ arch }}\
-{{ .Branch }}\
-{{ .Environment.CIRCLE_PR_NUMBER }}\
-{{ checksum \"<< parameters.workspace >>/lockfile.txt\" }}"
- - "<< parameters.key >>-v36\
+ - "<< parameters.key >>-v39\
-{{ arch }}\
-main\
-\
@@ -58,7 +58,7 @@ _commands:
steps:
- save_cache:
name: Save Cache << parameters.key >>
- key: "<< parameters.key >>-v36\
+ key: "<< parameters.key >>-v39\
-{{ arch }}\
-{{ .Branch }}\
-{{ .Environment.CIRCLE_PR_NUMBER }}\
@@ -532,7 +532,7 @@ jobs:
_parameters:
release_parameters: &release_parameters
- packages_skip_regex: "nav2_system_tests"
+ packages_skip_regex: "'(nav2_system_tests|nav2_smac_planner|nav2_mppi_controller|nav2_route|nav2_rviz_plugins|nav2_rotation_shim_controller|nav2_waypoint_follower|nav2_smoother|opennav_docking|nav2_behaviors|nav2_bringup|navigation2)'"
workflows:
version: 2
diff --git a/.github/workflows/build_main_against_distros.yml b/.github/workflows/build_main_against_distros.yml
index 5b4aa08f1e1..95941856d3e 100644
--- a/.github/workflows/build_main_against_distros.yml
+++ b/.github/workflows/build_main_against_distros.yml
@@ -17,7 +17,7 @@ jobs:
steps:
- name: Checkout repository
- uses: actions/checkout@v4
+ uses: actions/checkout@v5
- name: Set up Docker build context
run: |
diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml
index 3ffbfa392fd..73467b184cc 100644
--- a/.github/workflows/claude.yml
+++ b/.github/workflows/claude.yml
@@ -34,7 +34,7 @@ jobs:
id-token: write
steps:
- name: Checkout repository
- uses: actions/checkout@v4
+ uses: actions/checkout@v5
with:
fetch-depth: 1
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
index 62645e662aa..895bc2152c3 100644
--- a/.github/workflows/lint.yml
+++ b/.github/workflows/lint.yml
@@ -13,7 +13,7 @@ jobs:
matrix:
linter: [xmllint, cpplint, uncrustify, pep257, flake8, mypy]
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
- name: Install typeshed for mypy
if: matrix.linter == 'mypy'
@@ -30,8 +30,8 @@ jobs:
name: pre-commit
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-python@v5
+ - uses: actions/checkout@v5
+ - uses: actions/setup-python@v6
- uses: pre-commit/action@v3.0.1
env:
SKIP: >-
diff --git a/.github/workflows/update_ci_image.yaml b/.github/workflows/update_ci_image.yaml
index ef39facf09c..3c7743f1ad3 100644
--- a/.github/workflows/update_ci_image.yaml
+++ b/.github/workflows/update_ci_image.yaml
@@ -66,7 +66,7 @@ jobs:
- check_ci_image
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v4
+ - uses: actions/checkout@v5
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
diff --git a/README.md b/README.md
index 4ef84c7c30f..d58ef3a8b6b 100644
--- a/README.md
+++ b/README.md
@@ -8,16 +8,16 @@
For detailed instructions on how to:
-- [Getting Started](https://docs.nav2.org/getting_started/index.html)
-- [Concepts](https://docs.nav2.org/concepts/index.html)
-- [Build](https://docs.nav2.org/development_guides/build_docs/index.html#build)
-- [Install](https://docs.nav2.org/development_guides/build_docs/index.html#install)
+- [Concepts](https://docs.nav2.org/concepts/index.html) and [Getting Started](https://docs.nav2.org/getting_started/index.html)
+- [First Time Setup Guide](https://docs.nav2.org/setup_guides/index.html)
+- [ROS Distribution Statuses](https://docs.nav2.org/#distributions)
+- [Build & Install](https://docs.nav2.org/development_guides/build_docs/index.html#build) and [Docker Containers](https://github.com/orgs/ros-navigation/packages/container/package/navigation2)
- [General Tutorials](https://docs.nav2.org/tutorials/index.html) and [Algorithm Developer Tutorials](https://docs.nav2.org/plugin_tutorials/index.html)
-- [Configure](https://docs.nav2.org/configuration/index.html)
+- [Configuration Guide](https://docs.nav2.org/configuration/index.html)
- [Navigation Plugins](https://docs.nav2.org/plugins/index.html)
-- [ROSCon Talks](https://docs.nav2.org/about/roscon.html)
+- [API Docs](https://api.nav2.org/)
+- [ROSCon Talks](https://docs.nav2.org/about/roscon.html) and [Citations](https://docs.nav2.org/citations.html)
- [Migration Guides](https://docs.nav2.org/migration/index.html)
-- [Container Images for Building Nav2](https://github.com/orgs/ros-navigation/packages/container/package/navigation2)
- [Contribute](https://docs.nav2.org/development_guides/involvement_docs/index.html)
Please visit our [documentation site](https://docs.nav2.org/). [Please visit our community Slack here](https://join.slack.com/t/navigation2/shared_invite/zt-uj428p0x-jKx8U7OzK1IOWp5TnDS2rA) (if this link does not work, please contact maintainers to reactivate).
@@ -29,7 +29,7 @@ Please visit our [documentation site](https://docs.nav2.org/). [Please visit our
Please thank our amazing sponsors for their generous support of Nav2 on behalf of the community to allow the project to continue to be professionally maintained, developed, and supported for the long-haul! [Open Navigation LLC](https://www.opennav.org/) provides project leadership, maintenance, development, and support services to the Nav2 & ROS community.
-
+
### [Dexory](https://www.dexory.com/) develops robotics and AI logistics solutions to drive better business decisions using a digital twin of warehouses to provide inventory insights.
@@ -40,6 +40,8 @@ Please thank our amazing sponsors for their generous support of Nav2 on behalf o
### [Stereolabs](https://www.stereolabs.com/) produces the high-quality ZED stereo cameras with a complete vision pipeline from neural depth to SLAM, 3D object tracking, AI and more.
+### [3Laws Robotics](https://3laws.io/) provide Supervisor ROS and Pro, easy-to-use dynamic collision avoidance solutions to improve safety and application throughput.
+
## Citation
If you use the navigation framework, an algorithm from this repository, or ideas from it
diff --git a/doc/sponsors_sept_2025.png b/doc/sponsors_sept_2025.png
new file mode 100644
index 00000000000..655ad1ce3cd
Binary files /dev/null and b/doc/sponsors_sept_2025.png differ
diff --git a/nav2_amcl/CMakeLists.txt b/nav2_amcl/CMakeLists.txt
index aa6cf1a4ed7..e29f641cb84 100644
--- a/nav2_amcl/CMakeLists.txt
+++ b/nav2_amcl/CMakeLists.txt
@@ -1,7 +1,8 @@
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.8)
project(nav2_amcl)
find_package(ament_cmake REQUIRED)
+find_package(backward_ros REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(message_filters REQUIRED)
find_package(nav_msgs REQUIRED)
diff --git a/nav2_amcl/include/nav2_amcl/amcl_node.hpp b/nav2_amcl/include/nav2_amcl/amcl_node.hpp
index 0be08c39db6..65787e82b00 100644
--- a/nav2_amcl/include/nav2_amcl/amcl_node.hpp
+++ b/nav2_amcl/include/nav2_amcl/amcl_node.hpp
@@ -44,9 +44,9 @@
#include "sensor_msgs/msg/laser_scan.hpp"
#include "nav2_ros_common/service_server.hpp"
#include "std_srvs/srv/empty.hpp"
-#include "tf2_ros/message_filter.h"
-#include "tf2_ros/transform_broadcaster.h"
-#include "tf2_ros/transform_listener.h"
+#include "tf2_ros/message_filter.hpp"
+#include "tf2_ros/transform_broadcaster.hpp"
+#include "tf2_ros/transform_listener.hpp"
#define NEW_UNIFORM_SAMPLING 1
diff --git a/nav2_amcl/package.xml b/nav2_amcl/package.xml
index c1a2cbc2cea..69ac2d324b5 100644
--- a/nav2_amcl/package.xml
+++ b/nav2_amcl/package.xml
@@ -24,6 +24,7 @@
ament_cmake
nav2_common
+ backward_ros
geometry_msgs
message_filters
nav_msgs
diff --git a/nav2_amcl/src/amcl_node.cpp b/nav2_amcl/src/amcl_node.cpp
index e7910c583b1..b3b21631a59 100644
--- a/nav2_amcl/src/amcl_node.cpp
+++ b/nav2_amcl/src/amcl_node.cpp
@@ -38,11 +38,11 @@
#include "tf2/utils.hpp"
#include "tf2_geometry_msgs/tf2_geometry_msgs.hpp"
#include "tf2/LinearMath/Transform.hpp"
-#include "tf2_ros/buffer.h"
-#include "tf2_ros/message_filter.h"
-#include "tf2_ros/transform_broadcaster.h"
-#include "tf2_ros/transform_listener.h"
-#include "tf2_ros/create_timer_ros.h"
+#include "tf2_ros/buffer.hpp"
+#include "tf2_ros/message_filter.hpp"
+#include "tf2_ros/transform_broadcaster.hpp"
+#include "tf2_ros/transform_listener.hpp"
+#include "tf2_ros/create_timer_ros.hpp"
#include "nav2_amcl/portable_utils.hpp"
#include "nav2_ros_common/validate_messages.hpp"
@@ -1339,7 +1339,7 @@ AmclNode::initTransforms()
get_node_timers_interface(),
callback_group_);
tf_buffer_->setCreateTimerInterface(timer_interface);
- tf_listener_ = std::make_shared(*tf_buffer_);
+ tf_listener_ = std::make_shared(*tf_buffer_, this, true);
tf_broadcaster_ = std::make_shared(shared_from_this());
sent_first_transform_ = false;
diff --git a/nav2_behavior_tree/CMakeLists.txt b/nav2_behavior_tree/CMakeLists.txt
index 03339b19cdc..6aa40c5ed05 100644
--- a/nav2_behavior_tree/CMakeLists.txt
+++ b/nav2_behavior_tree/CMakeLists.txt
@@ -1,7 +1,8 @@
-cmake_minimum_required(VERSION 3.5)
+cmake_minimum_required(VERSION 3.8)
project(nav2_behavior_tree CXX)
find_package(ament_cmake REQUIRED)
+find_package(backward_ros REQUIRED)
find_package(action_msgs REQUIRED)
find_package(behaviortree_cpp REQUIRED)
find_package(geometry_msgs REQUIRED)
@@ -18,6 +19,7 @@ find_package(std_srvs REQUIRED)
find_package(tf2 REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(nav2_ros_common REQUIRED)
+find_package(angles REQUIRED)
nav2_package()
@@ -32,6 +34,7 @@ target_include_directories(${library_name}
"$")
target_link_libraries(${library_name} PUBLIC
${action_msgs_TARGETS}
+ angles::angles
behaviortree_cpp::behaviortree_cpp
${geometry_msgs_TARGETS}
${nav_msgs_TARGETS}
@@ -122,8 +125,8 @@ list(APPEND plugin_libs nav2_is_path_valid_condition_bt_node)
add_library(nav2_time_expired_condition_bt_node SHARED plugins/condition/time_expired_condition.cpp)
list(APPEND plugin_libs nav2_time_expired_condition_bt_node)
-add_library(nav2_path_expiring_timer_condition SHARED plugins/condition/path_expiring_timer_condition.cpp)
-list(APPEND plugin_libs nav2_path_expiring_timer_condition)
+add_library(nav2_path_expiring_timer_condition_bt_node SHARED plugins/condition/path_expiring_timer_condition.cpp)
+list(APPEND plugin_libs nav2_path_expiring_timer_condition_bt_node)
add_library(nav2_distance_traveled_condition_bt_node SHARED plugins/condition/distance_traveled_condition.cpp)
list(APPEND plugin_libs nav2_distance_traveled_condition_bt_node)
@@ -218,6 +221,12 @@ list(APPEND plugin_libs nav2_nonblocking_sequence_bt_node)
add_library(nav2_round_robin_node_bt_node SHARED plugins/control/round_robin_node.cpp)
list(APPEND plugin_libs nav2_round_robin_node_bt_node)
+add_library(nav2_pause_resume_controller_bt_node SHARED plugins/control/pause_resume_controller.cpp)
+list(APPEND plugin_libs nav2_pause_resume_controller_bt_node)
+
+add_library(nav2_persistent_sequence_bt_node SHARED plugins/control/persistent_sequence.cpp)
+list(APPEND plugin_libs nav2_persistent_sequence_bt_node)
+
add_library(nav2_single_trigger_bt_node SHARED plugins/decorator/single_trigger_node.cpp)
list(APPEND plugin_libs nav2_single_trigger_bt_node)
@@ -268,6 +277,7 @@ foreach(bt_plugin ${plugin_libs})
${std_msgs_TARGETS}
${std_srvs_TARGETS}
nav2_ros_common::nav2_ros_common
+ angles::angles
)
target_compile_definitions(${bt_plugin} PRIVATE BT_PLUGIN_EXPORT)
endforeach()
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/behavior_tree_engine.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/behavior_tree_engine.hpp
index 96fb5df0dce..b17a914a541 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/behavior_tree_engine.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/behavior_tree_engine.hpp
@@ -98,6 +98,12 @@ class BehaviorTreeEngine
*/
void resetGrootMonitor();
+ /**
+ * @brief Function to register a BT from an XML file
+ * @param file_path Path to BT XML file
+ */
+ void registerTreeFromFile(const std::string & file_path);
+
/**
* @brief Function to explicitly reset all BT nodes to initial state
* @param tree Tree to halt
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server.hpp
index d5d1fa4c3a4..924d1ebc28a 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server.hpp
@@ -56,7 +56,8 @@ class BtActionServer
OnGoalReceivedCallback on_goal_received_callback,
OnLoopCallback on_loop_callback,
OnPreemptCallback on_preempt_callback,
- OnCompletionCallback on_completion_callback);
+ OnCompletionCallback on_completion_callback,
+ const std::vector & search_directories = std::vector{});
/**
* @brief A destructor for nav2_behavior_tree::BtActionServer class
@@ -102,7 +103,8 @@ class BtActionServer
* @return bool true if the resulting BT correspond to the one in bt_xml_filename. false
* if something went wrong, and previous BT is maintained
*/
- bool loadBehaviorTree(const std::string & bt_xml_filename = "");
+ bool loadBehaviorTree(
+ const std::string & bt_xml_filename = "");
/**
* @brief Getter function for BT Blackboard
@@ -245,6 +247,7 @@ class BtActionServer
// The XML file that contains the Behavior Tree to create
std::string current_bt_xml_filename_;
std::string default_bt_xml_filename_;
+ std::vector search_directories_;
// The wrapper class for the BT functionality
std::unique_ptr bt_;
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server_impl.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server_impl.hpp
index 184f3d94aca..10a8289d5f4 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server_impl.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server_impl.hpp
@@ -42,9 +42,11 @@ BtActionServer::BtActionServer(
OnGoalReceivedCallback on_goal_received_callback,
OnLoopCallback on_loop_callback,
OnPreemptCallback on_preempt_callback,
- OnCompletionCallback on_completion_callback)
+ OnCompletionCallback on_completion_callback,
+ const std::vector & search_directories)
: action_name_(action_name),
default_bt_xml_filename_(default_bt_xml_filename),
+ search_directories_(search_directories),
plugin_lib_names_(plugin_lib_names),
node_(parent),
on_goal_received_callback_(on_goal_received_callback),
@@ -246,6 +248,8 @@ void BtActionServer::setGrootMonitoring(
template
bool BtActionServer::loadBehaviorTree(const std::string & bt_xml_filename)
{
+ namespace fs = std::filesystem;
+
// Empty filename is default for backward compatibility
auto filename = bt_xml_filename.empty() ? default_bt_xml_filename_ : bt_xml_filename;
@@ -255,19 +259,38 @@ bool BtActionServer::loadBehaviorTree(const std::string & bt_xml
return true;
}
- // if a new tree is created, than the Groot2 Publisher must be destroyed
+ // Reset any existing Groot2 monitoring
bt_->resetGrootMonitor();
- // Read the input BT XML from the specified file into a string
std::ifstream xml_file(filename);
-
if (!xml_file.good()) {
setInternalError(ActionT::Result::FAILED_TO_LOAD_BEHAVIOR_TREE,
- "Couldn't open input XML file: " + filename);
+ "Couldn't open BT XML file: " + filename);
return false;
}
- // Create the Behavior Tree from the XML input
+ const auto canonical_main_bt = fs::canonical(filename);
+
+ // Register all XML behavior Subtrees found in the given directories
+ for (const auto & directory : search_directories_) {
+ try {
+ for (const auto & entry : fs::directory_iterator(directory)) {
+ if (entry.path().extension() == ".xml") {
+ // Skip registering the main tree file
+ if (fs::equivalent(fs::canonical(entry.path()), canonical_main_bt)) {
+ continue;
+ }
+ bt_->registerTreeFromFile(entry.path().string());
+ }
+ }
+ } catch (const std::exception & e) {
+ setInternalError(ActionT::Result::FAILED_TO_LOAD_BEHAVIOR_TREE,
+ "Exception reading behavior tree directory: " + std::string(e.what()));
+ return false;
+ }
+ }
+
+ // Try to load the main BT tree
try {
tree_ = bt_->createTreeFromFile(filename, blackboard_);
for (auto & subtree : tree_.subtrees) {
@@ -281,15 +304,15 @@ bool BtActionServer::loadBehaviorTree(const std::string & bt_xml
}
} catch (const std::exception & e) {
setInternalError(ActionT::Result::FAILED_TO_LOAD_BEHAVIOR_TREE,
- std::string("Exception when loading BT: ") + e.what());
+ std::string("Exception when creating BT tree from file: ") + e.what());
return false;
}
+ // Optional logging and monitoring
topic_logger_ = std::make_unique(client_node_, tree_);
current_bt_xml_filename_ = filename;
- // Enable monitoring with Groot2
if (enable_groot_monitoring_) {
bt_->addGrootMonitoring(&tree_, groot_server_port_);
RCLCPP_DEBUG(
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/controller_selector_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/controller_selector_node.hpp
index ebc29fa9721..cd52705f197 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/controller_selector_node.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/controller_selector_node.hpp
@@ -18,6 +18,7 @@
#include
#include
+#include
#include "std_msgs/msg/string.hpp"
@@ -102,6 +103,7 @@ class ControllerSelector : public BT::SyncActionNode
rclcpp::executors::SingleThreadedExecutor callback_group_executor_;
std::string topic_name_;
+ std::chrono::milliseconds bt_loop_duration_;
};
} // namespace nav2_behavior_tree
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/goal_checker_selector_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/goal_checker_selector_node.hpp
index 820a1a7f71f..0b9d9f6b43c 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/goal_checker_selector_node.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/goal_checker_selector_node.hpp
@@ -18,6 +18,7 @@
#include
#include
+#include
#include "std_msgs/msg/string.hpp"
@@ -102,6 +103,7 @@ class GoalCheckerSelector : public BT::SyncActionNode
rclcpp::executors::SingleThreadedExecutor callback_group_executor_;
std::string topic_name_;
+ std::chrono::milliseconds bt_loop_duration_;
};
} // namespace nav2_behavior_tree
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/planner_selector_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/planner_selector_node.hpp
index 07026ac64f9..269ad96b13b 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/planner_selector_node.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/planner_selector_node.hpp
@@ -18,6 +18,7 @@
#include
#include
+#include
#include "std_msgs/msg/string.hpp"
@@ -103,6 +104,7 @@ class PlannerSelector : public BT::SyncActionNode
rclcpp::executors::SingleThreadedExecutor callback_group_executor_;
std::string topic_name_;
+ std::chrono::milliseconds bt_loop_duration_;
};
} // namespace nav2_behavior_tree
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/progress_checker_selector_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/progress_checker_selector_node.hpp
index c58f615dbf7..3ff8e397313 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/progress_checker_selector_node.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/progress_checker_selector_node.hpp
@@ -17,6 +17,7 @@
#include
#include
+#include
#include "std_msgs/msg/string.hpp"
@@ -101,6 +102,7 @@ class ProgressCheckerSelector : public BT::SyncActionNode
rclcpp::executors::SingleThreadedExecutor callback_group_executor_;
std::string topic_name_;
+ std::chrono::milliseconds bt_loop_duration_;
};
} // namespace nav2_behavior_tree
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/remove_in_collision_goals_action.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/remove_in_collision_goals_action.hpp
index a76394e2ffe..d402d37fde5 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/remove_in_collision_goals_action.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/remove_in_collision_goals_action.hpp
@@ -73,6 +73,9 @@ class RemoveInCollisionGoals : public BtServiceNode
BT::InputPort(
"consider_unknown_as_obstacle", false,
"Whether to consider unknown cost as obstacle"),
+ BT::InputPort(
+ "nb_goals_to_consider", 5,
+ "Number of goals to consider for collision checking"),
BT::OutputPort("output_goals",
"Goals with in-collision goals removed"),
BT::InputPort>("input_waypoint_statuses",
@@ -85,6 +88,7 @@ class RemoveInCollisionGoals : public BtServiceNode
private:
bool use_footprint_;
bool consider_unknown_as_obstacle_;
+ int nb_goals_to_consider_;
double cost_threshold_;
nav_msgs::msg::Goals input_goals_;
};
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/remove_passed_goals_action.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/remove_passed_goals_action.hpp
index a651318379f..d7271c3fbe1 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/remove_passed_goals_action.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/remove_passed_goals_action.hpp
@@ -62,6 +62,9 @@ class RemovePassedGoals : public BT::ActionNodeBase
"Goals with passed viapoints removed"),
BT::InputPort("radius", 0.5, "radius to goal for it to be considered for removal"),
BT::InputPort("robot_base_frame", "Robot base frame"),
+ BT::InputPort("nb_goals_to_consider", 1, "Number of waypoints to consider"),
+ BT::InputPort("yaw", 1.57,
+ "yaw threshold to goal for it to be considered for removal"),
BT::InputPort>("input_waypoint_statuses",
"Original waypoint_statuses to mark waypoint status from"),
BT::OutputPort>("output_waypoint_statuses",
@@ -74,10 +77,12 @@ class RemovePassedGoals : public BT::ActionNodeBase
BT::NodeStatus tick() override;
double viapoint_achieved_radius_;
+ double viapoint_achieved_yaw_;
double transform_tolerance_;
nav2::LifecycleNode::SharedPtr node_;
std::shared_ptr tf_;
std::string robot_base_frame_;
+ int nb_goals_to_consider_;
};
} // namespace nav2_behavior_tree
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/smoother_selector_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/smoother_selector_node.hpp
index f752fafb913..6d438262a58 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/smoother_selector_node.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/smoother_selector_node.hpp
@@ -18,6 +18,7 @@
#include
#include
+#include
#include "std_msgs/msg/string.hpp"
@@ -102,6 +103,7 @@ class SmootherSelector : public BT::SyncActionNode
rclcpp::executors::SingleThreadedExecutor callback_group_executor_;
std::string topic_name_;
+ std::chrono::milliseconds bt_loop_duration_;
};
} // namespace nav2_behavior_tree
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/truncate_path_local_action.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/truncate_path_local_action.hpp
index 6ce8a76fd64..9ffc5aa773f 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/truncate_path_local_action.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/action/truncate_path_local_action.hpp
@@ -25,7 +25,7 @@
#include "nav_msgs/msg/path.hpp"
#include "nav2_behavior_tree/bt_utils.hpp"
#include "nav2_behavior_tree/json_utils.hpp"
-#include "tf2_ros/buffer.h"
+#include "tf2_ros/buffer.hpp"
#include "nav2_ros_common/lifecycle_node.hpp"
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/are_poses_near_condition.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/are_poses_near_condition.hpp
index db615c06181..eb099f329b0 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/are_poses_near_condition.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/are_poses_near_condition.hpp
@@ -20,7 +20,7 @@
#include "nav2_ros_common/lifecycle_node.hpp"
#include "behaviortree_cpp/condition_node.h"
-#include "tf2_ros/buffer.h"
+#include "tf2_ros/buffer.hpp"
#include "nav2_behavior_tree/bt_utils.hpp"
namespace nav2_behavior_tree
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/distance_traveled_condition.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/distance_traveled_condition.hpp
index abcf722b872..c75f8b78d98 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/distance_traveled_condition.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/distance_traveled_condition.hpp
@@ -23,7 +23,7 @@
#include "nav2_ros_common/lifecycle_node.hpp"
#include "geometry_msgs/msg/pose_stamped.hpp"
-#include "tf2_ros/buffer.h"
+#include "tf2_ros/buffer.hpp"
#include "nav2_behavior_tree/bt_utils.hpp"
namespace nav2_behavior_tree
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/goal_reached_condition.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/goal_reached_condition.hpp
index aeebfcb3634..db3c56f24b7 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/goal_reached_condition.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/goal_reached_condition.hpp
@@ -23,7 +23,7 @@
#include "behaviortree_cpp/json_export.h"
#include "nav2_behavior_tree/bt_utils.hpp"
#include "nav2_behavior_tree/json_utils.hpp"
-#include "tf2_ros/buffer.h"
+#include "tf2_ros/buffer.hpp"
namespace nav2_behavior_tree
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_battery_charging_condition.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_battery_charging_condition.hpp
index 2c95e1e880e..d456d8092c1 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_battery_charging_condition.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_battery_charging_condition.hpp
@@ -18,6 +18,7 @@
#include
#include
#include
+#include
#include "nav2_ros_common/lifecycle_node.hpp"
#include "sensor_msgs/msg/battery_state.hpp"
@@ -85,6 +86,7 @@ class IsBatteryChargingCondition : public BT::ConditionNode
nav2::Subscription::SharedPtr battery_sub_;
std::string battery_topic_;
bool is_battery_charging_;
+ std::chrono::milliseconds bt_loop_duration_;
};
} // namespace nav2_behavior_tree
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_battery_low_condition.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_battery_low_condition.hpp
index d66eb5eea72..de31aa1c4e0 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_battery_low_condition.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_battery_low_condition.hpp
@@ -19,6 +19,7 @@
#include
#include
#include
+#include
#include "nav2_ros_common/lifecycle_node.hpp"
#include "sensor_msgs/msg/battery_state.hpp"
@@ -93,6 +94,7 @@ class IsBatteryLowCondition : public BT::ConditionNode
double min_battery_;
bool is_voltage_;
bool is_battery_low_;
+ std::chrono::milliseconds bt_loop_duration_;
};
} // namespace nav2_behavior_tree
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_goal_nearby_condition.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_goal_nearby_condition.hpp
new file mode 100644
index 00000000000..b434e75f1d3
--- /dev/null
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_goal_nearby_condition.hpp
@@ -0,0 +1,81 @@
+// Copyright (c) 2024 Jakub Chudziński
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef NAV2_BEHAVIOR_TREE__PLUGINS__CONDITION__IS_GOAL_NEARBY_CONDITION_HPP_
+#define NAV2_BEHAVIOR_TREE__PLUGINS__CONDITION__IS_GOAL_NEARBY_CONDITION_HPP_
+
+#include
+#include "nav_msgs/msg/path.hpp"
+
+#include "rclcpp/rclcpp.hpp"
+#include "behaviortree_cpp/condition_node.h"
+
+
+namespace nav2_behavior_tree
+{
+
+/**
+ * @brief A BT::ConditionNode that returns SUCCESS when the IsGoalNearby
+ * service returns true and FAILURE otherwise
+ */
+class IsGoalNearbyCondition : public BT::ConditionNode
+{
+public:
+ /**
+ * @brief A constructor for nav2_behavior_tree::IsGoalNearbyCondition
+ * @param condition_name Name for the XML tag for this node
+ * @param conf BT node configuration
+ */
+ IsGoalNearbyCondition(
+ const std::string & condition_name,
+ const BT::NodeConfiguration & conf);
+
+ IsGoalNearbyCondition() = delete;
+
+ /**
+ * @brief The main override required by a BT action
+ * @return BT::NodeStatus Status of tick execution
+ */
+ BT::NodeStatus tick() override;
+
+ /**
+ * @brief Creates list of BT ports
+ * @return BT::PortsList Containing node-specific ports
+ */
+ static BT::PortsList providedPorts()
+ {
+ return {
+ BT::InputPort("path", "Planned Path"),
+ BT::InputPort(
+ "proximity_threshold", 3.0,
+ "Proximity length (m) of the remaining path considered as a nearby"),
+ };
+ }
+
+private:
+
+ /**
+ * @brief Checks if the robot is in the goal proximity
+ * @param goal_path current planned path to the goal
+ * @param prox_thr proximity length (m) of the remaining path considered as a nearby
+ * @return whether the robot is in the goal proximity
+ */
+ bool isRobotInGoalProximity(
+ const nav_msgs::msg::Path& goal_path,
+ const double& prox_thr);
+};
+
+} // namespace nav2_behavior_tree
+
+#endif // NAV2_BEHAVIOR_TREE__PLUGINS__CONDITION__IS_GOAL_NEARBY_CONDITION_HPP_
\ No newline at end of file
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_path_valid_condition.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_path_valid_condition.hpp
index 334eaefd6f0..f13ed225aaf 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_path_valid_condition.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/is_path_valid_condition.hpp
@@ -73,7 +73,7 @@ class IsPathValidCondition : public BT::ConditionNode
return {
BT::InputPort("path", "Path to Check"),
BT::InputPort("server_timeout"),
- BT::InputPort("max_cost", 253, "Maximum cost of the path"),
+ BT::InputPort("max_cost", 254, "Maximum cost of the path"),
BT::InputPort(
"consider_unknown_as_obstacle", false,
"Whether to consider unknown cost as obstacle")
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/transform_available_condition.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/transform_available_condition.hpp
index 41a86ee813d..be1bcd6ee18 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/transform_available_condition.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/condition/transform_available_condition.hpp
@@ -21,7 +21,7 @@
#include "nav2_ros_common/lifecycle_node.hpp"
#include "behaviortree_cpp/condition_node.h"
-#include "tf2_ros/buffer.h"
+#include "tf2_ros/buffer.hpp"
namespace nav2_behavior_tree
{
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/control/pause_resume_controller.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/control/pause_resume_controller.hpp
new file mode 100644
index 00000000000..fa5bfa35f2f
--- /dev/null
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/control/pause_resume_controller.hpp
@@ -0,0 +1,153 @@
+// Copyright (c) 2025 Enjoy Robotics
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef NAV2_BEHAVIOR_TREE__PLUGINS__CONTROL__PAUSE_RESUME_CONTROLLER_HPP_
+#define NAV2_BEHAVIOR_TREE__PLUGINS__CONTROL__PAUSE_RESUME_CONTROLLER_HPP_
+
+// Other includes
+#include
+#include
+#include