ICube-Robotics / iiwa_ros2

ROS2 stack for KUKA iiwa collaborative robots
Apache License 2.0
83 stars 32 forks source link

Multiarm setup #40

Closed Carlz182 closed 1 month ago

Carlz182 commented 10 months ago

I am trying to connect two iiwa arms to my host pc. For that, I created a launch file that launches two nodes from the iiwa_bringup package. However, I could not load the controllers successfully using the namespace functionality. In the Readme it says that I have to change the controller config files. I creates a separate file for each robot but I am not sure where to append the namespaces "iiwa_right" and "iiwa_left". Thank you in advance for any hint on how to solve this.

Concretely, I am receiving error messages like

[ros2_control_node-1] [ERROR] [1698329512.720356644] [iiwa_right.controller_manager]: The 'type' param was not defined for 'ets_state_broadcaster'. [spawner-3] [FATAL] [1698329512.745321053] [spawner_ets_state_broadcaster]: Failed loading controller ets_state_broadcaster

This is my dualarm launch file with the parameters:

def generate_launch_description():
    # Declare arguments
    declared_arguments = []

    # Initialize Arguments
    prefix_right = "iiwa_right/"
    prefix_left = "iiwa_left/"
    start_rviz = "false"
    use_sim = "false"
    use_fake_hardware = "false"
    use_planning = "false"
    robot_ip_right = "172.31.1.147"
    robot_ip_left = "172.31.1.148"
    base_frame_file_right = "base_frame_right.yaml"
    base_frame_file_left = "base_frame_left.yaml"
    namespace_right = "iiwa_right/"
    namespace_left = "iiwa_left/"
    controllers_file_right = "iiwa_controllers.yaml"
    controllers_file_left = "iiwa_controllers_left.yaml"

    iiwa_bringup_launch_right = IncludeLaunchDescription(
        PythonLaunchDescriptionSource([
            FindPackageShare('iiwa_bringup'),
            '/launch',
            '/iiwa.launch.py'
        ]),
        launch_arguments={
            'prefix': prefix_right,
            'start_rviz': start_rviz,
            'use_fake_hardware': use_fake_hardware,
            'use_planning': use_planning,
            'robot_ip': robot_ip_right,
            'base_frame_file': base_frame_file_right,
            'namespace': namespace_right,
            'use_sim': use_sim, 
            'controllers_file': controllers_file_right,
        }.items(),
    )

    iiwa_bringup_launch_left = IncludeLaunchDescription(
        PythonLaunchDescriptionSource([
            FindPackageShare('iiwa_bringup'),
            '/launch',
            '/iiwa.launch.py'
        ]),
        launch_arguments={
            'prefix': prefix_left,
            'start_rviz': start_rviz,
            'use_fake_hardware': use_fake_hardware,
            'use_planning': use_planning,
            'robot_ip': robot_ip_left,
            'base_frame_file': base_frame_file_left,
            'namespace': namespace_left,
            'use_sim': use_sim,
            'controllers_file': controllers_file_left,
        }.items(),
    )

    nodes = [
        iiwa_bringup_launch_right,
        iiwa_bringup_launch_left
    ]

    return LaunchDescription(declared_arguments + nodes)
mhubii commented 10 months ago

This package supports multi-robot setups: https://github.com/lbr-stack/lbr_fri_ros2_stack

There is some documentation on how to do that here: https://github.com/lbr-stack/lbr_fri_ros2_stack/issues/131, some of which might be applicable to this package.

Note that I am the main author.