Conversation
Signed-off-by: David V. Lu <davidvlu@gmail.com>
b9a74c2 to
b1917ec
Compare
|
Current results for a preliminary GitHub search of potential usage: 1.2K |
|
Pulls: #944 |
asymingt
left a comment
There was a problem hiding this comment.
Implementation looks good; just two small comments. Thanks for the contribution. I'm waiting on a green CI to make sure there are no hidden consequences.
| name=name, | ||
| default_value=(default_value if not isinstance(default_value, bool) | ||
| else str(default_value)), | ||
| choices=['true', 'false', 'True', 'False'], |
There was a problem hiding this comment.
You might also add one additional case: a capitalized TRUE and FALSE here and to your test case.
| DeclareBooleanLaunchArgument('name') | ||
|
|
||
| # All possible default values | ||
| DeclareBooleanLaunchArgument('name', default_value='True') |
There was a problem hiding this comment.
Did you consider a for loop here for simplicity?
for default_value in ['True', 'true', 'False', 'false', True, False]:
DeclareBooleanLaunchArgument('name', default_value=default_value)
Description
Just a bit of syntactic sugar to make it easier to use boolean launch arguments. It tidies up launch files and avoids capitalization errors like
Is this user-facing behavior change?
Yes, it adds a new shortcut.
Did you use Generative AI?
No.