File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
doc/how_to_guides/planner_cost_functions/src Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -272,8 +272,13 @@ class Demo
272272 {
273273 planning_component_->setStateCostFunction (nullptr );
274274 }
275+ auto solution = planning_component_->plan (plan_request_parameters, planning_scene);
276+ if (pipeline_config.use_cost_function )
277+ {
278+ solution.planner_id += std::string (" _with_cost_term" );
279+ }
275280
276- solutions.push_back (planning_component_-> plan (plan_request_parameters, planning_scene) );
281+ solutions.push_back (solution );
277282 }
278283
279284 int color_index = 1 ;
@@ -285,7 +290,8 @@ class Demo
285290 if (plan_solution.trajectory )
286291 {
287292 RCLCPP_INFO_STREAM (LOGGER, plan_solution.planner_id .c_str ()
288- << " : " << colorToString (rviz_visual_tools::Colors (color_index)));
293+ << " : " << colorToString (rviz_visual_tools::Colors (color_index))
294+ << " , Path length: " << robot_trajectory::path_length (*plan_solution.trajectory ));
289295 // Visualize the trajectory in Rviz
290296 visual_tools_.publishTrajectoryLine (plan_solution.trajectory , joint_model_group_ptr,
291297 rviz_visual_tools::Colors (color_index));
You can’t perform that action at this time.
0 commit comments