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

Avoid passing None to rclpy.init #433

Merged
merged 1 commit into from
Jan 28, 2020
Merged

Avoid passing None to rclpy.init #433

merged 1 commit into from
Jan 28, 2020

Conversation

jacobperron
Copy link
Member

@jacobperron jacobperron commented Jan 13, 2020

Otherwise, all CLI arguments will be parsed as ROS arguments, which can lead
to rcl warnings or incorrect legacy remapping behavior.

This change does not pass arguments to rclpy.init from any of the CLI
tools, but it leaves the opportunity to do so in the future by setting the
parser argument 'argv'. For example, we could take the remaining arguments
and pass them to rclpy.init, similar to what is done in ros2run:

parser.add_argument(
'argv', nargs=REMAINDER,
help='Pass arbitrary arguments to the executable')

Fixes #336.

Otherwise, all CLI arguments will be parsed as ROS arguments, which can lead
to rcl warnings or incorrect legacy remapping behavior.

This change does not pass arguments to rclpy.init from any of the CLI
tools, but it leaves the opportunity to do so in the future by setting the
parser argument 'argv'. For example, we could take the remaining arguments
and pass them to rclpy.init, similar to what is done in ros2run:

https://github.com/ros2/ros2cli/blob/4c5d9327026ecb2ea10a16b3429908b4f6f64ca6/ros2run/ros2run/command/run.py#L51-L53

Fixes #336.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
@ivanpauno
Copy link
Member

@jacobperron from pre-waffle can you retrigger CI?

@jacobperron jacobperron merged commit 2b6286c into master Jan 28, 2020
@delete-merged-branch delete-merged-branch bot deleted the jacob/node_args branch January 28, 2020 02:21
sloretz pushed a commit that referenced this pull request Feb 6, 2020
Otherwise, all CLI arguments will be parsed as ROS arguments, which can lead
to rcl warnings or incorrect legacy remapping behavior.

This change does not pass arguments to rclpy.init from any of the CLI
tools, but it leaves the opportunity to do so in the future by setting the
parser argument 'argv'. For example, we could take the remaining arguments
and pass them to rclpy.init, similar to what is done in ros2run:

https://github.com/ros2/ros2cli/blob/4c5d9327026ecb2ea10a16b3429908b4f6f64ca6/ros2run/ros2run/command/run.py#L51-L53

Fixes #336.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>
sloretz added a commit that referenced this pull request Feb 9, 2020
Otherwise, all CLI arguments will be parsed as ROS arguments, which can lead
to rcl warnings or incorrect legacy remapping behavior.

This change does not pass arguments to rclpy.init from any of the CLI
tools, but it leaves the opportunity to do so in the future by setting the
parser argument 'argv'. For example, we could take the remaining arguments
and pass them to rclpy.init, similar to what is done in ros2run:

https://github.com/ros2/ros2cli/blob/4c5d9327026ecb2ea10a16b3429908b4f6f64ca6/ros2run/ros2run/command/run.py#L51-L53

Fixes #336.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
Signed-off-by: Shane Loretz <sloretz@osrfoundation.org>

Co-authored-by: Jacob Perron <jacob@openrobotics.org>
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.

[ros2component] Parameters and remap rules cause log warning
3 participants