From cbd715d32301df92d10dbc699699719c0e4a468a Mon Sep 17 00:00:00 2001 From: Tony Najjar Date: Tue, 3 Dec 2024 14:02:51 +0100 Subject: [PATCH] change name of msg Signed-off-by: Tony Najjar --- .../plugins/decorator/goal_updater_node.hpp | 6 +++--- nav2_behavior_tree/plugins/decorator/goal_updater_node.cpp | 4 ++-- nav2_msgs/CMakeLists.txt | 2 +- nav2_msgs/msg/PoseStampedArray.msg | 4 ++++ nav2_msgs/msg/PosesStamped.msg | 1 - 5 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 nav2_msgs/msg/PoseStampedArray.msg delete mode 100644 nav2_msgs/msg/PosesStamped.msg diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/decorator/goal_updater_node.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/decorator/goal_updater_node.hpp index 1c16b4aebc..b40b8f825b 100644 --- a/nav2_behavior_tree/include/nav2_behavior_tree/plugins/decorator/goal_updater_node.hpp +++ b/nav2_behavior_tree/include/nav2_behavior_tree/plugins/decorator/goal_updater_node.hpp @@ -22,7 +22,7 @@ #include #include "geometry_msgs/msg/pose_stamped.hpp" -#include "nav2_msgs/msg/poses_stamped.hpp" +#include "nav2_msgs/msg/pose_stamped_array.hpp" #include "behaviortree_cpp/decorator_node.h" @@ -80,10 +80,10 @@ class GoalUpdater : public BT::DecoratorNode * @brief Callback function for goals update topic * @param msg Shared pointer to vector of geometry_msgs::msg::PoseStamped message */ - void callback_updated_goals(const nav2_msgs::msg::PosesStamped::SharedPtr msg); + void callback_updated_goals(const nav2_msgs::msg::PoseStampedArray::SharedPtr msg); rclcpp::Subscription::SharedPtr goal_sub_; - rclcpp::Subscription::SharedPtr goals_sub_; + rclcpp::Subscription::SharedPtr goals_sub_; geometry_msgs::msg::PoseStamped last_goal_received_; Goals last_goals_received_; diff --git a/nav2_behavior_tree/plugins/decorator/goal_updater_node.cpp b/nav2_behavior_tree/plugins/decorator/goal_updater_node.cpp index 33ee87b344..fd32e4c8c4 100644 --- a/nav2_behavior_tree/plugins/decorator/goal_updater_node.cpp +++ b/nav2_behavior_tree/plugins/decorator/goal_updater_node.cpp @@ -52,7 +52,7 @@ GoalUpdater::GoalUpdater( rclcpp::SystemDefaultsQoS(), std::bind(&GoalUpdater::callback_updated_goal, this, _1), sub_option); - goals_sub_ = node_->create_subscription( + goals_sub_ = node_->create_subscription( goals_updater_topic, rclcpp::SystemDefaultsQoS(), std::bind(&GoalUpdater::callback_updated_goals, this, _1), @@ -101,7 +101,7 @@ GoalUpdater::callback_updated_goal(const geometry_msgs::msg::PoseStamped::Shared } void -GoalUpdater::callback_updated_goals(const nav2_msgs::msg::PosesStamped::SharedPtr msg) +GoalUpdater::callback_updated_goals(const nav2_msgs::msg::PoseStampedArray::SharedPtr msg) { std::lock_guard lock(mutex_); last_goals_received_ = msg->poses; diff --git a/nav2_msgs/CMakeLists.txt b/nav2_msgs/CMakeLists.txt index ae2ceec881..e7bfb22cda 100644 --- a/nav2_msgs/CMakeLists.txt +++ b/nav2_msgs/CMakeLists.txt @@ -29,7 +29,7 @@ rosidl_generate_interfaces(${PROJECT_NAME} "msg/BehaviorTreeLog.msg" "msg/Particle.msg" "msg/ParticleCloud.msg" - "msg/PosesStamped.msg" + "msg/PoseStampedArray.msg" "msg/MissedWaypoint.msg" "srv/GetCosts.srv" "srv/GetCostmap.srv" diff --git a/nav2_msgs/msg/PoseStampedArray.msg b/nav2_msgs/msg/PoseStampedArray.msg new file mode 100644 index 0000000000..1a4e04dc0d --- /dev/null +++ b/nav2_msgs/msg/PoseStampedArray.msg @@ -0,0 +1,4 @@ +# An array of stamped poses with a header for global reference. + +std_msgs/Header header +geometry_msgs/PoseStamped[] poses \ No newline at end of file diff --git a/nav2_msgs/msg/PosesStamped.msg b/nav2_msgs/msg/PosesStamped.msg deleted file mode 100644 index dafb5fff0e..0000000000 --- a/nav2_msgs/msg/PosesStamped.msg +++ /dev/null @@ -1 +0,0 @@ -geometry_msgs/PoseStamped[] poses \ No newline at end of file