Skip to content

Commit

Permalink
Handle failed trajectory in connect stage (#1)
Browse files Browse the repository at this point in the history
* Handle failed trajectory in connect stage

* Add some comments

---------

Co-authored-by: Abishalini <abishalini.sivaraman@picknik.ai>
  • Loading branch information
2 people authored and sjahr committed May 3, 2023
1 parent 1e45e85 commit d7d8c58
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/src/stages/connect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,15 @@ void Connect::compute(const InterfaceState& from, const InterfaceState& to) {

robot_trajectory::RobotTrajectoryPtr trajectory;
success = pair.second->plan(start, end, jmg, timeout, trajectory, path_constraints);
sub_trajectories.push_back(trajectory); // include failed trajectory

// Do not push partial solutions
if (success) {
sub_trajectories.push_back(trajectory);
}
else {
// Pushing a nullptr instead of a failed trajectory.
sub_trajectories.push_back(nullptr);
}

if (!success)
break;
Expand Down

0 comments on commit d7d8c58

Please sign in to comment.