Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix motion planner task to support error branching #579

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ class MotionPlannerTask : public TaskComposerTask

// Make a non-const copy of the input instructions to update the start/end
auto& instructions = input_data_poly.template as<CompositeInstruction>();
assert(!(input_manip_info.empty() && instructions.getManipulatorInfo().empty()));
if (input_manip_info.empty() && instructions.getManipulatorInfo().empty())
throw std::runtime_error("Missing manipulator information");
instructions.setManipulatorInfo(instructions.getManipulatorInfo().getCombined(input_manip_info));

// --------------------
Expand All @@ -193,13 +194,14 @@ class MotionPlannerTask : public TaskComposerTask
if (console_bridge::getLogLevel() == console_bridge::LogLevel::CONSOLE_BRIDGE_LOG_DEBUG)
request.verbose = true;
PlannerResponse response = planner_->solve(request);
setData(*context.data_storage, INOUT_PROGRAM_PORT, response.results);

// --------------------
// Verify Success
// --------------------
if (response)
{
// Should only set on success to support error branching
setData(*context.data_storage, INOUT_PROGRAM_PORT, response.results);
info->return_value = 1;
info->color = "green";
info->status_code = 1;
Expand Down
Loading