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

[ros2component] Parameters and remap rules cause log warning #336

Closed
jacobperron opened this issue Sep 19, 2019 · 3 comments · Fixed by #433
Closed

[ros2component] Parameters and remap rules cause log warning #336

jacobperron opened this issue Sep 19, 2019 · 3 comments · Fixed by #433
Assignees
Labels
bug Something isn't working

Comments

@jacobperron
Copy link
Member

Bug report

Required Info:

  • Operating System:
    • Ubuntu 18.04
  • Installation type:
    • source
  • Version or commit hash:
  • DDS implementation:
    • N/A
  • Client library (if applicable):
    • rclpy

Steps to reproduce issue

Load a standalone component and pass it a parameter or remap rule:

ros2 component standalone demo_nodes_cpp demo_nodes_cpp::Talker -p foo:=bar
ros2 component standalone demo_nodes_cpp demo_nodes_cpp::Talker -r chatter:=bar

Expected behavior

Parameter and remap options for ros2 component standalone work as documented without side-effects.

Actual behavior

The flags appear to work (ie. successfully set a parameter or remap a topic), but anything matching the pattern "X:=Y" is picked up additionally as a remap and we see a warning, e.g.:

[WARN] [rcl]: Found remap rule 'foo:=bar'. This syntax is deprecated. Use '--ros-args --remap foo:=bar' instead.

If we try to set a parameter with -p foo:=bar it will also remap any topic named foo to bar as well.

@jacobperron jacobperron added the bug Something isn't working label Sep 19, 2019
@sloretz
Copy link
Contributor

sloretz commented Sep 23, 2019

Does it still get interpreted as a remap rule when --ros-args is given?

ros2 component standalone demo_nodes_cpp demo_nodes_cpp::Talker --ros-args -p foo:=bar

@jacobperron
Copy link
Member Author

@sloretz Not sure. ros2cli won't let us get that far:

ros2: error: unrecognized arguments: --ros-args

I'm not sure if we want to allow --ros-args to be passed alonside the CLI tools, but if so we should probably ticket it.

@clydemcqueen
Copy link

clydemcqueen commented Dec 19, 2019

Also a bug for extra arguments, e.g.,

ros2 component load /ComponentManager opencv_cam opencv_cam::ImageSubscriberNode -e use_intra_process_comms:=true

jacobperron added a commit that referenced this issue 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 pass arguments to rclpy.init from any of the CLI
tools, but it leaves the opportunity to do so by setting the parser argument
'argv'.

For example, we could later take the remaining arguments and pass them along
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>
jacobperron added a commit that referenced this issue 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:

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

Fixes #336.

Signed-off-by: Jacob Perron <jacob@openrobotics.org>
jacobperron added a commit that referenced this issue Jan 28, 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>
sloretz pushed a commit that referenced this issue 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 issue 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
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants