Skip to content

Commit 2fdbaea

Browse files
committed
report index of failed initializeGoalPoses (#4341)
Add the index of the pose that cannot be transformed in NavigateThroughPosesNavigator::initializeGoalPoses to the error_msg Signed-off-by: Mike Wake <[email protected]>
1 parent 9371c21 commit 2fdbaea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: nav2_bt_navigator/src/navigators/navigate_through_poses.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,15 @@ bool
231231
NavigateThroughPosesNavigator::initializeGoalPoses(ActionT::Goal::ConstSharedPtr goal)
232232
{
233233
Goals goal_poses = goal->poses;
234+
int i = 0;
234235
for (auto & goal_pose : goal_poses) {
235236
if (!nav2_util::transformPoseInTargetFrame(
236237
goal_pose, goal_pose, *feedback_utils_.tf, feedback_utils_.global_frame,
237238
feedback_utils_.transform_tolerance))
238239
{
239240
current_error_code_ = ActionT::Result::TF_ERROR;
240241
current_error_msg_ =
241-
"Failed to transform a goal pose provided with frame_id '" +
242+
"Failed to transform a goal pose (" + std::to_string(i) + ") provided with frame_id '" +
242243
goal_pose.header.frame_id +
243244
"' to the global frame '" +
244245
feedback_utils_.global_frame +
@@ -247,6 +248,7 @@ NavigateThroughPosesNavigator::initializeGoalPoses(ActionT::Goal::ConstSharedPtr
247248
RCLCPP_ERROR(logger_, current_error_msg_.c_str());
248249
return false;
249250
}
251+
i++;
250252
}
251253

252254
if (goal_poses.size() > 0) {

0 commit comments

Comments
 (0)