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 Compose Tasks #159

Merged
merged 4 commits into from
Jan 27, 2022
Merged

Fix Compose Tasks #159

merged 4 commits into from
Jan 27, 2022

Conversation

Yadunund
Copy link
Member

Add phase descriptions to builder in task deserializer.

Signed-off-by: Yadunund <yadunund@openrobotics.org>
Signed-off-by: Yadunund <yadunund@openrobotics.org>
Signed-off-by: Yadunund <yadunund@openrobotics.org>
@Yadunund Yadunund requested a review from mxgrey January 27, 2022 10:18
Copy link
Contributor

@mxgrey mxgrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great fix, but I do have one quick request.

if (on_cancel_json.is_array())
std::vector<rmf_task_sequence::Phase::ConstDescriptionPtr> cancel = {};
const auto cancel_it = phase_json.find("on_cancel");
if (cancel_it != phase_json.end() && cancel_it.value().is_array())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not silently ignore on_cancel if it doesn't map to an array.

We can skip adding the cancellation sequence, but let's at least add a message to the errors vector so that the operators can be informed of the issue.

Copy link
Contributor

@mxgrey mxgrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, I just remembered that the schema of on_cancel requires it to be an array. If the validator approved of the message, then it should certainly be an array. Nothing needs to be changed here.

@mxgrey
Copy link
Contributor

mxgrey commented Jan 27, 2022

...Although it might not hurt to issue some kind of error anyway, just in case the schema has been changed while the assumptions of this code fail to be updated.

Signed-off-by: Yadunund <yadunund@openrobotics.org>
@Yadunund Yadunund merged commit 2f41a93 into redesign_v2 Jan 27, 2022
@Yadunund Yadunund deleted the debug/redesign_v2 branch January 27, 2022 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants