Skip to content

Implement functions to get parameters from global arguments #176

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

Merged
merged 6 commits into from
Jun 13, 2022

Conversation

nnmm
Copy link
Contributor

@nnmm nnmm commented May 23, 2022

The parameters are not accessible by users yet – I'll do that in a separate PR, since I want to keep them easy to review.

@nnmm nnmm requested a review from esteve May 23, 2022 22:24
@nnmm nnmm force-pushed the resolve_parameter_overrides branch from 3f2dd4e to dcccd03 Compare May 24, 2022 16:41
.into_iter()
.map(u8::from)
.sum();
assert_eq!(num_active, 1);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This assertion will fail on empty list parameters, but neither of the big 2 client libraries can handle empty lists either.

Copy link
Collaborator

Choose a reason for hiding this comment

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

No problem with failing on empty lists. We should get clarification from rclcpp and rclpy what the expected behavior should be.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I will try to find out more about this edge case. What I know is that launch_ros forbids empty lists because they're not supported (yet), so I think this is expected and we're definitely fine for now.

String(String),
/// An array of u8.
///
/// YAML example: Not possible to specify as YAML.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct me if I'm wrong with this comment.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Do you mean bytes (i.e. binary data) or unsigned integers? The former needs to be encoded as base64, whereas the latter is not possible to enforce signed integers in YAML.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Bytes. Can you specify how exactly to specify them? E.g. the following is base64-encoded, but parses to a string, not a byte array:

cargo run --bin minimal_subscriber -- --ros-args --param foo:="eW9sbw=="

Copy link
Collaborator

Choose a reason for hiding this comment

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

I meant that they can be encoded, but there's no way syntactically to differentiate bytes from strings.

.into_iter()
.map(u8::from)
.sum();
assert_eq!(num_active, 1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

No problem with failing on empty lists. We should get clarification from rclcpp and rclpy what the expected behavior should be.

@nnmm nnmm force-pushed the resolve_parameter_overrides branch from dcccd03 to fcde06d Compare June 1, 2022 08:29
@nnmm
Copy link
Contributor Author

nnmm commented Jun 2, 2022

@esteve This one could use another review too ;)

@nnmm nnmm force-pushed the resolve_parameter_overrides branch from fcde06d to 00e86f9 Compare June 11, 2022 10:57
@nnmm nnmm force-pushed the resolve_parameter_overrides branch from 00e86f9 to cc0ed1f Compare June 11, 2022 13:07
@nnmm
Copy link
Contributor Author

nnmm commented Jun 11, 2022

I added a test to ensure that the precedence of /** vs named node and global vs node arguments is correct.

@nnmm nnmm merged commit d8d7972 into main Jun 13, 2022
@delete-merged-branch delete-merged-branch bot deleted the resolve_parameter_overrides branch June 13, 2022 14:12
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