Optimization Objective has no effect
I am planning with RRTstar for a 6 DOF articulated robot. I move from a joint start to a pose goal. I plot mean of path length vs planning time and do 10 runs for each 0.1s intervall in [0.1; 9.9]
Although I see high variability, the mean of the path length does not decrease when planning time
increases. I am quite surprised by this since I have set the optimization objective to PathLengthOptimizationObjective.
I see the same behaviour when I play with num_planning_attempts
or range
.
Is there something I am missing like enabling the planner params set by setPlannerParams()
?
Or is this expected behaviour since I am not planning around an obstacle, but rather "besides" it.
Here is my code:
move_group_GR.setPoseReferenceFrame("world_zero");
bool success = false;
int num_runs = 10;
double max_planning_time = 10.0;
double min_planning_time = 0.1;
double planning_time_step = 0.1;
for(float a = min_planning_time; a <= max_planning_time; a = a + planning_time_step ){
for(int i = 0; i < num_runs; i++){
move_group_GR.setNumPlanningAttempts(10);
move_group_GR.setPlanningTime(a);
move_group_GR.setPlannerId("RRTstar");
std::map<std::string, std::string> m;
m.insert(std::pair<std::string, std::string>("range", "0.0"));
m.insert(std::pair<std::string, std::string>("goal_bias", "0.05"));
m.insert(std::pair<std::string, std::string>("delay_collision_checking", "1"));
m.insert(std::pair<std::string, std::string>("optimization_objective", "PathLengthOptimizationObjective"));
move_group_GR.setPlannerParams("RRTstar", "Gripper", m);
// Target
move_group_GR.setPoseTarget(t_pose);
// Start
move_group_GR.setStartStateToCurrentState();
// Generate Plan
moveit::planning_interface::MoveGroupInterface::Plan measurePlan;
success = false;
success = (move_group_GR.plan(measurePlan) == moveit::planning_interface::MoveItErrorCode::SUCCESS);
// Executing and logging ...
// Move back to start ...
}
}
Setting the range with
setPlannerParams()
seems to have no effect on the configuration variables on the parameter server.