diff --git a/nav2_amcl/include/nav2_amcl/amcl_node.hpp b/nav2_amcl/include/nav2_amcl/amcl_node.hpp index a527a80a52..05ea8cbafc 100644 --- a/nav2_amcl/include/nav2_amcl/amcl_node.hpp +++ b/nav2_amcl/include/nav2_amcl/amcl_node.hpp @@ -60,8 +60,9 @@ class AmclNode : public nav2_util::LifecycleNode public: /* * @brief AMCL constructor + * @param options Additional options to control creation of the node. */ - AmclNode(); + explicit AmclNode(const rclcpp::NodeOptions & options = rclcpp::NodeOptions()); /* * @brief AMCL destructor */ diff --git a/nav2_amcl/src/amcl_node.cpp b/nav2_amcl/src/amcl_node.cpp index 76019d47fd..79e4efa5ab 100644 --- a/nav2_amcl/src/amcl_node.cpp +++ b/nav2_amcl/src/amcl_node.cpp @@ -57,8 +57,8 @@ namespace nav2_amcl { using nav2_util::geometry_utils::orientationAroundZAxis; -AmclNode::AmclNode() -: nav2_util::LifecycleNode("amcl", "", true) +AmclNode::AmclNode(const rclcpp::NodeOptions & options) +: nav2_util::LifecycleNode("amcl", "", true, options) { RCLCPP_INFO(get_logger(), "Creating"); diff --git a/nav2_bt_navigator/include/nav2_bt_navigator/bt_navigator.hpp b/nav2_bt_navigator/include/nav2_bt_navigator/bt_navigator.hpp index e7a61164d6..af5b909269 100644 --- a/nav2_bt_navigator/include/nav2_bt_navigator/bt_navigator.hpp +++ b/nav2_bt_navigator/include/nav2_bt_navigator/bt_navigator.hpp @@ -40,8 +40,9 @@ class BtNavigator : public nav2_util::LifecycleNode public: /** * @brief A constructor for nav2_bt_navigator::BtNavigator class + * @param options Additional options to control creation of the node. */ - BtNavigator(); + explicit BtNavigator(const rclcpp::NodeOptions & options = rclcpp::NodeOptions()); /** * @brief A destructor for nav2_bt_navigator::BtNavigator class */ diff --git a/nav2_bt_navigator/src/bt_navigator.cpp b/nav2_bt_navigator/src/bt_navigator.cpp index b940c7c364..b35e48a71a 100644 --- a/nav2_bt_navigator/src/bt_navigator.cpp +++ b/nav2_bt_navigator/src/bt_navigator.cpp @@ -28,8 +28,8 @@ namespace nav2_bt_navigator { -BtNavigator::BtNavigator() -: nav2_util::LifecycleNode("bt_navigator", "", false) +BtNavigator::BtNavigator(const rclcpp::NodeOptions & options) +: nav2_util::LifecycleNode("bt_navigator", "", false, options) { RCLCPP_INFO(get_logger(), "Creating"); diff --git a/nav2_controller/include/nav2_controller/nav2_controller.hpp b/nav2_controller/include/nav2_controller/nav2_controller.hpp index 8114c53c7c..164155f3af 100644 --- a/nav2_controller/include/nav2_controller/nav2_controller.hpp +++ b/nav2_controller/include/nav2_controller/nav2_controller.hpp @@ -52,8 +52,9 @@ class ControllerServer : public nav2_util::LifecycleNode /** * @brief Constructor for nav2_controller::ControllerServer + * @param options Additional options to control creation of the node. */ - ControllerServer(); + explicit ControllerServer(const rclcpp::NodeOptions & options = rclcpp::NodeOptions()); /** * @brief Destructor for nav2_controller::ControllerServer */ diff --git a/nav2_controller/src/nav2_controller.cpp b/nav2_controller/src/nav2_controller.cpp index 9b5727d255..bca6a72bbd 100644 --- a/nav2_controller/src/nav2_controller.cpp +++ b/nav2_controller/src/nav2_controller.cpp @@ -31,8 +31,8 @@ using namespace std::chrono_literals; namespace nav2_controller { -ControllerServer::ControllerServer() -: nav2_util::LifecycleNode("controller_server", ""), +ControllerServer::ControllerServer(const rclcpp::NodeOptions & options) +: nav2_util::LifecycleNode("controller_server", "", false, options), progress_checker_loader_("nav2_core", "nav2_core::ProgressChecker"), default_progress_checker_id_{"progress_checker"}, default_progress_checker_type_{"nav2_controller::SimpleProgressChecker"}, 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 daf6abd40d..e218871c04 100644 --- a/nav2_lifecycle_manager/include/nav2_lifecycle_manager/lifecycle_manager.hpp +++ b/nav2_lifecycle_manager/include/nav2_lifecycle_manager/lifecycle_manager.hpp @@ -45,8 +45,9 @@ class LifecycleManager : public rclcpp::Node public: /** * @brief A constructor for nav2_lifecycle_manager::LifecycleManager + * @param options Additional options to control creation of the node. */ - LifecycleManager(); + explicit LifecycleManager(const rclcpp::NodeOptions & options = rclcpp::NodeOptions()); /** * @brief A destructor for nav2_lifecycle_manager::LifecycleManager */ diff --git a/nav2_lifecycle_manager/src/lifecycle_manager.cpp b/nav2_lifecycle_manager/src/lifecycle_manager.cpp index 2d26f7c144..fee3d7cfcf 100644 --- a/nav2_lifecycle_manager/src/lifecycle_manager.cpp +++ b/nav2_lifecycle_manager/src/lifecycle_manager.cpp @@ -31,8 +31,8 @@ using nav2_util::LifecycleServiceClient; namespace nav2_lifecycle_manager { -LifecycleManager::LifecycleManager() -: Node("lifecycle_manager") +LifecycleManager::LifecycleManager(const rclcpp::NodeOptions & options) +: Node("lifecycle_manager", options) { RCLCPP_INFO(get_logger(), "Creating"); diff --git a/nav2_map_server/include/nav2_map_server/map_saver.hpp b/nav2_map_server/include/nav2_map_server/map_saver.hpp index 9c9b57d292..6863844c7b 100644 --- a/nav2_map_server/include/nav2_map_server/map_saver.hpp +++ b/nav2_map_server/include/nav2_map_server/map_saver.hpp @@ -37,8 +37,9 @@ class MapSaver : public nav2_util::LifecycleNode public: /** * @brief Constructor for the nav2_map_server::MapSaver + * @param options Additional options to control creation of the node. */ - MapSaver(); + explicit MapSaver(const rclcpp::NodeOptions & options = rclcpp::NodeOptions()); /** * @brief Destructor for the nav2_map_server::MapServer diff --git a/nav2_map_server/include/nav2_map_server/map_server.hpp b/nav2_map_server/include/nav2_map_server/map_server.hpp index 700b1753ea..20ab257c4e 100644 --- a/nav2_map_server/include/nav2_map_server/map_server.hpp +++ b/nav2_map_server/include/nav2_map_server/map_server.hpp @@ -38,8 +38,9 @@ class MapServer : public nav2_util::LifecycleNode public: /** * @brief A constructor for nav2_map_server::MapServer + * @param options Additional options to control creation of the node. */ - MapServer(); + explicit MapServer(const rclcpp::NodeOptions & options = rclcpp::NodeOptions()); /** * @brief A Destructor for nav2_map_server::MapServer diff --git a/nav2_map_server/src/map_saver/map_saver.cpp b/nav2_map_server/src/map_saver/map_saver.cpp index 97e7dddc1f..1cc6843183 100644 --- a/nav2_map_server/src/map_saver/map_saver.cpp +++ b/nav2_map_server/src/map_saver/map_saver.cpp @@ -41,8 +41,8 @@ using namespace std::placeholders; namespace nav2_map_server { -MapSaver::MapSaver() -: nav2_util::LifecycleNode("map_saver", "") +MapSaver::MapSaver(const rclcpp::NodeOptions & options) +: nav2_util::LifecycleNode("map_saver", "", false, options) { RCLCPP_INFO(get_logger(), "Creating"); diff --git a/nav2_map_server/src/map_server/map_server.cpp b/nav2_map_server/src/map_server/map_server.cpp index fecd3f6196..fffc1609ac 100644 --- a/nav2_map_server/src/map_server/map_server.cpp +++ b/nav2_map_server/src/map_server/map_server.cpp @@ -62,8 +62,8 @@ using namespace std::placeholders; namespace nav2_map_server { -MapServer::MapServer() -: nav2_util::LifecycleNode("map_server") +MapServer::MapServer(const rclcpp::NodeOptions & options) +: nav2_util::LifecycleNode("map_server", "", false, options) { RCLCPP_INFO(get_logger(), "Creating"); diff --git a/nav2_planner/include/nav2_planner/planner_server.hpp b/nav2_planner/include/nav2_planner/planner_server.hpp index 079c958091..866993afed 100644 --- a/nav2_planner/include/nav2_planner/planner_server.hpp +++ b/nav2_planner/include/nav2_planner/planner_server.hpp @@ -50,8 +50,9 @@ class PlannerServer : public nav2_util::LifecycleNode public: /** * @brief A constructor for nav2_planner::PlannerServer + * @param options Additional options to control creation of the node. */ - PlannerServer(); + explicit PlannerServer(const rclcpp::NodeOptions & options = rclcpp::NodeOptions()); /** * @brief A destructor for nav2_planner::PlannerServer */ diff --git a/nav2_planner/src/planner_server.cpp b/nav2_planner/src/planner_server.cpp index 05a6453faa..15b127741b 100644 --- a/nav2_planner/src/planner_server.cpp +++ b/nav2_planner/src/planner_server.cpp @@ -36,8 +36,8 @@ using namespace std::chrono_literals; namespace nav2_planner { -PlannerServer::PlannerServer() -: nav2_util::LifecycleNode("nav2_planner", ""), +PlannerServer::PlannerServer(const rclcpp::NodeOptions & options) +: nav2_util::LifecycleNode("planner_server", "", false, options), gp_loader_("nav2_core", "nav2_core::GlobalPlanner"), default_ids_{"GridBased"}, default_types_{"nav2_navfn_planner/NavfnPlanner"}, diff --git a/nav2_recoveries/include/nav2_recoveries/recovery_server.hpp b/nav2_recoveries/include/nav2_recoveries/recovery_server.hpp index d6350013a0..fed49e43f3 100644 --- a/nav2_recoveries/include/nav2_recoveries/recovery_server.hpp +++ b/nav2_recoveries/include/nav2_recoveries/recovery_server.hpp @@ -40,8 +40,9 @@ class RecoveryServer : public nav2_util::LifecycleNode public: /** * @brief A constructor for recovery_server::RecoveryServer + * @param options Additional options to control creation of the node. */ - RecoveryServer(); + explicit RecoveryServer(const rclcpp::NodeOptions & options = rclcpp::NodeOptions()); ~RecoveryServer(); /** diff --git a/nav2_recoveries/src/recovery_server.cpp b/nav2_recoveries/src/recovery_server.cpp index c9c992c7d1..e10e136bb5 100644 --- a/nav2_recoveries/src/recovery_server.cpp +++ b/nav2_recoveries/src/recovery_server.cpp @@ -22,8 +22,8 @@ namespace recovery_server { -RecoveryServer::RecoveryServer() -: LifecycleNode("recoveries_server", "", true), +RecoveryServer::RecoveryServer(const rclcpp::NodeOptions & options) +: LifecycleNode("recoveries_server", "", false, options), plugin_loader_("nav2_core", "nav2_core::Recovery"), default_ids_{"spin", "backup", "wait"}, default_types_{"nav2_recoveries/Spin", "nav2_recoveries/BackUp", "nav2_recoveries/Wait"} diff --git a/nav2_waypoint_follower/include/nav2_waypoint_follower/waypoint_follower.hpp b/nav2_waypoint_follower/include/nav2_waypoint_follower/waypoint_follower.hpp index ab1f76baab..bf42b77686 100644 --- a/nav2_waypoint_follower/include/nav2_waypoint_follower/waypoint_follower.hpp +++ b/nav2_waypoint_follower/include/nav2_waypoint_follower/waypoint_follower.hpp @@ -57,8 +57,9 @@ class WaypointFollower : public nav2_util::LifecycleNode /** * @brief A constructor for nav2_waypoint_follower::WaypointFollower class + * @param options Additional options to control creation of the node. */ - WaypointFollower(); + explicit WaypointFollower(const rclcpp::NodeOptions & options = rclcpp::NodeOptions()); /** * @brief A destructor for nav2_waypoint_follower::WaypointFollower class */ diff --git a/nav2_waypoint_follower/src/waypoint_follower.cpp b/nav2_waypoint_follower/src/waypoint_follower.cpp index e95203d628..2c7c27aaa1 100644 --- a/nav2_waypoint_follower/src/waypoint_follower.cpp +++ b/nav2_waypoint_follower/src/waypoint_follower.cpp @@ -24,8 +24,8 @@ namespace nav2_waypoint_follower { -WaypointFollower::WaypointFollower() -: nav2_util::LifecycleNode("WaypointFollower", "", false), +WaypointFollower::WaypointFollower(const rclcpp::NodeOptions & options) +: nav2_util::LifecycleNode("waypoint_follower", "", false, options), waypoint_task_executor_loader_("nav2_waypoint_follower", "nav2_core::WaypointTaskExecutor") {