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
272
272
{
273
273
planning_component_->setStateCostFunction (nullptr );
274
274
}
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
+ }
275
280
276
- solutions.push_back (planning_component_-> plan (plan_request_parameters, planning_scene) );
281
+ solutions.push_back (solution );
277
282
}
278
283
279
284
int color_index = 1 ;
@@ -285,7 +290,8 @@ class Demo
285
290
if (plan_solution.trajectory )
286
291
{
287
292
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 ));
289
295
// Visualize the trajectory in Rviz
290
296
visual_tools_.publishTrajectoryLine (plan_solution.trajectory , joint_model_group_ptr,
291
297
rviz_visual_tools::Colors (color_index));
You can’t perform that action at this time.
0 commit comments