Skip to content

Commit d45daf0

Browse files
nav2_bt_navigator: log current location on navigate_to_pose action initialization (#3720)
It is very useful to know the current location considered by the bt_navigator for debug purposes.
1 parent c0dbcd5 commit d45daf0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

nav2_bt_navigator/src/navigators/navigate_to_pose.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,15 @@ NavigateToPoseNavigator::onPreempt(ActionT::Goal::ConstSharedPtr goal)
204204
void
205205
NavigateToPoseNavigator::initializeGoalPose(ActionT::Goal::ConstSharedPtr goal)
206206
{
207+
geometry_msgs::msg::PoseStamped current_pose;
208+
nav2_util::getCurrentPose(
209+
current_pose, *feedback_utils_.tf,
210+
feedback_utils_.global_frame, feedback_utils_.robot_frame,
211+
feedback_utils_.transform_tolerance);
212+
207213
RCLCPP_INFO(
208-
logger_, "Begin navigating from current location to (%.2f, %.2f)",
214+
logger_, "Begin navigating from current location (%.2f, %.2f) to (%.2f, %.2f)",
215+
current_pose.pose.position.x, current_pose.pose.position.y,
209216
goal->pose.pose.position.x, goal->pose.pose.position.y);
210217

211218
// Reset state for new action feedback

0 commit comments

Comments
 (0)