-
Notifications
You must be signed in to change notification settings - Fork 148
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 argument parsing in Actions #663
Merged
Merged
Conversation
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
The `RosGzBridge` and `GzServer` now support different spellings for boolean arguments (`True`, `true`). This also simplifies how conditionals are used to create composable nodes by evaluating the conditionals and using them as regular Python booleans instead of relying on `PythonExpression`. It was actually the `PythonExpression` that was preventing support of boolean arguments spelled `true`/`false`. Signed-off-by: Addisu Z. Taddese <[email protected]>
azeey
requested review from
caguero and
ahcorde
and removed request for
ahcorde
December 10, 2024 17:17
ahcorde
requested changes
Dec 10, 2024
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.
10: - /opt/ros/rolling/bin/ament_flake8 --xunit-file /github/home/ws/build/ros_gz_bridge/test_results/ros_gz_bridge/flake8.xunit.xml
10: # This is here to allow using strings or booleans as values for boolean variables when the Action is used from Python
10: ^
10: # Note that use_composition is set to a string while create_own_container is set to a boolean. The reverse would also work.
10: ^
10: # At some point, we might want to deprecate this and only allow setting booleans since that's
10: ^
10: self.__create_own_container = normalize_typed_substitution(TextSubstitution(text=create_own_container), bool)
10: ^
10: self.__use_composition = normalize_typed_substitution(TextSubstitution(text=use_composition), bool)
10: ^
10: kwargs:Dict = super().parse(entity, parser)[1]
10: ^
10: create_own_container_eval = perform_typed_substitution(context, self.__create_own_container, bool)
10: ^
10: 1 E231 missing whitespace after ':'
10: 6 E501 line too long (125 > 99 characters)
Signed-off-by: Addisu Z. Taddese <[email protected]>
ahcorde
approved these changes
Dec 11, 2024
https://github.com/Mergifyio backport jazzy |
✅ Backports have been created
|
8 tasks
8 tasks
ahcorde
added a commit
that referenced
this pull request
Dec 11, 2024
[backport Jazzy] Improve argument parsing in Actions (#663)
8 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🦟 Bug fix
Summary
The
RosGzBridge
andGzServer
now support different spellings for boolean arguments (True
,true
). This also simplifies how conditionals are used to create composable nodes by evaluating the conditionals and using them as regular Python booleans instead of relying onPythonExpression
. It was actually thePythonExpression
that was preventing support of boolean arguments spelledtrue
/false
.This came up in #632
The launch file in XML can now use lower case boolean strings:
https://github.com/gazebosim/ros_gz/blob/25b6644b644183e09f517170ce41b5dc6f16d6b8/ros_gz_sim_demos/launch/air_pressure.launch.xml#L1C1-L15C10
The equivalent python launch file for just gzserver and the bridge would be:
Note the
use_composition
argument can be a python boolean or a string (True
ortrue
). We should probably deprecate the string input at some point since that's not very PythonicChecklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.