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

Character [-] is not valid as the first character in Graph Resource Name [--ros-args]. #407

Open
Yuchen966 opened this issue Jun 12, 2023 · 1 comment

Comments

@Yuchen966
Copy link

Bug report

I want to launch parameter_bridge in a customed launch.py file. The code is like this:

ros1_bridge = Node(
        package='ros1_bridge',
        executable='parameter_bridge',
        output='screen'
    )

But when I launch ros1_bridge, it automatically adds the --ros-args argument, which causes an InvalidNameException when the parameter file is not provided as an argument.

Steps to Reproduce:

  1. Create a launch file and use the Node class from launch_ros.actions to launch ros1_bridge without explicitly passing the --ros-args argument.
  2. Launch the launch file.

Expected Behavior:
The ros1_bridge should launch without any errors, bridging the specified topics between ROS 1 and ROS 2.

Actual Behavior:
The ros1_bridge fails to launch with the following error:

[parameter_bridge-1] terminate called after throwing an instance of 'ros::InvalidNameException'
[parameter_bridge-1]   what():  Character [-] is not valid as the first character in Graph Resource Name [--ros-args].  Valid characters are a-z, A-Z, / and in some cases ~.
[ERROR] [parameter_bridge-1]: process has died [pid XXXX, exit code -6, cmd 'ros2_ws/install/ros1_bridge/lib/ros1_bridge/parameter_bridge --ros-args']

Workaround:
Use the ExecuteProcess class from the launch.actions module instead of the Node class to launch ros1_bridge. Pass the command and arguments explicitly using the cmd parameter.

ros1_bridge = ExecuteProcess( # 
        cmd=['ros2', 'run', 'ros1_bridge', 'parameter_bridge'],
        output='screen',
    )

Although there is a workaround, I am still wondering if I could launch the node directly using launch_ros.actions.Node.

Thanks for any advice!

  • Operating System:
    • Ubuntu 20.04
  • Installation type:
    • from source
  • Version or commit hash:
    • foxy
@ipa-ych
Copy link

ipa-ych commented May 10, 2024

Hi Yuchen,
I am encountering the same issue with Ubuntu 22.04 & Humble why trying to launch parameter_bridge from Python launch file. Have you found another solution apart from using ExecuteProcess?

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

No branches or pull requests

2 participants