Skip to content

Commit d7d8c58

Browse files
Abishalinisjahr
authored andcommitted
Handle failed trajectory in connect stage (moveit#1)
* Handle failed trajectory in connect stage * Add some comments --------- Co-authored-by: Abishalini <[email protected]>
1 parent 1e45e85 commit d7d8c58

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/src/stages/connect.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,15 @@ void Connect::compute(const InterfaceState& from, const InterfaceState& to) {
161161

162162
robot_trajectory::RobotTrajectoryPtr trajectory;
163163
success = pair.second->plan(start, end, jmg, timeout, trajectory, path_constraints);
164-
sub_trajectories.push_back(trajectory); // include failed trajectory
164+
165+
// Do not push partial solutions
166+
if (success) {
167+
sub_trajectories.push_back(trajectory);
168+
}
169+
else {
170+
// Pushing a nullptr instead of a failed trajectory.
171+
sub_trajectories.push_back(nullptr);
172+
}
165173

166174
if (!success)
167175
break;

0 commit comments

Comments
 (0)