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

Add ros_arguments option to Node action #249

Merged

Conversation

christophebedard
Copy link
Member

Closes #60

This adds a ros_arguments option to the Node action. It's simply: ros_arguments == ['--ros-args'] + arguments.

Signed-off-by: Christophe Bedard bedard.christophe@gmail.com

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
@@ -180,6 +181,9 @@ def __init__(
wildcard namespace (`/**`) and other specific parameter declarations
may overwrite it.

Using `ros_arguments` is equivalent to using `arguments` with a
prepended '--ros-args' item.
Copy link
Contributor

Choose a reason for hiding this comment

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

@christophebedard I see the convenience BUT is it necessary? Most ROS arguments can be given in an idiomatic way (e.g. via remappings) already. If we need --log-level, I'd argue we should add it. CC @wjwwood @ivanpauno.

Copy link
Member Author

Choose a reason for hiding this comment

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

I found #60 while answering an answers.ros.org question: https://answers.ros.org/question/380883/specify-log-level-on-ros2-node-in-launch-file/#380965. In this case, it seemed to confuse the person. They weren't sure whether they needed to use -- beause launch_ros appends --ros-args ... too (even if in practice rcl handles it just fine). I think having ros_arguments would make it much simpler, but yeah it's up to you the maintainers 😝

If we need --log-level

you mean like a LogLevel substitution?

Copy link
Contributor

Choose a reason for hiding this comment

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

I found #60 while answering an answers.ros.org question: https://answers.ros.org/question/380883/specify-log-level-on-ros2-node-in-launch-file/#380965. In this case, it seemed to confuse the person.

I see. I was wondering about the use case. If not having to write out --ros-args helps people, I'm onboard.

you mean like a LogLevel substitution?

Like a log_level argument that can be a substitution. But that's a separate PR.

Copy link
Member

Choose a reason for hiding this comment

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

Seems like we can handle things better if the user explicitly tells us when something is a ros argument, so +1 from me.

@christophebedard
Copy link
Member Author

CI --packages-above launch_ros test_launch_ros:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

Copy link
Contributor

@hidmic hidmic left a comment

Choose a reason for hiding this comment

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

LGTM

@christophebedard
Copy link
Member Author

@hidmic I can't merge PRs so I'll leave that to you!

@hidmic
Copy link
Contributor

hidmic commented Jun 29, 2021

Going in ! Thanks for the patience @christophebedard.

@hidmic hidmic merged commit f14b6a2 into ros2:master Jun 29, 2021
@hidmic
Copy link
Contributor

hidmic commented Jun 29, 2021

Argh, @christophebedard one thing we missed is adding support for this attribute in the Node.parse function. Would you mind?

@christophebedard christophebedard deleted the add-ros-arguments-option-to-node-action branch June 29, 2021 15:28
@christophebedard
Copy link
Member Author

Argh, @christophebedard one thing we missed is adding support for this attribute in the Node.parse function. Would you mind?

oh yeah I really didn't think about that! I'll create another PR as a follow-up.

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.

Add ros_arguments to Node action constructor
3 participants