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

Fix Parameter Descriptor Incorrectly Populating Range Constraints for size_lt and size_gt #105

Merged

Conversation

chancecardona
Copy link
Contributor

@chancecardona chancecardona commented Apr 13, 2023

Due to the string checking in the declare(_runtime)_parameters templates, size_lt and size_gt would incorrectly populate the descriptor range constraints since it also has 1 argument. This changes that line in the template to explicitly check for lt, lt_eq, gt, and gt_eq so that we avoid this error and hopefully other errors in the future.

Not the cleanest implementation, but added a function_base_name without the template brackets <>. This passes the checks I've looked for and should reduce the descriptors being inadvertently filled unless the validation function name has both the substring lesser/greater and bounds in it with 1 argument. Could clean up in future if desired but would need to think about how to structure this in the jinja templates / main.py, as it's a bit long. But this should work without any false positives now.

@chancecardona chancecardona marked this pull request as draft April 13, 2023 17:27
@chancecardona chancecardona marked this pull request as ready for review April 13, 2023 17:58
Copy link
Contributor

@tylerjw tylerjw left a comment

Choose a reason for hiding this comment

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

Thank you for catching this. How useful do you think it would be for me to push out a patch release for this fix right away?

@tylerjw tylerjw merged commit b6528e7 into PickNikRobotics:main Apr 14, 2023
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