Skip to content
This repository was archived by the owner on May 31, 2025. It is now read-only.

[roslaunch] Add ignore default args option to roslaunch-check#1788

Merged
dirk-thomas merged 8 commits intoros:melodic-develfrom
collinscrib:roslaunch-check-melodic
Feb 8, 2020
Merged

[roslaunch] Add ignore default args option to roslaunch-check#1788
dirk-thomas merged 8 commits intoros:melodic-develfrom
collinscrib:roslaunch-check-melodic

Conversation

@collinscrib
Copy link
Copy Markdown
Contributor

Addresses #953

Adds an option to roslaunch-check to ignore the error thrown when a <arg> is declared but doesn't have a default variable.

Usage

From the roslaunch-check script: rosrun roslaunch roslaunch-check [-i / --ignore-default-args] foo.launch
From a CMakeLists.txt file: roslaunch_add_file_check(launch/foo.launch IGNORE_DEFAULT_ARGS)

Example

The example given is as follows:

<launch>
  <arg name="foo" />    <!-- no `default="something" here! --> 
  <node name="bar" pkg="bar" type="bar">
    <param name="foo" value="$(arg foo)" />
  </node>
</launch>

which, when run with roslaunch-check, will output

$ rosrun roslaunch roslaunch-check foo.launch
FAILURE:
[foo.launch]:
	[foo.launch] requires the 'foo' arg to be set

The change adds an option to ignore this error with -i or --ignore-default-args like so

$ rosrun roslaunch roslaunch-check --ignore-default-args foo.launch
passed

@130s
Copy link
Copy Markdown
Member

130s commented Aug 9, 2019

Just FYI for reviewers, we've been running tests using this PR (on ROS Kinetic, not Melodic) at Plus One Robotics and we'll keep doing so. We're also working on setting up any publicly visible test results (which I hope doesn't block the review).

@cwecht
Copy link
Copy Markdown
Contributor

cwecht commented Aug 10, 2019

The name of the new flag is a bit misleading, right? It does not ignore default arguments but ignores not set arguments.

@collinscrib
Copy link
Copy Markdown
Contributor Author

The name of the new flag is a bit misleading

Maybe something like --ignore-unset-args is more appropriate?

@cwecht
Copy link
Copy Markdown
Contributor

cwecht commented Aug 29, 2019

Maybe something like --ignore-unset-args is more appropriate?

Yes, this is better!

@dirk-thomas
Copy link
Copy Markdown
Member

Thanks for the patch.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants