Skip to content

Commit 756982f

Browse files
committed
Restore output format of planner server message (#4341)
1 parent a7146fd commit 756982f

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

nav2_planner/src/planner_server.cpp

+9-12
Original file line numberDiff line numberDiff line change
@@ -740,18 +740,15 @@ void PlannerServer::exceptionWarning(
740740
const std::exception & ex,
741741
std::string & error_msg)
742742
{
743-
error_msg = planner_id +
744-
"plugin failed to plan from (" +
745-
std::to_string(start.pose.position.x) +
746-
", " +
747-
std::to_string(start.pose.position.y) +
748-
") to (" +
749-
std::to_string(goal.pose.position.x) +
750-
", " +
751-
std::to_string(goal.pose.position.y) +
752-
": \"" +
753-
ex.what() +
754-
"\"";
743+
std::stringstream ss;
744+
ss << std::fixed << std::setprecision(2)
745+
<< planner_id << "plugin failed to plan from ("
746+
<< start.pose.position.x << ", " << start.pose.position.y
747+
<< ") to ("
748+
<< goal.pose.position.x << ", " << goal.pose.position.y << ")"
749+
<< ": \"" << ex.what() << "\"";
750+
751+
error_msg = ss.str();
755752
RCLCPP_WARN(get_logger(), error_msg.c_str());
756753
}
757754

0 commit comments

Comments
 (0)