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

Review primitive types #190

Closed
3 tasks
mikaelarguedas opened this issue Dec 13, 2016 · 10 comments
Closed
3 tasks

Review primitive types #190

mikaelarguedas opened this issue Dec 13, 2016 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@mikaelarguedas
Copy link
Member

mikaelarguedas commented Dec 13, 2016

This is a meta-ticket for type deprecationg and primitive types supported is ROS 2 IDL.

  • decide what types to support and update design documents accordingly
  • update parsers and generators to match these types
  • update code and example to use the new supported types
@mikaelarguedas mikaelarguedas self-assigned this Dec 13, 2016
@mikaelarguedas mikaelarguedas added the in progress Actively being worked on (Kanban column) label Dec 13, 2016
@mikaelarguedas
Copy link
Member Author

mikaelarguedas commented Dec 13, 2016

CI:
Linux: Build Status
OSX: Build Status
Windows: Build Status

@dirk-thomas
Copy link
Member

For these changes the existing design docs need to be considered too. There are specific mappings for DDS as well as Python which don't have an equivalent if these would be removed. Therefore I think this needs further consideration and shouldn't be done for the beta 1.

@mikaelarguedas
Copy link
Member Author

I'm not advocating to get this in the beta. It would be great but maybe a bit premature.
I'm opening this so that we will have this and the corresponding design PRs opened for reference and will be able to move forward on it as soon as we decide that this is the way to go.

@mikaelarguedas mikaelarguedas added ready Work is about to start (Kanban column) and removed in progress Actively being worked on (Kanban column) labels Jan 5, 2017
@mikaelarguedas
Copy link
Member Author

I never really replied to #190 (comment):

  • deprecating this means that we don't send the DDS type "char" anymore
  • current implementation just remaps to int8/uint8 types. Meaning that in python the corresponding message fields have to be populated as numbers and not as builtin.bytes or buitin.str. Extra logic can be added in the python getter to allow both types and store the integral equivalent under the hood. I think the getters will always return the integral representation though.

Note: the fact that ROS1 consider bytes as signed goes against Python's definition of a byte that is an unsigned octet, that's why I stuck to only remap the types in this PR

@mikaelarguedas mikaelarguedas changed the title Deprecate char and byte and remap them as ROS 1 does Deprecate char and byte and remap them as to int8 and uint8 Apr 20, 2017
@mikaelarguedas
Copy link
Member Author

CI:
Linux: Build Status
OSX: Build Status
Windows: Build Status
aarch64: Build Status

@mikaelarguedas mikaelarguedas added in progress Actively being worked on (Kanban column) and removed ready Work is about to start (Kanban column) labels Apr 20, 2017
@mikaelarguedas
Copy link
Member Author

@mikaelarguedas update design accordingly

@mikaelarguedas
Copy link
Member Author

@mikaelarguedas need to update design to keep these types and offer flexibility for users to request a specific structure to receive them

@mikaelarguedas mikaelarguedas added ready Work is about to start (Kanban column) and removed in progress Actively being worked on (Kanban column) labels May 18, 2017
@mikaelarguedas mikaelarguedas removed the ready Work is about to start (Kanban column) label Jul 19, 2017
@mikaelarguedas mikaelarguedas changed the title Deprecate char and byte and remap them as to int8 and uint8 Review primitive types Aug 7, 2017
@mikaelarguedas mikaelarguedas added the enhancement New feature or request label Aug 7, 2017
@clalancette clalancette modified the milestones: untargeted, bouncy Feb 22, 2018
@mikaelarguedas mikaelarguedas removed this from the bouncy milestone May 7, 2018
@ghost
Copy link

ghost commented Aug 16, 2018

It would be nice to have a type (perhaps byte[]) that maps to a python bytes object. Currently passing binary data around causes a large amount of unnecessary copying. E.g., if I want to use python to load an image from disk then send it to another rclpy node I have to: read it in as a bytes object, copy that data to a list[int] object, send the message (which presumably ends up packing the data back into an array of bytes), receive the message (which presumably ends up unpacking the data), then pack the data back into a bytes object.

It would also almost entirely clear up ros2/ros2#509

@mikaelarguedas
Copy link
Member Author

@dirk-thomas
Copy link
Member

With the migration to use .idl files in #346 the types as defined in the IDL spec have been adopted. The upcoming article https://github.com/ros2/design/blob/gh-pages/articles/142_idl.md describes these types and the article https://github.com/ros2/design/blob/gh-pages/articles/143_legacy_interface_definition.md described the mapping from the .msg types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants