Skip to content

Commit d9618d2

Browse files
committed
Fix crash when planning fails
1 parent 01bbe48 commit d9618d2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

stomp_moveit/src/stomp_planner.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,10 @@ bool StompPlanner::solve(planning_interface::MotionPlanResponse &res)
160160
ros::WallTime start_time = ros::WallTime::now();
161161
planning_interface::MotionPlanDetailedResponse detailed_res;
162162
bool success = solve(detailed_res);
163-
164-
// construct the compact response from the detailed one
165-
res.trajectory_ = detailed_res.trajectory_.back();
163+
if(success)
164+
{
165+
res.trajectory_ = detailed_res.trajectory_.back();
166+
}
166167
ros::WallDuration wd = ros::WallTime::now() - start_time;
167168
res.planning_time_ = ros::Duration(wd.sec, wd.nsec).toSec();
168169
res.error_code_ = detailed_res.error_code_;

0 commit comments

Comments
 (0)