Rcl failing to parse global arguments

I am trying to launch the 5dof lss-arm in gazebo with a turtlebot, but I keep geeting this error:

[parameter_bridge-20] [ERROR] [1734089589.015959396] [rcl]: Failed to parse global arguments
[parameter_bridge-20] terminate called after throwing an instance of 'rclcpp::exceptions::RCLInvalidROSArgsError'
[parameter_bridge-20]   what():  failed to initialize rcl: Couldn't parse remap rule: '-r /world/src/lss_sim_moveit_example/worlds/warehouse.sdf/model/turtlebot/turtlebot4/link/base_link/sensor/cliff_front_right/scan:=_internal/cliff_front_right/scan'. Error: Expected lexeme type 19, got 22 at index 50, at ./src/rcl/lexer_lookahead.c:244, at ./src/rcl/arguments.c:371

I have also edited the sim_arm_control.launch.py file as the file below

#!/usr/bin/env -S ros2 launch
"""Example of planning with MoveIt2 within RViz2 and simulating motions using Gazebo ROS2 control plugin"""

from os import path
from typing import List

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, GroupAction
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, PythonExpression
from launch_ros.substitutions import FindPackageShare

from launch_ros.actions import Node, PushRosNamespace


def generate_launch_description() -> LaunchDescription:

    # Declare all launch arguments
    declared_arguments = generate_declared_arguments()

    # Get substitution for all arguments
    # namespace = LaunchConfiguration('namespace')
    world = LaunchConfiguration("world")
    dof = LaunchConfiguration("dof")
    rviz_config = LaunchConfiguration("rviz_config")
    use_sim_time = LaunchConfiguration("use_sim_time")
    ign_verbosity = LaunchConfiguration("ign_verbosity")
    log_level = LaunchConfiguration("log_level")
    prefix = LaunchConfiguration("prefix")

    pkg_turtlebot4_ignition_bringup = get_package_share_directory(
        'turtlebot4_ignition_bringup')
    robot_spawn_launch = PathJoinSubstitution(
            [pkg_turtlebot4_ignition_bringup, 'launch', 'turtlebot4_spawn.launch.py'])

    # List of included launch descriptions
    launch_descriptions = [
        # Launch Gazebo
        IncludeLaunchDescription(
            PythonLaunchDescriptionSource(
                PathJoinSubstitution(
                    [
                        FindPackageShare("ros_ign_gazebo"),
                        "launch",
                        "ign_gazebo.launch.py",
                    ]
                )
            ),
            launch_arguments=[("ign_args", [world, " -r -v ", ign_verbosity])],
        ),
        # Launch move_group of MoveIt 2
        IncludeLaunchDescription(
            PythonLaunchDescriptionSource(
                PathJoinSubstitution(
                    [
                        FindPackageShare("lss_arm_moveit"),
                        "launch",
                        "move_arm.launch.py",
                    ]
                )
            ),
            launch_arguments=[
                ("dof", dof),
                ("ros2_control_plugin", "sim"),
                ("collision", "true"),
                ("rviz_config", rviz_config),
                ("use_sim_time", use_sim_time),
                ("log_level", log_level),
            ],
        ),

        IncludeLaunchDescription(
            PythonLaunchDescriptionSource([robot_spawn_launch]),
            launch_arguments=[
                ('namespace', LaunchConfiguration('namespace')),
                ('rviz', LaunchConfiguration('rviz')),
                ('x', LaunchConfiguration('x')),
                ('y', LaunchConfiguration('y')),
                ('z', LaunchConfiguration('z')),
                ('yaw', LaunchConfiguration('yaw'))]
        )
    ]

    model = PythonExpression(["'lss_arm_", dof, "dof'"])
    # List of nodes to be launched
    nodes = [
        # ros_ign_gazebo_create
        # Node(
        #     package="ros_ign_gazebo",
        #     executable="create",
        #     output="log",
        #     arguments=["-file", model, "--ros-args", "--log-level", log_level],
        #     parameters=[{"use_sim_time": use_sim_time}],
        # ),
        # ros_gz_bridge (clock -> ROS 2)
        Node(
            package="ros_gz_bridge",
            executable="parameter_bridge",
            output="log",
            arguments=[
                "/clock@rosgraph_msgs/msg/Clock[ignition.msgs.Clock",
                "--ros-args",
                "--log-level",
                log_level,
            ],
            parameters=[{"use_sim_time": use_sim_time}],
        ),
    ]

    return LaunchDescription(declared_arguments + launch_descriptions + nodes)
    

def generate_declared_arguments() -> List[DeclareLaunchArgument]:
    """
    Generate list of all launch arguments that are declared for this launch script.
    """

    return [
        DeclareLaunchArgument('namespace', default_value='turtlebot',
                            description='Robot namespace'),

        DeclareLaunchArgument('x', default_value='1.0',
                            description='Robot namespace'),

        DeclareLaunchArgument('y', default_value='1.0',
                            description='Robot namespace'),

        DeclareLaunchArgument('z', default_value='0.0',
                            description='Robot namespace'),

        DeclareLaunchArgument('yaw', default_value='0.0',
                            description='Robot namespace'),

        DeclareLaunchArgument('rviz', default_value='false',
                            choices=['true', 'false'],
                            description='Start rviz.'),

        DeclareLaunchArgument(
            "prefix",
            default_value="",
            description="Prefix for all robot entities. If modified, then joint names in the configuration of controllers must also be updated.",
        ),

        # World and model for Gazebo
        DeclareLaunchArgument(
            "world",
            default_value="src/lss_sim_moveit_example/worlds/warehouse.sdf",
            description="Name or filepath of world to load.",
        ),
        # Gripper
        DeclareLaunchArgument(
            "dof",
            default_value='5',
            choices=['4','5'],
            description="Parameter to select gripper model."
        ),
        # Miscellaneous
        DeclareLaunchArgument(
            "rviz_config",
            default_value=path.join(
                get_package_share_directory("lss_arm_moveit"),
                "rviz",
                "moveit.rviz",
            ),
            description="Path to configuration for RViz2.",
        ),
        DeclareLaunchArgument(
            "use_sim_time",
            default_value="true",
            description="If true, use simulated clock.",
        ),
        DeclareLaunchArgument(
            "ign_verbosity",
            default_value="4",
            description="Verbosity level for  Gazebo (0~4).",
        ),
        DeclareLaunchArgument(
            "log_level",
            default_value="warn",
            description="The level of logging that is applied to all ROS 2 nodes launched by this script.",
        ),
        # DeclareLaunchArgument(
        #     "namespace",
        #     default_value="lss_arm",
        #     description="Robot namespace"
        # )
    ]

ROS distro: humble
Operating System: Pop os 22.04

Were you able to get the arm working on its own?

1 Like

When I launch the arm alone, I am able to plan simple motions with rviz, but I am still getting errors when I try to manipulate the gripper

[rviz2-5] [ERROR] [1726670563.515105415] [move_group_interface]: MoveGroupInterface::move() failed or timeout reached

But I have noted that after planning some motions the gripper starts to work

Our ROS dev team experimented with the 4DoF and the TurtleBot, but it has not been officially released since it is incomplete. I’ve copied a DEV here and hopefully she can provide some insight. ROS integrations can be complicated, so there’s only so much support we can provide.

2 Likes