-
Notifications
You must be signed in to change notification settings - Fork 162
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
Conversation
3f2dd4e
to
dcccd03
Compare
.into_iter() | ||
.map(u8::from) | ||
.sum(); | ||
assert_eq!(num_active, 1); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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=="
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
dcccd03
to
fcde06d
Compare
@esteve This one could use another review too ;) |
fcde06d
to
00e86f9
Compare
00e86f9
to
cc0ed1f
Compare
I added a test to ensure that the precedence of |
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.