Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ensure fieldType is a scalar if arrayLen is -1 #638

Merged
merged 6 commits into from
Nov 16, 2023

Conversation

scottbell
Copy link
Contributor

@scottbell scottbell commented Oct 16, 2023

Public API Changes

None

Description

Before this change, typeDefDict[fieldName] was always assigned as an array, irrespective of other variables’ states. With this new update, if the arrayLen is equal to -1, the typeDefDict[fieldName] is assigned the non-array value fieldType. If arrayLen doesn't equal -1, the assignment remains an array format, [fieldType].

We used this to successfully decode ROS2 nested types.

#463

@scottbell scottbell changed the title Add type definitions as we go Ensure fieldType is a scalar if arrayLen is -1 Oct 16, 2023
@MatthijsBurgh
Copy link
Contributor

@scottbell I will take a look at this, but it could take some time.

@MatthijsBurgh
Copy link
Contributor

@sea-bass @EzraBrooks what do you think of this PR? I see you approved the related PR in rosbridge_suite.

Copy link
Contributor

@sea-bass sea-bass left a comment

Choose a reason for hiding this comment

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

This one LGTM -- we are using the author's related rosbridge_suite capabilities in our tool as well for fixed-size arrays, so we can vouch for this work.

@MatthijsBurgh MatthijsBurgh merged commit 2ec60c0 into RobotWebTools:develop Nov 16, 2023
3 checks passed
MatthijsBurgh pushed a commit that referenced this pull request Dec 4, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants