diff --git a/nav2_tasks/CHANGELOG.rst b/nav2_behavior_tree/CHANGELOG.rst similarity index 100% rename from nav2_tasks/CHANGELOG.rst rename to nav2_behavior_tree/CHANGELOG.rst diff --git a/nav2_tasks/CMakeLists.txt b/nav2_behavior_tree/CMakeLists.txt similarity index 98% rename from nav2_tasks/CMakeLists.txt rename to nav2_behavior_tree/CMakeLists.txt index 9f5e0d3eec31f089653b398b109e7878f5931257..dd52a4ef67682c32fe8a279ca5fac11e0ca5f553 100644 --- a/nav2_tasks/CMakeLists.txt +++ b/nav2_behavior_tree/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.5) -project(nav2_tasks) +project(nav2_behavior_tree) find_package(ament_cmake REQUIRED) find_package(nav2_common REQUIRED) diff --git a/nav2_tasks/README.md b/nav2_behavior_tree/README.md similarity index 82% rename from nav2_tasks/README.md rename to nav2_behavior_tree/README.md index 3b6083ffab06b84715f299d7162ff5b54f5493c9..90089b392e3a343d14f0b9c0016849e09639cbd8 100644 --- a/nav2_tasks/README.md +++ b/nav2_behavior_tree/README.md @@ -2,14 +2,14 @@ A *task* is an abstraction roughly modeled after ROS1's SimpleActionClient/Server (which is not yet available in ROS2). A *task client* issues a command to *task server*, which receives the command, performs a (typically long-running) task, and asynchronously returns a result to the client. The task client may cancel the task during its execution. After cancellation or completion, the task client may issue another task to the task server. -The **nav2_tasks** library defines: +The **nav2_behavior_tree** library defines: -* [TaskServer](include/nav2_tasks/task_server.hpp) and [TaskClient](include/nav2_tasks/task_client.hpp) templates which are used as base classes to implement task servers and their associated task clients -* A few derived classes, such as [ComputePathToPoseTask](include/nav2_tasks/compute_path_to_pose_task.hpp), that define specific task clients and servers +* [TaskServer](include/nav2_behavior_tree/task_server.hpp) and [TaskClient](include/nav2_behavior_tree/task_client.hpp) templates which are used as base classes to implement task servers and their associated task clients +* A few derived classes, such as [ComputePathToPoseTask](include/nav2_behavior_tree/compute_path_to_pose_task.hpp), that define specific task clients and servers For convenience the nav_tasks library also provides: -* A [ServiceClient](include/nav2_tasks/service_client.hpp) template used to define clients for ROS2 services -* A couple specific service client classes, such as [MapServiceClient](include/nav2_tasks/map_service_client.hpp) that use the ServiceClient template +* A [ServiceClient](include/nav2_behavior_tree/service_client.hpp) template used to define clients for ROS2 services +* A couple specific service client classes, such as [MapServiceClient](include/nav2_behavior_tree/map_service_client.hpp) that use the ServiceClient template ## Overview @@ -26,7 +26,7 @@ One can define additional tasks using the TaskClient and TaskSever templates. To For example, to define a new task, named *DoSomething*, that takes a String as input and an Empty message as a result, ```C++ -namespace nav2_tasks +namespace nav2_behavior_tree { using DoSomethingCommand = std_msgs::msg::String; @@ -47,18 +47,18 @@ inline const char * getTaskName<DoSomethingCommand, DoSomethingResult>() Then, to implement the task server, a derived class inherits from this newly-defined task type and overrides the execute() method. For example, ```C++ -class DoSomethingImplementation : public nav2_tasks::DoSomethingTaskServer +class DoSomethingImplementation : public nav2_behavior_tree::DoSomethingTaskServer { public: DoSomethingImplementation(); ~DoSomethingImplementation(); - nav2_tasks::TaskStatus execute( - const nav2_tasks::DoSomethingCommand::SharedPtr command) override; + nav2_behavior_tree::TaskStatus execute( + const nav2_behavior_tree::DoSomethingCommand::SharedPtr command) override; }; TaskStatus -DoSomethingImplementation::execute(const nav2_tasks::DoSomethingCommand::SharedPtr command) +DoSomethingImplementation::execute(const nav2_behavior_tree::DoSomethingCommand::SharedPtr command) { for (;;) { @@ -73,7 +73,7 @@ DoSomethingImplementation::execute(const nav2_tasks::DoSomethingCommand::SharedP // If we've successfully completed the task, return the result if (done) { - nav2_tasks::DoSomethingResult result; + nav2_behavior_tree::DoSomethingResult result; // TODO: Set fields in the result message, if any diff --git a/nav2_tasks/doc/hierarchy.odg b/nav2_behavior_tree/doc/hierarchy.odg similarity index 100% rename from nav2_tasks/doc/hierarchy.odg rename to nav2_behavior_tree/doc/hierarchy.odg diff --git a/nav2_tasks/doc/hierarchy.svg b/nav2_behavior_tree/doc/hierarchy.svg similarity index 100% rename from nav2_tasks/doc/hierarchy.svg rename to nav2_behavior_tree/doc/hierarchy.svg diff --git a/nav2_tasks/include/nav2_tasks/back_up_action.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/back_up_action.hpp similarity index 80% rename from nav2_tasks/include/nav2_tasks/back_up_action.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/back_up_action.hpp index 13e40b971d23b47e2af160122ed15850cee2e360..f34b7632fc7bbb2c29b41f0576307c6eed9b3fc9 100644 --- a/nav2_tasks/include/nav2_tasks/back_up_action.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/back_up_action.hpp @@ -12,17 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__BACK_UP_ACTION_HPP_ -#define NAV2_TASKS__BACK_UP_ACTION_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__BACK_UP_ACTION_HPP_ +#define NAV2_BEHAVIOR_TREE__BACK_UP_ACTION_HPP_ #include <string> #include <memory> #include <cmath> -#include "nav2_tasks/bt_action_node.hpp" +#include "nav2_behavior_tree/bt_action_node.hpp" #include "nav2_msgs/action/back_up.hpp" -namespace nav2_tasks +namespace nav2_behavior_tree { class BackUpAction : public BtActionNode<nav2_msgs::action::BackUp> @@ -42,6 +42,6 @@ public: } }; -} // namespace nav2_tasks +} // namespace nav2_behavior_tree -#endif // NAV2_TASKS__BACK_UP_ACTION_HPP_ +#endif // NAV2_BEHAVIOR_TREE__BACK_UP_ACTION_HPP_ diff --git a/nav2_tasks/include/nav2_tasks/behavior_tree_engine.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/behavior_tree_engine.hpp similarity index 90% rename from nav2_tasks/include/nav2_tasks/behavior_tree_engine.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/behavior_tree_engine.hpp index 810f58a02aa34031856d8f2594defc1b35478e9d..92c3e9fe829109e28771ad318f0a40c1c6ae9975 100644 --- a/nav2_tasks/include/nav2_tasks/behavior_tree_engine.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/behavior_tree_engine.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__BEHAVIOR_TREE_ENGINE_HPP_ -#define NAV2_TASKS__BEHAVIOR_TREE_ENGINE_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__BEHAVIOR_TREE_ENGINE_HPP_ +#define NAV2_BEHAVIOR_TREE__BEHAVIOR_TREE_ENGINE_HPP_ #include <memory> #include <string> @@ -23,7 +23,7 @@ #include "behaviortree_cpp/bt_factory.h" #include "behaviortree_cpp/xml_parsing.h" -namespace nav2_tasks +namespace nav2_behavior_tree { enum class BtStatus { SUCCEEDED, FAILED, CANCELED }; @@ -73,6 +73,6 @@ protected: BT::BehaviorTreeFactory factory_; }; -} // namespace nav2_tasks +} // namespace nav2_behavior_tree -#endif // NAV2_TASKS__BEHAVIOR_TREE_ENGINE_HPP_ +#endif // NAV2_BEHAVIOR_TREE__BEHAVIOR_TREE_ENGINE_HPP_ diff --git a/nav2_tasks/include/nav2_tasks/bt_action_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp similarity index 96% rename from nav2_tasks/include/nav2_tasks/bt_action_node.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp index 9065a07f2b4dc1f93dad253ec8a979bbe121b40a..d95a5655b32f295253db8ab6dc491c1e691a7a93 100644 --- a/nav2_tasks/include/nav2_tasks/bt_action_node.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_node.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__BT_ACTION_NODE_HPP_ -#define NAV2_TASKS__BT_ACTION_NODE_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__BT_ACTION_NODE_HPP_ +#define NAV2_BEHAVIOR_TREE__BT_ACTION_NODE_HPP_ #include <memory> #include <string> @@ -22,7 +22,7 @@ #include "nav2_util/node_utils.hpp" #include "rclcpp_action/rclcpp_action.hpp" -namespace nav2_tasks +namespace nav2_behavior_tree { template<class ActionT> @@ -197,6 +197,6 @@ protected: std::chrono::milliseconds node_loop_timeout_; }; -} // namespace nav2_tasks +} // namespace nav2_behavior_tree -#endif // NAV2_TASKS__BT_ACTION_NODE_HPP_ +#endif // NAV2_BEHAVIOR_TREE__BT_ACTION_NODE_HPP_ diff --git a/nav2_tasks/include/nav2_tasks/bt_conversions.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/bt_conversions.hpp similarity index 93% rename from nav2_tasks/include/nav2_tasks/bt_conversions.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/bt_conversions.hpp index 139a2168ced356ce39479d1a49deaef267f8e550..223d420321e871c784bd74535175a0853adddb68 100644 --- a/nav2_tasks/include/nav2_tasks/bt_conversions.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/bt_conversions.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__BT_CONVERSIONS_HPP_ -#define NAV2_TASKS__BT_CONVERSIONS_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__BT_CONVERSIONS_HPP_ +#define NAV2_BEHAVIOR_TREE__BT_CONVERSIONS_HPP_ #include "behaviortree_cpp/behavior_tree.h" #include "geometry_msgs/msg/point.hpp" @@ -61,4 +61,4 @@ inline geometry_msgs::msg::Quaternion convertFromString(const StringView & key) } // namespace BT -#endif // NAV2_TASKS__BT_CONVERSIONS_HPP_ +#endif // NAV2_BEHAVIOR_TREE__BT_CONVERSIONS_HPP_ diff --git a/nav2_tasks/include/nav2_tasks/clear_entirely_costmap_service_client.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/clear_entirely_costmap_service_client.hpp similarity index 82% rename from nav2_tasks/include/nav2_tasks/clear_entirely_costmap_service_client.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/clear_entirely_costmap_service_client.hpp index 2ae755a1ce3dd83bb1e59774db9d29e85da02a64..7b6acd0ff48bb69ba850c7d87ec5d06b75f1a570 100644 --- a/nav2_tasks/include/nav2_tasks/clear_entirely_costmap_service_client.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/clear_entirely_costmap_service_client.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__CLEAR_ENTIRELY_COSTMAP_SERVICE_CLIENT_HPP_ -#define NAV2_TASKS__CLEAR_ENTIRELY_COSTMAP_SERVICE_CLIENT_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__CLEAR_ENTIRELY_COSTMAP_SERVICE_CLIENT_HPP_ +#define NAV2_BEHAVIOR_TREE__CLEAR_ENTIRELY_COSTMAP_SERVICE_CLIENT_HPP_ #include <string> #include "nav2_util/service_client.hpp" #include "std_srvs/srv/empty.hpp" #include "nav2_msgs/srv/clear_entire_costmap.hpp" -namespace nav2_tasks +namespace nav2_behavior_tree { class ClearEntirelyCostmapServiceClient @@ -38,6 +38,6 @@ public: nav2_util::ServiceClient<nav2_msgs::srv::ClearEntireCostmap>::ResponseType; }; -} // namespace nav2_tasks +} // namespace nav2_behavior_tree -#endif // NAV2_TASKS__CLEAR_ENTIRELY_COSTMAP_SERVICE_CLIENT_HPP_ +#endif // NAV2_BEHAVIOR_TREE__CLEAR_ENTIRELY_COSTMAP_SERVICE_CLIENT_HPP_ diff --git a/nav2_tasks/include/nav2_tasks/compute_path_to_pose_action.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/compute_path_to_pose_action.hpp similarity index 82% rename from nav2_tasks/include/nav2_tasks/compute_path_to_pose_action.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/compute_path_to_pose_action.hpp index a6071cdfc93783a8aaacdb0cedae24b15ade1f0a..c4c29ed04cd44dc16d67d2416abf6a5b68f9b0ae 100644 --- a/nav2_tasks/include/nav2_tasks/compute_path_to_pose_action.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/compute_path_to_pose_action.hpp @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__COMPUTE_PATH_TO_POSE_ACTION_HPP_ -#define NAV2_TASKS__COMPUTE_PATH_TO_POSE_ACTION_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__COMPUTE_PATH_TO_POSE_ACTION_HPP_ +#define NAV2_BEHAVIOR_TREE__COMPUTE_PATH_TO_POSE_ACTION_HPP_ #include <memory> #include <string> #include "nav2_msgs/action/compute_path_to_pose.hpp" -#include "nav2_tasks/bt_action_node.hpp" +#include "nav2_behavior_tree/bt_action_node.hpp" -namespace nav2_tasks +namespace nav2_behavior_tree { class ComputePathToPoseAction : public BtActionNode<nav2_msgs::action::ComputePathToPose> @@ -52,6 +52,6 @@ private: bool first_time_{true}; }; -} // namespace nav2_tasks +} // namespace nav2_behavior_tree -#endif // NAV2_TASKS__COMPUTE_PATH_TO_POSE_ACTION_HPP_ +#endif // NAV2_BEHAVIOR_TREE__COMPUTE_PATH_TO_POSE_ACTION_HPP_ diff --git a/nav2_tasks/include/nav2_tasks/follow_path_action.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/follow_path_action.hpp similarity index 85% rename from nav2_tasks/include/nav2_tasks/follow_path_action.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/follow_path_action.hpp index 0424a848db8e1ac12f56fdec56ea91f1d3a0828f..923eddc8b12b5a1dfdb57b8b7a964d4ef52c4883 100644 --- a/nav2_tasks/include/nav2_tasks/follow_path_action.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/follow_path_action.hpp @@ -12,16 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__FOLLOW_PATH_ACTION_HPP_ -#define NAV2_TASKS__FOLLOW_PATH_ACTION_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__FOLLOW_PATH_ACTION_HPP_ +#define NAV2_BEHAVIOR_TREE__FOLLOW_PATH_ACTION_HPP_ #include <memory> #include <string> #include "nav2_msgs/action/follow_path.hpp" -#include "nav2_tasks/bt_action_node.hpp" +#include "nav2_behavior_tree/bt_action_node.hpp" -namespace nav2_tasks +namespace nav2_behavior_tree { class FollowPathAction : public BtActionNode<nav2_msgs::action::FollowPath> @@ -57,6 +57,6 @@ public: } }; -} // namespace nav2_tasks +} // namespace nav2_behavior_tree -#endif // NAV2_TASKS__FOLLOW_PATH_ACTION_HPP_ +#endif // NAV2_BEHAVIOR_TREE__FOLLOW_PATH_ACTION_HPP_ diff --git a/nav2_tasks/include/nav2_tasks/goal_reached_condition.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/goal_reached_condition.hpp similarity index 91% rename from nav2_tasks/include/nav2_tasks/goal_reached_condition.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/goal_reached_condition.hpp index ccbf7c87c31c2ed0562d1e3c9e1cf9145c7194bf..58907cd6ec3c68ef0d06eff5126f56c4a60880b2 100644 --- a/nav2_tasks/include/nav2_tasks/goal_reached_condition.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/goal_reached_condition.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__GOAL_REACHED_CONDITION_HPP_ -#define NAV2_TASKS__GOAL_REACHED_CONDITION_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__GOAL_REACHED_CONDITION_HPP_ +#define NAV2_BEHAVIOR_TREE__GOAL_REACHED_CONDITION_HPP_ #include <string> #include <memory> @@ -23,7 +23,7 @@ #include "nav2_robot/robot.hpp" #include "geometry_msgs/msg/pose_with_covariance_stamped.hpp" -namespace nav2_tasks +namespace nav2_behavior_tree { class GoalReachedCondition : public BT::ConditionNode @@ -102,6 +102,6 @@ private: double goal_reached_tol_; }; -} // namespace nav2_tasks +} // namespace nav2_behavior_tree -#endif // NAV2_TASKS__GOAL_REACHED_CONDITION_HPP_ +#endif // NAV2_BEHAVIOR_TREE__GOAL_REACHED_CONDITION_HPP_ diff --git a/nav2_tasks/include/nav2_tasks/is_localized_condition.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/is_localized_condition.hpp similarity index 92% rename from nav2_tasks/include/nav2_tasks/is_localized_condition.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/is_localized_condition.hpp index 1444ecf594e1f9bcb16e87de32b8fe1d19bff6c2..9e3eb930b86f4d4c9fc71268806a8dc6ea7316b4 100644 --- a/nav2_tasks/include/nav2_tasks/is_localized_condition.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/is_localized_condition.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__IS_LOCALIZED_CONDITION_HPP_ -#define NAV2_TASKS__IS_LOCALIZED_CONDITION_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__IS_LOCALIZED_CONDITION_HPP_ +#define NAV2_BEHAVIOR_TREE__IS_LOCALIZED_CONDITION_HPP_ #include <string> #include <memory> @@ -24,7 +24,7 @@ #include "nav2_robot/robot.hpp" #include "rclcpp/rclcpp.hpp" -namespace nav2_tasks +namespace nav2_behavior_tree { class IsLocalizedCondition : public BT::ConditionNode @@ -109,6 +109,6 @@ private: double rot_tol_; }; -} // namespace nav2_tasks +} // namespace nav2_behavior_tree -#endif // NAV2_TASKS__IS_LOCALIZED_CONDITION_HPP_ +#endif // NAV2_BEHAVIOR_TREE__IS_LOCALIZED_CONDITION_HPP_ diff --git a/nav2_tasks/include/nav2_tasks/is_stuck_condition.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/is_stuck_condition.hpp similarity index 95% rename from nav2_tasks/include/nav2_tasks/is_stuck_condition.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/is_stuck_condition.hpp index 3ffa9bccf568a8e2208466bfa82345365db33201..839b9108060d87285ea7ea37f68973051b459ec0 100644 --- a/nav2_tasks/include/nav2_tasks/is_stuck_condition.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/is_stuck_condition.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__IS_STUCK_CONDITION_HPP_ -#define NAV2_TASKS__IS_STUCK_CONDITION_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__IS_STUCK_CONDITION_HPP_ +#define NAV2_BEHAVIOR_TREE__IS_STUCK_CONDITION_HPP_ #include <string> #include <chrono> @@ -28,7 +28,7 @@ using namespace std::chrono_literals; // NOLINT -namespace nav2_tasks +namespace nav2_behavior_tree { class IsStuckCondition : public BT::ConditionNode @@ -168,6 +168,6 @@ private: double brake_accel_limit_; }; -} // namespace nav2_tasks +} // namespace nav2_behavior_tree -#endif // NAV2_TASKS__IS_STUCK_CONDITION_HPP_ +#endif // NAV2_BEHAVIOR_TREE__IS_STUCK_CONDITION_HPP_ diff --git a/nav2_tasks/include/nav2_tasks/navigate_to_pose_action.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/navigate_to_pose_action.hpp similarity index 85% rename from nav2_tasks/include/nav2_tasks/navigate_to_pose_action.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/navigate_to_pose_action.hpp index 28005063a99da43c264f51b8a89f1491fc9ffd74..1b1d42c7f7fe4b7cdecdaa4d53440583fec87ccd 100644 --- a/nav2_tasks/include/nav2_tasks/navigate_to_pose_action.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/navigate_to_pose_action.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__NAVIGATE_TO_POSE_ACTION_HPP_ -#define NAV2_TASKS__NAVIGATE_TO_POSE_ACTION_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__NAVIGATE_TO_POSE_ACTION_HPP_ +#define NAV2_BEHAVIOR_TREE__NAVIGATE_TO_POSE_ACTION_HPP_ #include <memory> #include <string> @@ -21,10 +21,10 @@ #include "geometry_msgs/msg/point.hpp" #include "geometry_msgs/msg/quaternion.hpp" #include "nav2_msgs/action/navigate_to_pose.hpp" -#include "nav2_tasks/bt_action_node.hpp" -#include "nav2_tasks/bt_conversions.hpp" +#include "nav2_behavior_tree/bt_action_node.hpp" +#include "nav2_behavior_tree/bt_conversions.hpp" -namespace nav2_tasks +namespace nav2_behavior_tree { class NavigateToPoseAction : public BtActionNode<nav2_msgs::action::NavigateToPose> @@ -61,6 +61,6 @@ public: } }; -} // namespace nav2_tasks +} // namespace nav2_behavior_tree -#endif // NAV2_TASKS__NAVIGATE_TO_POSE_ACTION_HPP_ +#endif // NAV2_BEHAVIOR_TREE__NAVIGATE_TO_POSE_ACTION_HPP_ diff --git a/nav2_tasks/include/nav2_tasks/rate_controller_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/rate_controller_node.hpp similarity index 92% rename from nav2_tasks/include/nav2_tasks/rate_controller_node.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/rate_controller_node.hpp index 2782cef6b7688e030652b6b27043f8f842827cb9..48ab6eced2f825a9754289741c6fe21c5c2fc6d9 100644 --- a/nav2_tasks/include/nav2_tasks/rate_controller_node.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/rate_controller_node.hpp @@ -12,15 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__RATE_CONTROLLER_NODE_HPP_ -#define NAV2_TASKS__RATE_CONTROLLER_NODE_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__RATE_CONTROLLER_NODE_HPP_ +#define NAV2_BEHAVIOR_TREE__RATE_CONTROLLER_NODE_HPP_ #include <chrono> #include <string> #include "behaviortree_cpp/decorator_node.h" -namespace nav2_tasks +namespace nav2_behavior_tree { class RateController : public BT::DecoratorNode @@ -93,6 +93,6 @@ inline BT::NodeStatus RateController::tick() return status(); } -} // namespace nav2_tasks +} // namespace nav2_behavior_tree -#endif // NAV2_TASKS__RATE_CONTROLLER_NODE_HPP_ +#endif // NAV2_BEHAVIOR_TREE__RATE_CONTROLLER_NODE_HPP_ diff --git a/nav2_tasks/include/nav2_tasks/spin_action.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/spin_action.hpp similarity index 83% rename from nav2_tasks/include/nav2_tasks/spin_action.hpp rename to nav2_behavior_tree/include/nav2_behavior_tree/spin_action.hpp index f1d27dc31f9e295eb22ecdffba93c7374cb8f4b9..fe3abd98c655c1da361a7d7220a59ec537f030e6 100644 --- a/nav2_tasks/include/nav2_tasks/spin_action.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/spin_action.hpp @@ -12,20 +12,20 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef NAV2_TASKS__SPIN_ACTION_HPP_ -#define NAV2_TASKS__SPIN_ACTION_HPP_ +#ifndef NAV2_BEHAVIOR_TREE__SPIN_ACTION_HPP_ +#define NAV2_BEHAVIOR_TREE__SPIN_ACTION_HPP_ #include <string> #include <memory> #include <cmath> -#include "nav2_tasks/bt_action_node.hpp" +#include "nav2_behavior_tree/bt_action_node.hpp" #include "nav2_msgs/action/spin.hpp" #include "geometry_msgs/msg/quaternion.hpp" #include "tf2/LinearMath/Quaternion.h" #include "tf2_geometry_msgs/tf2_geometry_msgs.h" -namespace nav2_tasks +namespace nav2_behavior_tree { class SpinAction : public BtActionNode<nav2_msgs::action::Spin> @@ -46,6 +46,6 @@ public: } }; -} // namespace nav2_tasks +} // namespace nav2_behavior_tree -#endif // NAV2_TASKS__SPIN_ACTION_HPP_ +#endif // NAV2_BEHAVIOR_TREE__SPIN_ACTION_HPP_ diff --git a/nav2_tasks/package.xml b/nav2_behavior_tree/package.xml similarity index 98% rename from nav2_tasks/package.xml rename to nav2_behavior_tree/package.xml index d256352291b72613daf6424e002a2236909444e9..9bfe404d9994935649f5090027e3a16dc64f7775 100644 --- a/nav2_tasks/package.xml +++ b/nav2_behavior_tree/package.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> <?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> <package format="3"> - <name>nav2_tasks</name> + <name>nav2_behavior_tree</name> <version>0.1.5</version> <description>TODO</description> <maintainer email="michael.jeronimo@intel.com">Michael Jeronimo</maintainer> diff --git a/nav2_tasks/src/behavior_tree_engine.cpp b/nav2_behavior_tree/src/behavior_tree_engine.cpp similarity index 93% rename from nav2_tasks/src/behavior_tree_engine.cpp rename to nav2_behavior_tree/src/behavior_tree_engine.cpp index 44b5aed25f4cd4bac3d2b888f6abc654c6cd1133..b79a4ef8617349cfc265c60a3f1daff983ec96f6 100644 --- a/nav2_tasks/src/behavior_tree_engine.cpp +++ b/nav2_behavior_tree/src/behavior_tree_engine.cpp @@ -12,18 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "nav2_tasks/behavior_tree_engine.hpp" +#include "nav2_behavior_tree/behavior_tree_engine.hpp" #include <memory> #include <string> #include "behaviortree_cpp/blackboard/blackboard_local.h" -#include "nav2_tasks/bt_conversions.hpp" +#include "nav2_behavior_tree/bt_conversions.hpp" #include "rclcpp/rclcpp.hpp" using namespace std::chrono_literals; -namespace nav2_tasks +namespace nav2_behavior_tree { BehaviorTreeEngine::BehaviorTreeEngine() @@ -95,4 +95,4 @@ BehaviorTreeEngine::buildTreeFromText(std::string & xml_string, BT::Blackboard:: } -} // namespace nav2_tasks +} // namespace nav2_behavior_tree diff --git a/nav2_bt_navigator/CMakeLists.txt b/nav2_bt_navigator/CMakeLists.txt index 5d4fbbcfc9ce0bee1085e36e455017662d240e82..4b2886ee434772bd85755db5ecb6f53e16bdf403 100644 --- a/nav2_bt_navigator/CMakeLists.txt +++ b/nav2_bt_navigator/CMakeLists.txt @@ -8,7 +8,7 @@ find_package(rclcpp_action REQUIRED) find_package(rclcpp_lifecycle REQUIRED) find_package(std_msgs REQUIRED) find_package(geometry_msgs REQUIRED) -find_package(nav2_tasks REQUIRED) +find_package(nav2_behavior_tree REQUIRED) find_package(nav_msgs REQUIRED) find_package(nav2_msgs REQUIRED) find_package(behaviortree_cpp REQUIRED) @@ -42,7 +42,7 @@ set(dependencies rclcpp_lifecycle std_msgs geometry_msgs - nav2_tasks + nav2_behavior_tree nav_msgs nav2_msgs behaviortree_cpp diff --git a/nav2_bt_navigator/README.md b/nav2_bt_navigator/README.md index 15c0b2b797ca244667deea91a661ba861cb60212..ccb83f6ff805b4a4662bcafcb5ec4c6c352c69d8 100644 --- a/nav2_bt_navigator/README.md +++ b/nav2_bt_navigator/README.md @@ -1,10 +1,10 @@ # BT Navigator -The BT Navigator (Behavior Tree Navigator) module implements the [NavigateToPose task interface](../nav2_tasks/include/nav2_tasks/navigate_to_pose_task.hpp). It is a [Behavior Tree](https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/docs/BT_basics.md)-based implementation of navigation that is intended to allow for flexibility in the navigation task and provide a way to easily specify complex robot behaviors, including [recovery](#recovery). +The BT Navigator (Behavior Tree Navigator) module implements the [NavigateToPose task interface](../nav2_behavior_tree/include/nav2_behavior_tree/navigate_to_pose_task.hpp). It is a [Behavior Tree](https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/docs/BT_basics.md)-based implementation of navigation that is intended to allow for flexibility in the navigation task and provide a way to easily specify complex robot behaviors, including [recovery](#recovery). ## Overview -The BT Navigator receives a goal pose and navigates the robot to the specified destination. To do so, the module reads an XML description of the Behavior Tree from a file, as specified by a Node parameter, and passes that to a generic [BehaviorTreeEngine class](../nav2_tasks/include/nav2_tasks/behavior_tree_engine.hpp) which uses the [Behavior-Tree.CPP library](https://github.com/BehaviorTree/BehaviorTree.CPP) to dynamically create and execute the BT. +The BT Navigator receives a goal pose and navigates the robot to the specified destination. To do so, the module reads an XML description of the Behavior Tree from a file, as specified by a Node parameter, and passes that to a generic [BehaviorTreeEngine class](../nav2_behavior_tree/include/nav2_behavior_tree/behavior_tree_engine.hpp) which uses the [Behavior-Tree.CPP library](https://github.com/BehaviorTree/BehaviorTree.CPP) to dynamically create and execute the BT. ## Specifying an input XML file diff --git a/nav2_bt_navigator/include/nav2_bt_navigator/navigate_to_pose_behavior_tree.hpp b/nav2_bt_navigator/include/nav2_bt_navigator/navigate_to_pose_behavior_tree.hpp index afebeba2cc1e47815614f2289fed5c02639b56af..5df00eaf3cb149a5900aff8633f6e31ee9c91bde 100644 --- a/nav2_bt_navigator/include/nav2_bt_navigator/navigate_to_pose_behavior_tree.hpp +++ b/nav2_bt_navigator/include/nav2_bt_navigator/navigate_to_pose_behavior_tree.hpp @@ -19,15 +19,15 @@ #include "nav2_util/lifecycle_node.hpp" #include "nav2_msgs/srv/clear_entire_costmap.hpp" -#include "nav2_tasks/behavior_tree_engine.hpp" -#include "nav2_tasks/clear_entirely_costmap_service_client.hpp" +#include "nav2_behavior_tree/behavior_tree_engine.hpp" +#include "nav2_behavior_tree/clear_entirely_costmap_service_client.hpp" #include "nav2_util/global_localization_service_client.hpp" #include "rclcpp/rclcpp.hpp" namespace nav2_bt_navigator { -class NavigateToPoseBehaviorTree : public nav2_tasks::BehaviorTreeEngine +class NavigateToPoseBehaviorTree : public nav2_behavior_tree::BehaviorTreeEngine { public: NavigateToPoseBehaviorTree(); diff --git a/nav2_bt_navigator/package.xml b/nav2_bt_navigator/package.xml index 31a1d3a1155b6ea5f1f8239d2c226f870f033c76..8008d360388b9eec85cd7fe2126f7e422c0bf1e9 100644 --- a/nav2_bt_navigator/package.xml +++ b/nav2_bt_navigator/package.xml @@ -12,7 +12,7 @@ <build_depend>rclcpp</build_depend> <build_depend>rclcpp_action</build_depend> <build_depend>rclcpp_lifecycle</build_depend> - <build_depend>nav2_tasks</build_depend> + <build_depend>nav2_behavior_tree</build_depend> <build_depend>nav_msgs</build_depend> <build_depend>nav2_msgs</build_depend> <build_depend>behaviortree_cpp</build_depend> @@ -26,7 +26,7 @@ <exec_depend>rclcpp</exec_depend> <exec_depend>rclcpp_action</exec_depend> <exec_depend>rclcpp_lifecycle</exec_depend> - <exec_depend>nav2_tasks</exec_depend> + <exec_depend>nav2_behavior_tree</exec_depend> <exec_depend>nav_msgs</exec_depend> <exec_depend>nav2_msgs</exec_depend> <exec_depend>std_msgs</exec_depend> diff --git a/nav2_bt_navigator/src/bt_navigator.cpp b/nav2_bt_navigator/src/bt_navigator.cpp index 8f627f6a7edb5cbfa5822602aba290d698a5d3f6..3ec7a9504a03673b0155f370f133c59e569bf152 100644 --- a/nav2_bt_navigator/src/bt_navigator.cpp +++ b/nav2_bt_navigator/src/bt_navigator.cpp @@ -20,7 +20,7 @@ #include <string> #include <utility> -#include "nav2_tasks/bt_conversions.hpp" +#include "nav2_behavior_tree/bt_conversions.hpp" namespace nav2_bt_navigator { @@ -179,20 +179,20 @@ BtNavigator::navigateToPose() }; // Execute the BT that was previously created in the configure step - nav2_tasks::BtStatus rc = bt_->run(tree_, on_loop, is_canceling); + nav2_behavior_tree::BtStatus rc = bt_->run(tree_, on_loop, is_canceling); switch (rc) { - case nav2_tasks::BtStatus::SUCCEEDED: + case nav2_behavior_tree::BtStatus::SUCCEEDED: RCLCPP_INFO(get_logger(), "Navigation succeeded"); action_server_->succeeded_current(); break; - case nav2_tasks::BtStatus::FAILED: + case nav2_behavior_tree::BtStatus::FAILED: RCLCPP_ERROR(get_logger(), "Navigation failed"); action_server_->abort_all(); break; - case nav2_tasks::BtStatus::CANCELED: + case nav2_behavior_tree::BtStatus::CANCELED: RCLCPP_INFO(get_logger(), "Navigation canceled"); action_server_->cancel_all(); // Reset the BT so that it can be run again in the future diff --git a/nav2_bt_navigator/src/navigate_to_pose_behavior_tree.cpp b/nav2_bt_navigator/src/navigate_to_pose_behavior_tree.cpp index 5fd5bc9bedc523b257f4d9219b3339bb8cd1f4c1..3309f8684e212d789876ef56257114cc0f0e4ddd 100644 --- a/nav2_bt_navigator/src/navigate_to_pose_behavior_tree.cpp +++ b/nav2_bt_navigator/src/navigate_to_pose_behavior_tree.cpp @@ -13,19 +13,19 @@ // limitations under the License. #include "nav2_bt_navigator/navigate_to_pose_behavior_tree.hpp" -#include "nav2_bt_navigator/recovery_node.hpp" #include <memory> #include <string> -#include "nav2_tasks/back_up_action.hpp" -#include "nav2_tasks/compute_path_to_pose_action.hpp" -#include "nav2_tasks/follow_path_action.hpp" -#include "nav2_tasks/goal_reached_condition.hpp" -#include "nav2_tasks/is_localized_condition.hpp" -#include "nav2_tasks/is_stuck_condition.hpp" -#include "nav2_tasks/rate_controller_node.hpp" -#include "nav2_tasks/spin_action.hpp" +#include "nav2_bt_navigator/recovery_node.hpp" +#include "nav2_behavior_tree/back_up_action.hpp" +#include "nav2_behavior_tree/compute_path_to_pose_action.hpp" +#include "nav2_behavior_tree/follow_path_action.hpp" +#include "nav2_behavior_tree/goal_reached_condition.hpp" +#include "nav2_behavior_tree/is_localized_condition.hpp" +#include "nav2_behavior_tree/is_stuck_condition.hpp" +#include "nav2_behavior_tree/rate_controller_node.hpp" +#include "nav2_behavior_tree/spin_action.hpp" #include "rclcpp/rclcpp.hpp" using namespace std::chrono_literals; @@ -36,22 +36,22 @@ namespace nav2_bt_navigator NavigateToPoseBehaviorTree::NavigateToPoseBehaviorTree() { // Register our custom action nodes so that they can be included in XML description - factory_.registerNodeType<nav2_tasks::ComputePathToPoseAction>("ComputePathToPose"); - factory_.registerNodeType<nav2_tasks::FollowPathAction>("FollowPath"); - factory_.registerNodeType<nav2_tasks::BackUpAction>("BackUp"); - factory_.registerNodeType<nav2_tasks::SpinAction>("Spin"); + factory_.registerNodeType<nav2_behavior_tree::ComputePathToPoseAction>("ComputePathToPose"); + factory_.registerNodeType<nav2_behavior_tree::FollowPathAction>("FollowPath"); + factory_.registerNodeType<nav2_behavior_tree::BackUpAction>("BackUp"); + factory_.registerNodeType<nav2_behavior_tree::SpinAction>("Spin"); // Register our custom condition nodes - factory_.registerNodeType<nav2_tasks::IsStuckCondition>("IsStuck"); - factory_.registerNodeType<nav2_tasks::IsLocalizedCondition>("IsLocalized"); - factory_.registerNodeType<nav2_tasks::GoalReachedCondition>("GoalReached"); + factory_.registerNodeType<nav2_behavior_tree::IsStuckCondition>("IsStuck"); + factory_.registerNodeType<nav2_behavior_tree::IsLocalizedCondition>("IsLocalized"); + factory_.registerNodeType<nav2_behavior_tree::GoalReachedCondition>("GoalReached"); // Register our simple condition nodes factory_.registerSimpleCondition("initialPoseReceived", std::bind(&NavigateToPoseBehaviorTree::initialPoseReceived, this, std::placeholders::_1)); // Register our custom decorator nodes - factory_.registerNodeType<nav2_tasks::RateController>("RateController"); + factory_.registerNodeType<nav2_behavior_tree::RateController>("RateController"); // Register our custom control nodes factory_.registerNodeType<nav2_bt_navigator::RecoveryNode>("RecoveryNode"); @@ -91,7 +91,7 @@ BT::NodeStatus NavigateToPoseBehaviorTree::clearEntirelyCostmapServiceRequest( std::string service_name = "/local_costmap/clear_entirely_local_costmap"; tree_node.getParam<std::string>("service_name", service_name); - nav2_tasks::ClearEntirelyCostmapServiceClient clear_entirely_costmap(service_name); + nav2_behavior_tree::ClearEntirelyCostmapServiceClient clear_entirely_costmap(service_name); auto request = std::make_shared<nav2_msgs::srv::ClearEntireCostmap::Request>(); try { clear_entirely_costmap.wait_for_service(std::chrono::seconds(3)); diff --git a/nav2_costmap_2d/plugins/static_layer.cpp b/nav2_costmap_2d/plugins/static_layer.cpp index eda58f4732d2a0662c40eddf675542aa618520d1..7ce4bd2893a5a8c4f5dcaaaa49e58df84f0635cf 100644 --- a/nav2_costmap_2d/plugins/static_layer.cpp +++ b/nav2_costmap_2d/plugins/static_layer.cpp @@ -178,7 +178,7 @@ StaticLayer::processMap(const nav_msgs::msg::OccupancyGrid & new_map) new_map.info.origin.position.x, new_map.info.origin.position.y, true); - } else if (size_x_ != size_x || size_y_ != size_y || + } else if (size_x_ != size_x || size_y_ != size_y || // NOLINT resolution_ != new_map.info.resolution || origin_x_ != new_map.info.origin.position.x || origin_y_ != new_map.info.origin.position.y) diff --git a/nav2_costmap_2d/test/integration/footprint_tests.cpp b/nav2_costmap_2d/test/integration/footprint_tests.cpp index f2aa7c748bfb800f4195508edfd6155d1fcf72be..8f668e9b5c8ffbec757ea087a7caf8618ffb6169 100644 --- a/nav2_costmap_2d/test/integration/footprint_tests.cpp +++ b/nav2_costmap_2d/test/integration/footprint_tests.cpp @@ -34,6 +34,7 @@ * * Author: Dave Hershberger *********************************************************************/ +#include <memory> #include <string> #include <vector> diff --git a/nav2_costmap_2d/test/integration/inflation_tests.cpp b/nav2_costmap_2d/test/integration/inflation_tests.cpp index 1338f9b1e0e09e8f92b84115b3f5172c4c8cfadb..cc7091913f234a2f51981a0ec3a890bdddf98328 100644 --- a/nav2_costmap_2d/test/integration/inflation_tests.cpp +++ b/nav2_costmap_2d/test/integration/inflation_tests.cpp @@ -33,9 +33,10 @@ */ #include <gtest/gtest.h> -#include <map> #include <cmath> +#include <map> #include <memory> +#include <string> #include <vector> #include "nav2_costmap_2d/costmap_2d.hpp" diff --git a/nav2_dwb_controller/README.md b/nav2_dwb_controller/README.md index ae1ae64b2db03379d08810f52d67acbc1e560510..bf4f03dd4e2dd88a52417d992ab70bbbacc92595 100644 --- a/nav2_dwb_controller/README.md +++ b/nav2_dwb_controller/README.md @@ -66,7 +66,7 @@ TaskStatus execute(path) std::this_thread::sleep_for(10ms); } - nav2_tasks::FollowPathResult result; + nav2_behavior_tree::FollowPathResult result; setResult(result); return TaskStatus::SUCCEEDED; diff --git a/nav2_lifecycle_manager/include/nav2_lifecycle_manager/lifecycle_manager.hpp b/nav2_lifecycle_manager/include/nav2_lifecycle_manager/lifecycle_manager.hpp index cf39a48a18999533da6c6d5025a771001f53d6ed..a4b61583c88cb2252a2843002eaf7a29da0c5f9f 100644 --- a/nav2_lifecycle_manager/include/nav2_lifecycle_manager/lifecycle_manager.hpp +++ b/nav2_lifecycle_manager/include/nav2_lifecycle_manager/lifecycle_manager.hpp @@ -18,6 +18,7 @@ #include <map> #include <memory> #include <string> +#include <unordered_map> #include <vector> #include "nav2_util/lifecycle_service_client.hpp" diff --git a/nav2_motion_primitives/CMakeLists.txt b/nav2_motion_primitives/CMakeLists.txt index dc1bd3f626cff92d1dd33fa8b04532b69f9156f3..f8c7755270ab17c1832209c5df084aec1b5844b4 100644 --- a/nav2_motion_primitives/CMakeLists.txt +++ b/nav2_motion_primitives/CMakeLists.txt @@ -7,7 +7,7 @@ find_package(rclcpp REQUIRED) find_package(rclcpp_action REQUIRED) find_package(rclcpp_lifecycle REQUIRED) find_package(std_msgs REQUIRED) -find_package(nav2_tasks REQUIRED) +find_package(nav2_behavior_tree REQUIRED) find_package(nav2_util REQUIRED) find_package(nav2_msgs REQUIRED) find_package(nav2_robot REQUIRED) @@ -31,7 +31,7 @@ set(dependencies rclcpp_lifecycle std_msgs nav2_util - nav2_tasks + nav2_behavior_tree nav2_msgs nav2_robot nav_msgs diff --git a/nav2_motion_primitives/README.md b/nav2_motion_primitives/README.md index ee0e4402c22b26df8090d25df4a6ff3f93b1bcef..c78f7f412dc1bf782f6b0b8531904b3fe97f8e1e 100644 --- a/nav2_motion_primitives/README.md +++ b/nav2_motion_primitives/README.md @@ -21,7 +21,7 @@ Currently the package provides the following primitives: ## Implementation -The module is implemented as a single node containing multiple primitives and follows the `nav2` [task hierarchy](../nav2_tasks/README.md#Overview). Each primitive is defined as a `nav2_task` with corresponding *command* and *result* message definitions. +The module is implemented as a single node containing multiple primitives and follows the `nav2` [task hierarchy](../nav2_behavior_tree/README.md#Overview). Each primitive is defined as a `nav2_task` with corresponding *command* and *result* message definitions. The `MotionPrimitive` base class manages the task server, provides a robot interface and calls the primitive's update functions. @@ -31,10 +31,10 @@ To gain insight into the package lets go over how to implement and execute a new In this section we'll go over how to define a new primitive and implement the corresponding motion. -The first step is to provide the [task definition](../nav2_tasks/README.md) inside the `nav2_tasks` package. For example, lets define a `SomePrimitive` task interface, i.e. the types of messages to use for the command and result, as well as the client and server. +The first step is to provide the [task definition](../nav2_behavior_tree/README.md) inside the `nav2_behavior_tree` package. For example, lets define a `SomePrimitive` task interface, i.e. the types of messages to use for the command and result, as well as the client and server. ```cpp -namespace nav2_tasks +namespace nav2_behavior_tree { using SomePrimitiveCommand = geometry_msgs::msg::Point; @@ -49,7 +49,7 @@ inline const char * getTaskName<SomePrimitiveCommand, SomePrimitiveResult>() return "SomePrimitiveTask"; } -} // namespace nav2_tasks +} // namespace nav2_behavior_tree ``` For this example we arbitrarily pick `geometry_msgs::msg::Point` and `std_msgs::msg::Empty` as message types for command and result. @@ -57,13 +57,13 @@ For this example we arbitrarily pick `geometry_msgs::msg::Point` and `std_msgs:: Next we define the class for our new primitive. This class should derive from `MotionPrimitive` and use the command and result messages defined on the corresponding task. ```cpp -class SomePrimitive : public MotionPrimitive<nav2_tasks::SomePrimitiveCommand, nav2_tasks::SomePrimitiveResult> +class SomePrimitive : public MotionPrimitive<nav2_behavior_tree::SomePrimitiveCommand, nav2_behavior_tree::SomePrimitiveResult> ``` On the implementation of `SomePrimitive` all we do is override `onRun` and `onCycleUpdate`. ```cpp -using nav2_tasks +using nav2_behavior_tree TaskStatus SomePrimitive::onRun(const SomePrimitiveCommand::SharedPtr command) { @@ -80,20 +80,20 @@ The `onRun` method is the entry point for the primitive and here we should: - Catch the command. - Perform checks before the main execution loop. - Possibly do some initialization. -- Return a `nav2_tasks::TaskStatus` given the initial checks. +- Return a `nav2_behavior_tree::TaskStatus` given the initial checks. The `onCycleUpdate` method is called periodically until it returns `FAILED` or `SUCCEEDED`, here we should: - Set the robot in motion. - Perform some unit of work. - Check if the robot state, determine if work completed -- Return a `nav2_tasks::TaskStatus`. +- Return a `nav2_behavior_tree::TaskStatus`. ### Defining the primitive's client -Primitives use the `nav2_tasks` interface, so we need to define the task client: +Primitives use the `nav2_behavior_tree` interface, so we need to define the task client: ```cpp -nav2_tasks::TaskClient<SomePrimitiveCommand, SomePrimitiveResult> some_primitive_task_client; +nav2_behavior_tree::TaskClient<SomePrimitiveCommand, SomePrimitiveResult> some_primitive_task_client; ``` To send requests we create the command and sent it over the client: @@ -106,7 +106,7 @@ some_primitive_task_client.sendCommand(command) ### (optional) Define the Behavior Tree action node -For using motion primitivies within a behavior tree such as [bt_navigator](../nav2_bt_navigator/README.md##Navigation-Behavior-Trees), then a corresponding *action node* needs to be defined. Checkout `nav2_tasks` for examples on how to implement one. +For using motion primitivies within a behavior tree such as [bt_navigator](../nav2_bt_navigator/README.md##Navigation-Behavior-Trees), then a corresponding *action node* needs to be defined. Checkout `nav2_behavior_tree` for examples on how to implement one. ## Plans diff --git a/nav2_motion_primitives/package.xml b/nav2_motion_primitives/package.xml index ac97562749644f811bfc021ba20db1faaacc96ac..0dafc24a85f6e4fc18db220a6e9098d7a52903ac 100644 --- a/nav2_motion_primitives/package.xml +++ b/nav2_motion_primitives/package.xml @@ -13,7 +13,7 @@ <build_depend>rclcpp</build_depend> <build_depend>rclcpp_action</build_depend> <build_depend>rclcpp_lifecycle</build_depend> - <build_depend>nav2_tasks</build_depend> + <build_depend>nav2_behavior_tree</build_depend> <build_depend>nav2_util</build_depend> <build_depend>nav2_msgs</build_depend> <build_depend>nav_msgs</build_depend> @@ -25,7 +25,7 @@ <exec_depend>rclcpp</exec_depend> <exec_depend>rclcpp_action</exec_depend> <exec_depend>rclcpp_lifecycle</exec_depend> - <exec_depend>nav2_tasks</exec_depend> + <exec_depend>nav2_behavior_tree</exec_depend> <exec_depend>nav2_util</exec_depend> <exec_depend>nav2_msgs</exec_depend> <exec_depend>nav_msgs</exec_depend> diff --git a/nav2_navfn_planner/README.md b/nav2_navfn_planner/README.md index 9a7a3968460198de82c11674c836abf53f99f41b..150a13b0ef534f9cd8b30dc8e163414aa7607b99 100644 --- a/nav2_navfn_planner/README.md +++ b/nav2_navfn_planner/README.md @@ -1,8 +1,8 @@ # Navfn Planner -The NavfnPlanner is a [planning module](../doc/requirements/requirements.md) that implements the `nav2_tasks::ComputePathToPose` interface. +The NavfnPlanner is a [planning module](../doc/requirements/requirements.md) that implements the `nav2_behavior_tree::ComputePathToPose` interface. -A planning module implementing the `nav2_tasks::ComputePathToPose` interface is responsible for generating a feasible path given start and end robot poses. It provides the equivalent functionality to a [GlobalPlanner](http://wiki.ros.org/nav_core#BaseGlobalPlanner) in ROS1 [MoveBase](http://wiki.ros.org/move_base). +A planning module implementing the `nav2_behavior_tree::ComputePathToPose` interface is responsible for generating a feasible path given start and end robot poses. It provides the equivalent functionality to a [GlobalPlanner](http://wiki.ros.org/nav_core#BaseGlobalPlanner) in ROS1 [MoveBase](http://wiki.ros.org/move_base). ## Status Currently, NavfnPlanner's core algorithm is a direct port from the ROS1 MoveBase [Navfn](http://wiki.ros.org/navfn) planner. The Navfn planning algorithm is based on the [Global Dynamic Window Approach](https://cs.stanford.edu/group/manips/publications/pdfs/Brock_1999_ICRA.pdf). @@ -18,7 +18,7 @@ The Navfn planner assumes a circular robot and operates on a costmap. The [Navigation System]((../doc/requirements/requirements.md)) is composed of three tasks: NavigateToPose, ComputePathToPose and FollowPathToPose. -The DijkstraPlanner implements the Task Server interface for ComputePathToPose, specifically derives from `nav2_tasks::ComputePathToPoseTaskServer`. The client to DijkstraPlanner is 'NavigateToPoseTask', which periodically sends requests to the path planner. +The DijkstraPlanner implements the Task Server interface for ComputePathToPose, specifically derives from `nav2_behavior_tree::ComputePathToPoseTaskServer`. The client to DijkstraPlanner is 'NavigateToPoseTask', which periodically sends requests to the path planner.  diff --git a/nav2_system_tests/src/dummy_controller/CMakeLists.txt b/nav2_system_tests/src/dummy_controller/CMakeLists.txt index c7b88c06ddb09e1720d8f4691fc33762134bd0bf..c552f861c9daed8639d1b41c03eb29725c268421 100644 --- a/nav2_system_tests/src/dummy_controller/CMakeLists.txt +++ b/nav2_system_tests/src/dummy_controller/CMakeLists.txt @@ -7,7 +7,7 @@ ament_target_dependencies(dummy_controller_node rclcpp std_msgs nav2_util - nav2_tasks + nav2_behavior_tree nav2_msgs nav_msgs ) \ No newline at end of file diff --git a/nav2_system_tests/src/dummy_controller/dummy_controller.cpp b/nav2_system_tests/src/dummy_controller/dummy_controller.cpp index e635820a5e609c2021966a51ba2cd341385f3696..b5ffc9359e7d6cdb9dfbf4f015809f3ef71046d0 100644 --- a/nav2_system_tests/src/dummy_controller/dummy_controller.cpp +++ b/nav2_system_tests/src/dummy_controller/dummy_controller.cpp @@ -34,7 +34,7 @@ DummyController::DummyController() vel_pub_ = this->create_publisher<geometry_msgs::msg::Twist>("cmd_vel", 1); - task_server_ = std::make_unique<nav2_tasks::FollowPathTaskServer>(temp_node, false), + task_server_ = std::make_unique<nav2_behavior_tree::FollowPathTaskServer>(temp_node, false), task_server_->setExecuteCallback( std::bind(&DummyController::followPath, this, std::placeholders::_1)); @@ -50,7 +50,7 @@ DummyController::~DummyController() } void -DummyController::followPath(const nav2_tasks::FollowPathCommand::SharedPtr /*command*/) +DummyController::followPath(const nav2_behavior_tree::FollowPathCommand::SharedPtr /*command*/) { RCLCPP_INFO(get_logger(), "Starting controller "); @@ -87,7 +87,7 @@ DummyController::followPath(const nav2_tasks::FollowPathCommand::SharedPtr /*com } } - nav2_tasks::FollowPathResult result; + nav2_behavior_tree::FollowPathResult result; task_server_->setResult(result); } diff --git a/nav2_system_tests/src/dummy_controller/dummy_controller.hpp b/nav2_system_tests/src/dummy_controller/dummy_controller.hpp index 111643c06a81946c36af4a033299cca42216cc44..70dd67e9b9fa6b37d250f466cc213cd2822f3808 100644 --- a/nav2_system_tests/src/dummy_controller/dummy_controller.hpp +++ b/nav2_system_tests/src/dummy_controller/dummy_controller.hpp @@ -17,7 +17,7 @@ #include <memory> -#include "nav2_tasks/follow_path_task.hpp" +#include "nav2_behavior_tree/follow_path_task.hpp" #include "geometry_msgs/msg/twist.hpp" namespace nav2_system_tests @@ -29,13 +29,13 @@ public: DummyController(); ~DummyController(); - nav2_tasks::TaskStatus followPath( - const nav2_tasks::FollowPathCommand::SharedPtr command); + nav2_behavior_tree::TaskStatus followPath( + const nav2_behavior_tree::FollowPathCommand::SharedPtr command); private: void setZeroVelocity(); - std::unique_ptr<nav2_tasks::FollowPathTaskServer> task_server_; + std::unique_ptr<nav2_behavior_tree::FollowPathTaskServer> task_server_; std::shared_ptr<rclcpp::Publisher<geometry_msgs::msg::Twist>> vel_pub_; }; diff --git a/nav2_system_tests/src/dummy_planner/CMakeLists.txt b/nav2_system_tests/src/dummy_planner/CMakeLists.txt index 9e6ea94368a38b9aa97e14c4717b5ef76ffe12ba..b1b4c66a761101ad54645db03f23d3aa0db9083b 100644 --- a/nav2_system_tests/src/dummy_planner/CMakeLists.txt +++ b/nav2_system_tests/src/dummy_planner/CMakeLists.txt @@ -7,7 +7,7 @@ ament_target_dependencies(dummy_planner_node rclcpp std_msgs nav2_util - nav2_tasks + nav2_behavior_tree nav2_msgs nav_msgs ) \ No newline at end of file diff --git a/nav2_system_tests/src/dummy_planner/dummy_planner.cpp b/nav2_system_tests/src/dummy_planner/dummy_planner.cpp index f968b8b81e352fc1b48bd3e423eb60e87d9453f8..9f4f3d57962c1886b8b20b55ee05612864a52cf5 100644 --- a/nav2_system_tests/src/dummy_planner/dummy_planner.cpp +++ b/nav2_system_tests/src/dummy_planner/dummy_planner.cpp @@ -30,7 +30,8 @@ DummyPlanner::DummyPlanner() auto temp_node = std::shared_ptr<rclcpp::Node>(this, [](auto) {}); - task_server_ = std::make_unique<nav2_tasks::ComputePathToPoseTaskServer>(temp_node, false), + task_server_ = + std::make_unique<nav2_behavior_tree::ComputePathToPoseTaskServer>(temp_node, false), task_server_->setExecuteCallback( std::bind(&DummyPlanner::computePathToPose, this, std::placeholders::_1)); @@ -46,11 +47,11 @@ DummyPlanner::~DummyPlanner() } void -DummyPlanner::computePathToPose(const nav2_tasks::ComputePathToPoseCommand::SharedPtr command) +DummyPlanner::computePathToPose(const nav2_behavior_tree::ComputePathToPoseCommand::SharedPtr cmd) { RCLCPP_INFO(get_logger(), "Attempting to a find path from (%.2f, %.2f) to " - "(%.2f, %.2f).", command->start.position.x, command->start.position.y, - command->goal.position.x, command->goal.position.y); + "(%.2f, %.2f).", cmd->start.position.x, cmd->start.position.y, + cmd->goal.position.x, cmd->goal.position.y); // Dummy path computation time std::this_thread::sleep_for(500ms); @@ -63,7 +64,7 @@ DummyPlanner::computePathToPose(const nav2_tasks::ComputePathToPoseCommand::Shar RCLCPP_INFO(get_logger(), "Found a dummy path"); - nav2_tasks::ComputePathToPoseResult result; + nav2_behavior_tree::ComputePathToPoseResult result; // set succeeded task_server_->setResult(result); } diff --git a/nav2_system_tests/src/dummy_planner/dummy_planner.hpp b/nav2_system_tests/src/dummy_planner/dummy_planner.hpp index 6d6668a1fed204017563a634eb92b634a795fe83..35b1f25731824d131e74f7988b93480223120415 100644 --- a/nav2_system_tests/src/dummy_planner/dummy_planner.hpp +++ b/nav2_system_tests/src/dummy_planner/dummy_planner.hpp @@ -17,7 +17,7 @@ #include <memory> -#include "nav2_tasks/compute_path_to_pose_task.hpp" +#include "nav2_behavior_tree/compute_path_to_pose_task.hpp" namespace nav2_system_tests { @@ -28,11 +28,11 @@ public: DummyPlanner(); ~DummyPlanner(); - nav2_tasks::TaskStatus computePathToPose( - const nav2_tasks::ComputePathToPoseCommand::SharedPtr command); + nav2_behavior_tree::TaskStatus computePathToPose( + const nav2_behavior_tree::ComputePathToPoseCommand::SharedPtr command); private: - std::unique_ptr<nav2_tasks::ComputePathToPoseTaskServer> task_server_; + std::unique_ptr<nav2_behavior_tree::ComputePathToPoseTaskServer> task_server_; }; } // namespace nav2_system_tests diff --git a/nav2_system_tests/src/planning/README.md b/nav2_system_tests/src/planning/README.md index 53db8a1d00caa065d2b2da5c9f237273bef374eb..4b76cc6c7392ad7888adc6350056b4c4c4bd8342 100644 --- a/nav2_system_tests/src/planning/README.md +++ b/nav2_system_tests/src/planning/README.md @@ -1,6 +1,6 @@ # Global Planner Component Testing -Component level tests are available that exercise the Planning Module Task Server API ``` nav2_tasks::ComputePathToPoseTaskServer```. The intention is to develop standard tests that can be used across all planners. +Component level tests are available that exercise the Planning Module Task Server API ``` nav2_behavior_tree::ComputePathToPoseTaskServer```. The intention is to develop standard tests that can be used across all planners. A PlannerTester node provides the world representation in the form of a costmap, sends a request to generate a path, and receives and checks the quality of the generated path. diff --git a/nav2_system_tests/src/planning/planner_tester.cpp b/nav2_system_tests/src/planning/planner_tester.cpp index 386e0b23420181cd1eccac34818b5e7ebf2c1803..8f7befc7dee92c69adc871a033b288353e8acf50 100644 --- a/nav2_system_tests/src/planning/planner_tester.cpp +++ b/nav2_system_tests/src/planning/planner_tester.cpp @@ -39,9 +39,9 @@ PlannerTester::PlannerTester() { // The client used to invoke the services of the global planner (ComputePathToPose) auto temp_node = std::shared_ptr<rclcpp::Node>(this, [](rclcpp::Node *) {}); - planner_client_ = std::make_unique<nav2_tasks::ComputePathToPoseTaskClient>(temp_node); + planner_client_ = std::make_unique<nav2_behavior_tree::ComputePathToPoseTaskClient>(temp_node); - if (!planner_client_->waitForServer(nav2_tasks::defaultServerTimeout)) { + if (!planner_client_->waitForServer(nav2_behavior_tree::defaultServerTimeout)) { RCLCPP_ERROR(this->get_logger(), "Planner not running"); throw std::runtime_error("Planner not running"); } @@ -188,7 +188,7 @@ void PlannerTester::startCostmapServer(std::string serviceName) } bool PlannerTester::defaultPlannerTest( - nav2_tasks::ComputePathToPoseResult::SharedPtr & path, + nav2_behavior_tree::ComputePathToPoseResult::SharedPtr & path, const double /*deviation_tolerance*/) { if (!costmap_set_) { @@ -198,7 +198,7 @@ bool PlannerTester::defaultPlannerTest( // TODO(orduno) #443 Add support for planners that take into account robot orientation geometry_msgs::msg::Point robot_position; - auto goal = std::make_shared<nav2_tasks::ComputePathToPoseCommand>(); + auto goal = std::make_shared<nav2_behavior_tree::ComputePathToPoseCommand>(); auto costmap_properties = costmap_->get_properties(); if (using_fake_costmap_) { @@ -262,8 +262,8 @@ bool PlannerTester::defaultPlannerRandomTests( // TODO(orduno) #443 Add support for planners that take into account robot orientation geometry_msgs::msg::Point robot_position; - auto goal = std::make_shared<nav2_tasks::ComputePathToPoseCommand>(); - auto path = std::make_shared<nav2_tasks::ComputePathToPoseResult>(); + auto goal = std::make_shared<nav2_behavior_tree::ComputePathToPoseCommand>(); + auto path = std::make_shared<nav2_behavior_tree::ComputePathToPoseResult>(); unsigned int num_fail = 0; for (unsigned int test_num = 0; test_num < number_tests; ++test_num) { @@ -300,8 +300,8 @@ bool PlannerTester::defaultPlannerRandomTests( bool PlannerTester::plannerTest( const geometry_msgs::msg::Point & robot_position, - const nav2_tasks::ComputePathToPoseCommand::SharedPtr & goal, - nav2_tasks::ComputePathToPoseResult::SharedPtr & path) + const nav2_behavior_tree::ComputePathToPoseCommand::SharedPtr & goal, + nav2_behavior_tree::ComputePathToPoseResult::SharedPtr & path) { RCLCPP_DEBUG(this->get_logger(), "Getting the path from the planner"); @@ -344,8 +344,8 @@ void PlannerTester::publishRobotPosition(const geometry_msgs::msg::Point & posit } TaskStatus PlannerTester::sendRequest( - const nav2_tasks::ComputePathToPoseCommand::SharedPtr & goal, - nav2_tasks::ComputePathToPoseResult::SharedPtr & path) + const nav2_behavior_tree::ComputePathToPoseCommand::SharedPtr & goal, + nav2_behavior_tree::ComputePathToPoseResult::SharedPtr & path) { planner_client_->sendCommand(goal); @@ -359,7 +359,7 @@ TaskStatus PlannerTester::sendRequest( } } -bool PlannerTester::isCollisionFree(const nav2_tasks::ComputePathToPoseResult & path) +bool PlannerTester::isCollisionFree(const nav2_behavior_tree::ComputePathToPoseResult & path) { // At each point of the path, check if the corresponding cell is free @@ -391,19 +391,19 @@ bool PlannerTester::isCollisionFree(const nav2_tasks::ComputePathToPoseResult & bool PlannerTester::isWithinTolerance( const geometry_msgs::msg::Point & robot_position, - const nav2_tasks::ComputePathToPoseCommand & goal, - const nav2_tasks::ComputePathToPoseResult & path) const + const nav2_behavior_tree::ComputePathToPoseCommand & goal, + const nav2_behavior_tree::ComputePathToPoseResult & path) const { return isWithinTolerance( - robot_position, goal, path, 0.0, nav2_tasks::ComputePathToPoseResult()); + robot_position, goal, path, 0.0, nav2_behavior_tree::ComputePathToPoseResult()); } bool PlannerTester::isWithinTolerance( const geometry_msgs::msg::Point & robot_position, - const nav2_tasks::ComputePathToPoseCommand & goal, - const nav2_tasks::ComputePathToPoseResult & path, + const nav2_behavior_tree::ComputePathToPoseCommand & goal, + const nav2_behavior_tree::ComputePathToPoseResult & path, const double /*deviationTolerance*/, - const nav2_tasks::ComputePathToPoseResult & /*reference_path*/) const + const nav2_behavior_tree::ComputePathToPoseResult & /*reference_path*/) const { // TODO(orduno) #443 Work in progress, for now we only check that the path start matches the // robot start location and that the path end matches the goal. @@ -440,7 +440,7 @@ bool PlannerTester::sendCancel() return false; } -void PlannerTester::printPath(const nav2_tasks::ComputePathToPoseResult & path) const +void PlannerTester::printPath(const nav2_behavior_tree::ComputePathToPoseResult & path) const { int index = 0; for (auto pose : path.poses) { diff --git a/nav2_system_tests/src/planning/planner_tester.hpp b/nav2_system_tests/src/planning/planner_tester.hpp index 65467a9faa60052c314df227f0b3641e008b4eb1..75d8cef2ee89db61676df3efbc5c65dcb57e1cd1 100644 --- a/nav2_system_tests/src/planning/planner_tester.hpp +++ b/nav2_system_tests/src/planning/planner_tester.hpp @@ -21,7 +21,7 @@ #include <thread> #include "rclcpp/rclcpp.hpp" -#include "nav2_tasks/compute_path_to_pose_task.hpp" +#include "nav2_behavior_tree/compute_path_to_pose_task.hpp" #include "nav_msgs/msg/occupancy_grid.hpp" #include "nav2_msgs/msg/costmap.hpp" #include "nav2_msgs/srv/get_costmap.hpp" @@ -51,15 +51,15 @@ public: // TODO(orduno): #443 Assuming a robot the size of a costmap cell bool plannerTest( const geometry_msgs::msg::Point & robot_position, - const nav2_tasks::ComputePathToPoseCommand::SharedPtr & goal, - nav2_tasks::ComputePathToPoseResult::SharedPtr & path); + const nav2_behavior_tree::ComputePathToPoseCommand::SharedPtr & goal, + nav2_behavior_tree::ComputePathToPoseResult::SharedPtr & path); // Sends the request to the planner and gets the result. // Uses the default map or preloaded costmaps. // Success criteria is a collision free path and a deviation to a // reference path smaller than a tolerance. bool defaultPlannerTest( - nav2_tasks::ComputePathToPoseResult::SharedPtr & path, + nav2_behavior_tree::ComputePathToPoseResult::SharedPtr & path, const double deviation_tolerance = 1.0); bool defaultPlannerRandomTests( @@ -74,26 +74,26 @@ private: void startCostmapServer(std::string serviceName); - nav2_tasks::TaskStatus sendRequest( - const nav2_tasks::ComputePathToPoseCommand::SharedPtr & goal, - nav2_tasks::ComputePathToPoseResult::SharedPtr & path + nav2_behavior_tree::TaskStatus sendRequest( + const nav2_behavior_tree::ComputePathToPoseCommand::SharedPtr & goal, + nav2_behavior_tree::ComputePathToPoseResult::SharedPtr & path ); - bool isCollisionFree(const nav2_tasks::ComputePathToPoseResult & path); + bool isCollisionFree(const nav2_behavior_tree::ComputePathToPoseResult & path); bool isWithinTolerance( const geometry_msgs::msg::Point & robot_position, - const nav2_tasks::ComputePathToPoseCommand & goal, - const nav2_tasks::ComputePathToPoseResult & path) const; + const nav2_behavior_tree::ComputePathToPoseCommand & goal, + const nav2_behavior_tree::ComputePathToPoseResult & path) const; bool isWithinTolerance( const geometry_msgs::msg::Point & robot_position, - const nav2_tasks::ComputePathToPoseCommand & goal, - const nav2_tasks::ComputePathToPoseResult & path, + const nav2_behavior_tree::ComputePathToPoseCommand & goal, + const nav2_behavior_tree::ComputePathToPoseResult & path, const double deviationTolerance, - const nav2_tasks::ComputePathToPoseResult & reference_path) const; + const nav2_behavior_tree::ComputePathToPoseResult & reference_path) const; - void printPath(const nav2_tasks::ComputePathToPoseResult & path) const; + void printPath(const nav2_behavior_tree::ComputePathToPoseResult & path) const; // The static map std::shared_ptr<nav_msgs::msg::OccupancyGrid> map_; @@ -102,7 +102,7 @@ private: std::unique_ptr<nav2_util::Costmap> costmap_; // The interface to the global planner - std::unique_ptr<nav2_tasks::ComputePathToPoseTaskClient> planner_client_; + std::unique_ptr<nav2_behavior_tree::ComputePathToPoseTaskClient> planner_client_; std::string plannerName_; // Server for providing a costmap diff --git a/nav2_system_tests/src/planning/test_planner_node.cpp b/nav2_system_tests/src/planning/test_planner_node.cpp index 8f746d62d1aa7062acf92b70c339f7edf2c3c56d..5b3fb05ee65a75f5c744d8388619ef14358836d5 100644 --- a/nav2_system_tests/src/planning/test_planner_node.cpp +++ b/nav2_system_tests/src/planning/test_planner_node.cpp @@ -44,7 +44,7 @@ TEST_F(PlannerTester, testSimpleCostmaps) TestCostmap::maze2 }; - auto result = std::make_shared<nav2_tasks::ComputePathToPoseResult>(); + auto result = std::make_shared<nav2_behavior_tree::ComputePathToPoseResult>(); for (auto costmap : costmaps) { loadSimpleCostmap(costmap); @@ -55,13 +55,13 @@ TEST_F(PlannerTester, testSimpleCostmaps) TEST_F(PlannerTester, testWithOneFixedEndpoint) { loadDefaultMap(); - auto result = std::make_shared<nav2_tasks::ComputePathToPoseResult>(); + auto result = std::make_shared<nav2_behavior_tree::ComputePathToPoseResult>(); EXPECT_EQ(true, defaultPlannerTest(result)); } TEST_F(PlannerTester, testWithHundredRandomEndPoints) { loadDefaultMap(); - auto result = std::make_shared<nav2_tasks::ComputePathToPoseResult>(); + auto result = std::make_shared<nav2_behavior_tree::ComputePathToPoseResult>(); EXPECT_EQ(true, defaultPlannerRandomTests(100, 0.1)); } diff --git a/nav2_util/include/nav2_util/get_robot_pose_client.hpp b/nav2_util/include/nav2_util/get_robot_pose_client.hpp index 8e7079e76047c50d775820c4a7a9d9366de85185..969560e4ee455a23582710d492dfe46d5075d318 100644 --- a/nav2_util/include/nav2_util/get_robot_pose_client.hpp +++ b/nav2_util/include/nav2_util/get_robot_pose_client.hpp @@ -15,6 +15,8 @@ #ifndef NAV2_UTIL__GET_ROBOT_POSE_CLIENT_HPP_ #define NAV2_UTIL__GET_ROBOT_POSE_CLIENT_HPP_ +#include <string> + #include "nav2_util/service_client.hpp" #include "nav2_msgs/srv/get_robot_pose.hpp" @@ -40,6 +42,6 @@ public: ServiceClient<nav2_msgs::srv::GetRobotPose>::ResponseType; }; -} // namespace nav2_tasks +} // namespace nav2_util #endif // NAV2_UTIL__GET_ROBOT_POSE_CLIENT_HPP_ diff --git a/navigation2/package.xml b/navigation2/package.xml index e4fe5f2d6f9566b53ba97c377a5f14eac03e0e77..c703cd199beb3b2215afc915ccae20ebdae7453e 100644 --- a/navigation2/package.xml +++ b/navigation2/package.xml @@ -24,7 +24,7 @@ <exec_depend>nav2_navfn_planner</exec_depend> <exec_depend>nav2_robot</exec_depend> <exec_depend>nav2_rviz_plugins</exec_depend> - <exec_depend>nav2_tasks</exec_depend> + <exec_depend>nav2_behavior_tree</exec_depend> <exec_depend>nav2_util</exec_depend> <exec_depend>nav2_voxel_grid</exec_depend> <exec_depend>nav2_world_model</exec_depend> diff --git a/tools/run_test_suite.bash b/tools/run_test_suite.bash index f74846580b961be26dc48d6e4262526fce96c32e..7b4987a2d2b8025300a1db22e633fbaa16ca2adc 100755 --- a/tools/run_test_suite.bash +++ b/tools/run_test_suite.bash @@ -7,7 +7,7 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # gets the direc # Skip flaky tests. Nav2 system tests will be run later. colcon test --packages-skip nav2_system_tests nav2_dynamic_params nav2_motion_primitives \ nav2_bt_navigator nav2_costmap_2d nav2_lifecycle_manager \ - nav2_tasks nav2_robot + nav2_behavior_tree nav2_robot # run the stable tests in nav2_dynamic_params colcon test --packages-select nav2_dynamic_params --ctest-args --exclude-regex "test_dynamic_params_client"