Skip to content

Commit

Permalink
added system config to launch arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
mhubii committed Oct 20, 2024
1 parent 88bd630 commit 5e21032
Show file tree
Hide file tree
Showing 22 changed files with 92 additions and 86 deletions.
3 changes: 2 additions & 1 deletion lbr_bringup/launch/hardware.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def generate_launch_description() -> LaunchDescription:
# launch arguments
ld.add_action(LBRDescriptionMixin.arg_model())
ld.add_action(LBRDescriptionMixin.arg_robot_name())
ld.add_action(LBRDescriptionMixin.arg_port_id())
ld.add_action(LBRROS2ControlMixin.arg_sys_cfg_pkg())
ld.add_action(LBRROS2ControlMixin.arg_sys_cfg())
ld.add_action(LBRROS2ControlMixin.arg_ctrl_cfg_pkg())
ld.add_action(LBRROS2ControlMixin.arg_ctrl_cfg())
ld.add_action(LBRROS2ControlMixin.arg_ctrl())
Expand Down
25 changes: 7 additions & 18 deletions lbr_bringup/lbr_bringup/description.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ def param_robot_description(
robot_name: Optional[Union[LaunchConfiguration, str]] = LaunchConfiguration(
"robot_name", default="lbr"
),
port_id: Optional[Union[LaunchConfiguration, str]] = LaunchConfiguration(
"port_id", default="30200"
),
mode: Optional[Union[LaunchConfiguration, bool]] = LaunchConfiguration(
"mode", default="mock"
),
system_config_path: Optional[
Union[LaunchConfiguration, str]
] = PathJoinSubstitution(
[LaunchConfiguration("sys_cfg_pkg"), LaunchConfiguration("sys_cfg")]
),
) -> Dict[str, str]:
robot_description = {
"robot_description": Command(
Expand All @@ -43,10 +45,10 @@ def param_robot_description(
".xacro",
" robot_name:=",
robot_name,
" port_id:=",
port_id,
" mode:=",
mode,
"system_config_path:=",
system_config_path,
]
)
}
Expand All @@ -69,15 +71,6 @@ def arg_robot_name(default_value: str = "lbr") -> DeclareLaunchArgument:
description="The robot's name.",
)

@staticmethod
def arg_port_id(default_value: str = "30200") -> DeclareLaunchArgument:
return DeclareLaunchArgument(
name="port_id",
default_value=default_value,
description="Port ID of the FRI communication. Valid in range [30200, 30209].\n"
"\tUsefull in multi-robot setups.",
)

@staticmethod
def arg_mode(default_value: str = "mock") -> DeclareLaunchArgument:
return DeclareLaunchArgument(
Expand All @@ -95,10 +88,6 @@ def arg_mode(default_value: str = "mock") -> DeclareLaunchArgument:
def param_robot_name() -> Dict[str, LaunchConfiguration]:
return {"robot_name": LaunchConfiguration("robot_name", default="lbr")}

@staticmethod
def param_port_id() -> Dict[str, LaunchConfiguration]:
return {"port_id": LaunchConfiguration("port_id", default="30200")}

@staticmethod
def param_mode() -> Dict[str, LaunchConfiguration]:
return {"mode": LaunchConfiguration("mode", default="mock")}
Expand Down
16 changes: 16 additions & 0 deletions lbr_bringup/lbr_bringup/ros2_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@ def arg_ctrl() -> DeclareLaunchArgument:
],
)

@staticmethod
def arg_sys_cfg_pkg() -> DeclareLaunchArgument:
return DeclareLaunchArgument(
name="sys_cfg_pkg",
default_value="lbr_description",
description="Package containing the lbr_system_config.yaml file for FRI configurations.",
)

@staticmethod
def arg_sys_cfg() -> DeclareLaunchArgument:
return DeclareLaunchArgument(
name="sys_cfg",
default_value="ros2_control/lbr_system_config.yaml",
description="The relative path from sys_cfg_pkg to the lbr_system_config.yaml file.",
)

@staticmethod
def arg_use_sim_time() -> DeclareLaunchArgument:
return DeclareLaunchArgument(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This demo implements a simple admittance controller.

#. Client side configurations:

#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down Expand Up @@ -55,7 +55,7 @@ kinematics to move the robot's end-effector along the z-axis in Cartesian space.

#. Client side configurations:

#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down
4 changes: 2 additions & 2 deletions lbr_demos/lbr_demos_advanced_py/doc/lbr_demos_advanced_py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This demo implements a simple admittance controller.

#. Client side configurations:

#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down Expand Up @@ -54,7 +54,7 @@ This demo implements an admittance controller with a remote center of motion (RC

#. Client side configurations:

#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down
8 changes: 4 additions & 4 deletions lbr_demos/lbr_demos_cpp/doc/lbr_demos_cpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This demo uses the :ref:`lbr_fri_ros2::LBRJointPositionCommandController` and ov

#. Client side configurations:

#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down Expand Up @@ -72,7 +72,7 @@ Hardware
~~~~~~~~
#. Client side configurations:

#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand All @@ -96,7 +96,7 @@ This demo uses the :ref:`lbr_fri_ros2::LBRTorqueCommandController` and overlays

#. Client side configurations:

#. Configure the ``client_command_mode`` to ``torque`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``torque`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``500`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down Expand Up @@ -134,7 +134,7 @@ This demo uses the :ref:`lbr_fri_ros2::LBRWrenchCommandController` and overlays

#. Client side configurations:

#. Configure the ``client_command_mode`` to ``wrench`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``wrench`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``500`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down
8 changes: 4 additions & 4 deletions lbr_demos/lbr_demos_py/doc/lbr_demos_py.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This demo uses the :ref:`lbr_fri_ros2::LBRJointPositionCommandController` and ov

#. Client side configurations:

#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down Expand Up @@ -72,7 +72,7 @@ Hardware
~~~~~~~~
#. Client side configurations:

#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand All @@ -96,7 +96,7 @@ This demo uses the :ref:`lbr_fri_ros2::LBRTorqueCommandController` and overlays

#. Client side configurations:

#. Configure the ``client_command_mode`` to ``torque`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``torque`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``500`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down Expand Up @@ -134,7 +134,7 @@ This demo uses the :ref:`lbr_fri_ros2::LBRWrenchCommandController` and overlays

#. Client side configurations:

#. Configure the ``client_command_mode`` to ``wrench`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``wrench`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``500`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down
4 changes: 2 additions & 2 deletions lbr_demos/lbr_moveit/doc/lbr_moveit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ MoveIt Servo - Hardware
~~~~~~~~~~~~~~~~~~~~~~~
#. Client side configurations:

#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down Expand Up @@ -122,7 +122,7 @@ MoveIt via RViz - Hardware
~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Client side configurations:

#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down
2 changes: 1 addition & 1 deletion lbr_demos/lbr_moveit_cpp/doc/lbr_moveit_cpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Hardware
~~~~~~~~
#. Client side configurations:

#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_parameters.yaml>`_:octicon:`link-external`
#. Configure the ``client_command_mode`` to ``position`` in `lbr_system_config.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_description/ros2_control/lbr_system_config.yaml>`_:octicon:`link-external`
#. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/rolling/lbr_ros2_control/config/lbr_controllers.yaml>`_:octicon:`link-external`

#. Remote side configurations:
Expand Down
Loading

0 comments on commit 5e21032

Please sign in to comment.