Skip to content

Commit

Permalink
fix segfault
Browse files Browse the repository at this point in the history
If the main planner fails, res.trajectory_ is NULL, and accessing it segfaults.
Now, bail out in this case.
  • Loading branch information
rhaschke committed Mar 5, 2019
1 parent 0ba091c commit 1012092
Showing 1 changed file with 3 additions and 2 deletions.
Expand Up @@ -166,7 +166,8 @@ class OptimizerAdapter : public planning_request_adapter::PlanningRequestAdapter
{
// following call to planner() calls the OMPL planner and stores the trajectory inside the MotionPlanResponse res
// variable which is then used by CHOMP for optimization of the computed trajectory
bool solved = planner(ps, req, res);
if (!planner(ps, req, res))
return false;

// create a hybrid collision detector to set the collision checker as hybrid
collision_detection::CollisionDetectorAllocatorPtr hybrid_cd(
Expand Down Expand Up @@ -216,7 +217,7 @@ class OptimizerAdapter : public planning_request_adapter::PlanningRequestAdapter
res.planning_time_ = res_detailed.processing_time_[0];
}

return solved;
return planning_success;
}

private:
Expand Down

0 comments on commit 1012092

Please sign in to comment.