Skip to content

Commit 846501b

Browse files
committed
Format and add cost_function
1 parent 81aa932 commit 846501b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Using cost functions in the MoveIt Planning Pipeline
22
====================================================
33

4-
TODO
4+
TODO

doc/how_to_guides/planner_cost_functions/src/planner_cost_functions_main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#include <moveit_visual_tools/moveit_visual_tools.h>
1010

11+
// Cost functions
12+
#include <moveit/cost_functions/cost_functions.hpp>
1113
// Warehouse
1214
#include <moveit/warehouse/planning_scene_storage.h>
1315
#include <moveit/warehouse/planning_scene_storage.h>
@@ -183,6 +185,9 @@ class Demo
183185
// Set start state as current state
184186
planning_component_->setStartStateToCurrentState();
185187

188+
// Set cost function
189+
planning_component_->setStateCostFunction(moveit::cost_functions::getClearanceCostFn());
190+
186191
auto plan_solution = planning_component_->plan();
187192

188193
// Check if PlanningComponents succeeded in finding the plan

0 commit comments

Comments
 (0)