-
Notifications
You must be signed in to change notification settings - Fork 6
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
Improve array support #8
Merged
bonprosoft
merged 11 commits into
rospypi:master
from
Greenroom-Robotics:feat/array-support
Jun 2, 2022
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0554ffb
feat: attempt to add array support
MrBlenny f7902ec
feat: seems to be working
MrBlenny 5416fb0
feat: add support for npdarray
MrBlenny af8a642
refactor: tidy imports
MrBlenny 80659ff
fix: don't use array.array for a sequence of non int/float
MrBlenny a5fdf08
fix: use SPECIAL_NESTED_BASIC_TYPES
MrBlenny 0db2973
fix: constants
MrBlenny 3fd7c7d
fix: simplify SPECIAL_NESTED_BASIC_TYPES
MrBlenny 70dad0e
Suggestion to array support
bonprosoft 6fae84e
refactor: add suggestions
MrBlenny 2359831
fix: handled bounded lists of complex types as sequences
MrBlenny File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 read the specification.
https://design.ros2.org/articles/idl_interface_definition.html
According to the
Type Mapping
section on the document, shouldn't we checktype_annotation.getter in SPECIAL_NESTED_BASIC_TYPES
in the same way asAbstractSequence
?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'm not sure... I've tested this against most of the standard ros interfaces (eg sensor_msgs) and I think everything looked correct.
It could be prudent to write some tests which
colcon build
a bunch of messages and make assertions about thepyi
code it generates but I'm not sure I'll have time to do that right now.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 referred to the
rosidl_python
implementation, and it actually follows the specification.I think the member initialization part is helpful to understand this behavior:
https://github.com/ros2/rosidl_python/blob/6675823dd6123360912e233a830d1edab89c7651/rosidl_generator_py/resource/_msg.py.em#L320-L332
I've also tested with the following message definition and got the same result that I expected.
Definition
integer_array
integer_fixed_array
header_array
header_fixed_array
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.
@MrBlenny I also encountered the same issue as you 😅
Actually, this PR is great, and It would be wonderful to merge this PR soon.
If you don't have time to update this PR, please let me know. I am happy to help you.