Skip to content

controller_manager spawner chain launch failed #2517

@Demonmasterlqx

Description

@Demonmasterlqx

Describe the bug
When I fellow the instruction on this, i launch a list of controller with prefix "--activate-as-group". After this, I got an error

To Reproduce

  1. prepare urdf which use a chain controller and write a correct ros2_controll.yaml and launch file
  2. In launch file have this part:
spawner = Node(
    package='controller_manager',
    executable='spawner',
    name=controller,
    arguments=[
        controllers_list,
        '--param-file',
        controller_config_file,
        '--activate-as-group',
        ],
)
ld.add_action(spawner)
  1. launch it!

You can use my repo mcknum_test.launch.py

in "dev" branch!

Expected behavior

the launch fail and you will see:

[spawner-3] Traceback (most recent call last):
[spawner-3]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/node.py", line 175, in __init__
[spawner-3]     self.__node = _rclpy.Node(
[spawner-3] ValueError: invalid node name: node name must not contain characters other than alphanumerics or '_', at ./src/rcl/node.c:163
[spawner-3] 
[spawner-3] During handling of the above exception, another exception occurred:
[spawner-3] 
[spawner-3] Traceback (most recent call last):
[spawner-3]   File "/opt/ros/humble/lib/controller_manager/spawner", line 33, in <module>
[spawner-3]     sys.exit(load_entry_point('controller-manager==2.51.0', 'console_scripts', 'spawner')())
[spawner-3]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/controller_manager/spawner.py", line 174, in main
[spawner-3]     node = Node("spawner_" + controller_names[0])
[spawner-3]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/node.py", line 185, in __init__
[spawner-3]     validate_node_name(node_name)
[spawner-3]   File "/opt/ros/humble/local/lib/python3.10/dist-packages/rclpy/validate_node_name.py", line 34, in validate_node_name
[spawner-3]     raise InvalidNodeNameException(node_name, error_msg, invalid_index)
[spawner-3] rclpy.exceptions.InvalidNodeNameException: Invalid node name: node name must not contain characters other than alphanumerics or '_':
[spawner-3]   'spawner_wheel_fl_controller wheel_fr_controller wheel_rl_controller wheel_rr_controller mcknum_controller'
[spawner-3]                               ^

It seems that the spwaner only support launch one controller once which is not same as its param discription.
Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Ubuntu 22.04
  • Version Humble
  • Anything that may be unusual about your environment

Additional context
Add any other context about the problem here, especially include any modifications to ros2_control that relate to this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions