22#include < eigen3/Eigen/src/Geometry/Quaternion.h>
33#include < spdlog/spdlog.h>
44#include < yaml-cpp/node/node.h>
5+ #include < geometry_msgs/msg/detail/point_stamped__struct.hpp>
56#include < rclcpp_components/register_node_macro.hpp>
67#include < vortex/utils/math.hpp>
78#include < vortex/utils/ros/qos_profiles.hpp>
@@ -106,7 +107,7 @@ void LosGuidanceNode::set_action_server() {
106107 this ->create_callback_group (rclcpp::CallbackGroupType::Reentrant);
107108
108109 action_server_ =
109- rclcpp_action::create_server<vortex_msgs::action::LOSGuidance >(
110+ rclcpp_action::create_server<vortex_msgs::action::SetWaypoint >(
110111 this , action_server_name,
111112 std::bind (&LosGuidanceNode::handle_goal, this ,
112113 std::placeholders::_1, std::placeholders::_2),
@@ -258,7 +259,7 @@ void LosGuidanceNode::odom_msg_callback(
258259
259260rclcpp_action::GoalResponse LosGuidanceNode::handle_goal (
260261 const rclcpp_action::GoalUUID&,
261- std::shared_ptr<const vortex_msgs::action::LOSGuidance ::Goal> goal) {
262+ std::shared_ptr<const vortex_msgs::action::SetWaypoint ::Goal> goal) {
262263 types::Inputs inputs_copy;
263264
264265 {
@@ -290,7 +291,7 @@ rclcpp_action::GoalResponse LosGuidanceNode::handle_goal(
290291
291292rclcpp_action::CancelResponse LosGuidanceNode::handle_cancel (
292293 const std::shared_ptr<
293- rclcpp_action::ServerGoalHandle<vortex_msgs::action::LOSGuidance >>
294+ rclcpp_action::ServerGoalHandle<vortex_msgs::action::SetWaypoint >>
294295 goal_handle) {
295296 spdlog::info (" Received request to cancel goal" );
296297 (void )goal_handle;
@@ -299,7 +300,7 @@ rclcpp_action::CancelResponse LosGuidanceNode::handle_cancel(
299300
300301void LosGuidanceNode::handle_accepted (
301302 const std::shared_ptr<
302- rclcpp_action::ServerGoalHandle<vortex_msgs::action::LOSGuidance >>
303+ rclcpp_action::ServerGoalHandle<vortex_msgs::action::SetWaypoint >>
303304 goal_handle) {
304305 std::thread{[this , goal_handle]() { execute (goal_handle); }}.detach ();
305306}
@@ -352,9 +353,9 @@ vortex_msgs::msg::LOSGuidance LosGuidanceNode::fill_los_reference(
352353
353354bool LosGuidanceNode::is_goal_feasible (
354355 const types::Inputs& inputs,
355- std::shared_ptr<const vortex_msgs::action::LOSGuidance ::Goal> goal) {
356+ std::shared_ptr<const vortex_msgs::action::SetWaypoint ::Goal> goal) {
356357 const auto & current_position = inputs.current_position ;
357- const auto & goal_point = goal->goal . point ;
358+ const auto & goal_point = goal->waypoint . pose . position ;
358359
359360 const double dx = goal_point.x - current_position.x ;
360361 const double dy = goal_point.y - current_position.y ;
@@ -422,7 +423,7 @@ void LosGuidanceNode::parse_common_config(YAML::Node common_config) {
422423
423424void LosGuidanceNode::execute (
424425 const std::shared_ptr<
425- rclcpp_action::ServerGoalHandle<vortex_msgs::action::LOSGuidance >>
426+ rclcpp_action::ServerGoalHandle<vortex_msgs::action::SetWaypoint >>
426427 goal_handle) {
427428 {
428429 std::unique_lock<std::mutex> lock (mutex_);
@@ -432,10 +433,10 @@ void LosGuidanceNode::execute(
432433
433434 spdlog::info (" Executing goal" );
434435
435- const geometry_msgs::msg::PointStamped los_waypoint =
436- goal_handle->get_goal ()->goal ;
436+ const geometry_msgs::msg::Point los_waypoint =
437+ goal_handle->get_goal ()->waypoint . pose . position ;
437438
438- const auto new_wp = types::Point::point_from_ros (los_waypoint. point );
439+ const auto new_wp = types::Point::point_from_ros (los_waypoint);
439440
440441 {
441442 std::unique_lock<std::mutex> lock (mutex_);
@@ -452,7 +453,7 @@ void LosGuidanceNode::execute(
452453
453454 adaptive_los_->reset ();
454455
455- auto result = std::make_shared<vortex_msgs::action::LOSGuidance ::Result>();
456+ auto result = std::make_shared<vortex_msgs::action::SetWaypoint ::Result>();
456457 nearest_been_to_goal_ = std::numeric_limits<double >::infinity ();
457458 time_since_nearest_goal_ = 0.0 ;
458459
0 commit comments