Skip to content

Commit 1bad1bb

Browse files
committed
Make WaypointFollower use WaypointStatus message type in action result
Signed-off-by: zz990099 <[email protected]>
1 parent 64dc81a commit 1bad1bb

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

nav2_waypoint_follower/include/nav2_waypoint_follower/waypoint_follower.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "nav2_util/lifecycle_node.hpp"
2828
#include "nav2_msgs/action/navigate_to_pose.hpp"
2929
#include "nav2_msgs/action/follow_waypoints.hpp"
30-
#include "nav2_msgs/msg/missed_waypoint.hpp"
30+
#include "nav2_msgs/msg/waypoint_status.hpp"
3131
#include "nav_msgs/msg/path.hpp"
3232
#include "nav2_util/simple_action_server.hpp"
3333
#include "nav2_util/node_utils.hpp"

nav2_waypoint_follower/src/waypoint_follower.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,10 @@ void WaypointFollower::followWaypointsHandler(
305305
current_goal_status_.status == ActionStatus::FAILED ||
306306
current_goal_status_.status == ActionStatus::UNKNOWN)
307307
{
308-
nav2_msgs::msg::MissedWaypoint missedWaypoint;
309-
missedWaypoint.index = goal_index;
310-
missedWaypoint.goal = poses[goal_index];
308+
nav2_msgs::msg::WaypointStatus missedWaypoint;
309+
missedWaypoint.waypoint_status = nav2_msgs::msg::WaypointStatus::FAILED;
310+
missedWaypoint.waypoint_index = goal_index;
311+
missedWaypoint.waypoint_pose = poses[goal_index];
311312
missedWaypoint.error_code = current_goal_status_.error_code;
312313
missedWaypoint.error_msg = current_goal_status_.error_msg;
313314
result->missed_waypoints.push_back(missedWaypoint);
@@ -340,9 +341,10 @@ void WaypointFollower::followWaypointsHandler(
340341
is_task_executed ? "succeeded" : "failed!");
341342

342343
if (!is_task_executed) {
343-
nav2_msgs::msg::MissedWaypoint missedWaypoint;
344-
missedWaypoint.index = goal_index;
345-
missedWaypoint.goal = poses[goal_index];
344+
nav2_msgs::msg::WaypointStatus missedWaypoint;
345+
missedWaypoint.waypoint_status = nav2_msgs::msg::WaypointStatus::FAILED;
346+
missedWaypoint.waypoint_index = goal_index;
347+
missedWaypoint.waypoint_pose = poses[goal_index];
346348
missedWaypoint.error_code =
347349
nav2_msgs::action::FollowWaypoints::Result::TASK_EXECUTOR_FAILED;
348350
missedWaypoint.error_msg = "Task execution failed";

0 commit comments

Comments
 (0)