From 9f7d243cdf7fc3b0a58c563916b84833e2b9d263 Mon Sep 17 00:00:00 2001 From: mhubii Date: Sat, 19 Oct 2024 11:45:18 +0100 Subject: [PATCH] moved configuration files to lbr_description for stand-alone urdf use --- .../lbr_demos_advanced_cpp/doc/lbr_demos_advanced_cpp.rst | 4 ++-- .../lbr_demos_advanced_py/doc/lbr_demos_advanced_py.rst | 4 ++-- lbr_demos/lbr_demos_cpp/doc/lbr_demos_cpp.rst | 8 ++++---- lbr_demos/lbr_demos_py/doc/lbr_demos_py.rst | 8 ++++---- lbr_demos/lbr_moveit/doc/lbr_moveit.rst | 4 ++-- lbr_demos/lbr_moveit_cpp/doc/lbr_moveit_cpp.rst | 2 +- .../ros2_control}/lbr_system_interface.xacro | 0 .../ros2_control}/lbr_system_parameters.yaml | 0 lbr_description/urdf/iiwa14/iiwa14.xacro | 2 +- lbr_description/urdf/iiwa14/iiwa14_description.xacro | 4 ++-- lbr_description/urdf/iiwa7/iiwa7.xacro | 2 +- lbr_description/urdf/iiwa7/iiwa7_description.xacro | 4 ++-- lbr_description/urdf/med14/med14.xacro | 2 +- lbr_description/urdf/med14/med14_description.xacro | 4 ++-- lbr_description/urdf/med7/med7.xacro | 2 +- lbr_description/urdf/med7/med7_description.xacro | 4 ++-- lbr_ros2_control/doc/lbr_ros2_control.rst | 4 ++-- lbr_ros2_control/src/system_interface.cpp | 6 ++++-- 18 files changed, 33 insertions(+), 31 deletions(-) rename {lbr_ros2_control/config => lbr_description/ros2_control}/lbr_system_interface.xacro (100%) rename {lbr_ros2_control/config => lbr_description/ros2_control}/lbr_system_parameters.yaml (100%) diff --git a/lbr_demos/lbr_demos_advanced_cpp/doc/lbr_demos_advanced_cpp.rst b/lbr_demos/lbr_demos_advanced_cpp/doc/lbr_demos_advanced_cpp.rst index eb08980a..323b231b 100644 --- a/lbr_demos/lbr_demos_advanced_cpp/doc/lbr_demos_advanced_cpp.rst +++ b/lbr_demos/lbr_demos_advanced_cpp/doc/lbr_demos_advanced_cpp.rst @@ -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 `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: @@ -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 `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: diff --git a/lbr_demos/lbr_demos_advanced_py/doc/lbr_demos_advanced_py.rst b/lbr_demos/lbr_demos_advanced_py/doc/lbr_demos_advanced_py.rst index 532ccd98..a33a6088 100644 --- a/lbr_demos/lbr_demos_advanced_py/doc/lbr_demos_advanced_py.rst +++ b/lbr_demos/lbr_demos_advanced_py/doc/lbr_demos_advanced_py.rst @@ -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 `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: @@ -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 `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: diff --git a/lbr_demos/lbr_demos_cpp/doc/lbr_demos_cpp.rst b/lbr_demos/lbr_demos_cpp/doc/lbr_demos_cpp.rst index edf2a975..5e29f63e 100644 --- a/lbr_demos/lbr_demos_cpp/doc/lbr_demos_cpp.rst +++ b/lbr_demos/lbr_demos_cpp/doc/lbr_demos_cpp.rst @@ -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 `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: @@ -72,7 +72,7 @@ Hardware ~~~~~~~~ #. Client side configurations: - #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: @@ -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 `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``torque`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``500`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: @@ -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 `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``wrench`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``500`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: diff --git a/lbr_demos/lbr_demos_py/doc/lbr_demos_py.rst b/lbr_demos/lbr_demos_py/doc/lbr_demos_py.rst index aca3edce..f71c7d2c 100644 --- a/lbr_demos/lbr_demos_py/doc/lbr_demos_py.rst +++ b/lbr_demos/lbr_demos_py/doc/lbr_demos_py.rst @@ -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 `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: @@ -72,7 +72,7 @@ Hardware ~~~~~~~~ #. Client side configurations: - #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: @@ -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 `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``torque`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``500`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: @@ -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 `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``wrench`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``500`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: diff --git a/lbr_demos/lbr_moveit/doc/lbr_moveit.rst b/lbr_demos/lbr_moveit/doc/lbr_moveit.rst index 42c17ea9..6848a6df 100644 --- a/lbr_demos/lbr_moveit/doc/lbr_moveit.rst +++ b/lbr_demos/lbr_moveit/doc/lbr_moveit.rst @@ -62,7 +62,7 @@ MoveIt Servo - Hardware ~~~~~~~~~~~~~~~~~~~~~~~ #. Client side configurations: - #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: @@ -122,7 +122,7 @@ MoveIt via RViz - Hardware ~~~~~~~~~~~~~~~~~~~~~~~~~~ #. Client side configurations: - #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: diff --git a/lbr_demos/lbr_moveit_cpp/doc/lbr_moveit_cpp.rst b/lbr_demos/lbr_moveit_cpp/doc/lbr_moveit_cpp.rst index 8442254b..089c9fb5 100644 --- a/lbr_demos/lbr_moveit_cpp/doc/lbr_moveit_cpp.rst +++ b/lbr_demos/lbr_moveit_cpp/doc/lbr_moveit_cpp.rst @@ -41,7 +41,7 @@ Hardware ~~~~~~~~ #. Client side configurations: - #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` + #. Configure the ``client_command_mode`` to ``position`` in `lbr_system_parameters.yaml `_:octicon:`link-external` #. Set the ``update_rate`` to ``100`` in `lbr_controllers.yaml `_:octicon:`link-external` #. Remote side configurations: diff --git a/lbr_ros2_control/config/lbr_system_interface.xacro b/lbr_description/ros2_control/lbr_system_interface.xacro similarity index 100% rename from lbr_ros2_control/config/lbr_system_interface.xacro rename to lbr_description/ros2_control/lbr_system_interface.xacro diff --git a/lbr_ros2_control/config/lbr_system_parameters.yaml b/lbr_description/ros2_control/lbr_system_parameters.yaml similarity index 100% rename from lbr_ros2_control/config/lbr_system_parameters.yaml rename to lbr_description/ros2_control/lbr_system_parameters.yaml diff --git a/lbr_description/urdf/iiwa14/iiwa14.xacro b/lbr_description/urdf/iiwa14/iiwa14.xacro index 7746f30b..b52b1578 100644 --- a/lbr_description/urdf/iiwa14/iiwa14.xacro +++ b/lbr_description/urdf/iiwa14/iiwa14.xacro @@ -10,7 +10,7 @@ + default="$(find lbr_description)/ros2_control/lbr_system_parameters.yaml" /> diff --git a/lbr_description/urdf/iiwa14/iiwa14_description.xacro b/lbr_description/urdf/iiwa14/iiwa14_description.xacro index 712fc099..e53bf380 100644 --- a/lbr_description/urdf/iiwa14/iiwa14_description.xacro +++ b/lbr_description/urdf/iiwa14/iiwa14_description.xacro @@ -3,11 +3,11 @@ + params="robot_name:=^|lbr mode:=^|mock system_parameters_path:=^|'$(find lbr_description)/ros2_control/lbr_system_parameters.yaml'"> - + + default="$(find lbr_description)/ros2_control/lbr_system_parameters.yaml" /> diff --git a/lbr_description/urdf/iiwa7/iiwa7_description.xacro b/lbr_description/urdf/iiwa7/iiwa7_description.xacro index d177bb80..28e99965 100644 --- a/lbr_description/urdf/iiwa7/iiwa7_description.xacro +++ b/lbr_description/urdf/iiwa7/iiwa7_description.xacro @@ -3,11 +3,11 @@ + params="robot_name:=^|lbr mode:=^|mock system_parameters_path:=^|'$(find lbr_description)/ros2_control/lbr_system_parameters.yaml'"> - + + default="$(find lbr_description)/ros2_control/lbr_system_parameters.yaml" /> diff --git a/lbr_description/urdf/med14/med14_description.xacro b/lbr_description/urdf/med14/med14_description.xacro index 0eac46fe..f36889d7 100644 --- a/lbr_description/urdf/med14/med14_description.xacro +++ b/lbr_description/urdf/med14/med14_description.xacro @@ -3,11 +3,11 @@ + params="robot_name:=^|lbr mode:=^|mock system_parameters_path:=^|'$(find lbr_description)/ros2_control/lbr_system_parameters.yaml'"> - + + default="$(find lbr_description)/ros2_control/lbr_system_parameters.yaml" /> diff --git a/lbr_description/urdf/med7/med7_description.xacro b/lbr_description/urdf/med7/med7_description.xacro index 58c885c4..00144acf 100644 --- a/lbr_description/urdf/med7/med7_description.xacro +++ b/lbr_description/urdf/med7/med7_description.xacro @@ -3,11 +3,11 @@ + params="robot_name:=^|lbr mode:=^|mock system_parameters_path:=^|'$(find lbr_description)/ros2_control/lbr_system_parameters.yaml'"> - + `` tag in the ``robot_description``: `lbr_system_interface.xacro `_:octicon:`link-external` -- FRI relevant parameters are forwarded to the ``lbr_ros2_control::SystemInterface`` plugin from `lbr_system_paramters.yaml `_:octicon:`link-external` +- The ``controller_manager::ControllerManager`` loads the correct plugin from the ```` tag in the ``robot_description``: `lbr_system_interface.xacro `_:octicon:`link-external` +- FRI relevant parameters are forwarded to the ``lbr_ros2_control::SystemInterface`` plugin from `lbr_system_paramters.yaml `_:octicon:`link-external` The ``lbr_ros2_control::SystemInterface`` is spun with the ``controller_manager`` node at a rate set by the ``update_rate`` parameter. The communication to the robot is run **asynchronously** at a rate set by the robot's sample time. diff --git a/lbr_ros2_control/src/system_interface.cpp b/lbr_ros2_control/src/system_interface.cpp index 30753044..b98d6d5b 100644 --- a/lbr_ros2_control/src/system_interface.cpp +++ b/lbr_ros2_control/src/system_interface.cpp @@ -11,7 +11,8 @@ SystemInterface::on_init(const hardware_interface::HardwareInfo &system_info) { return ret; } - // parameters_ from config/lbr_system_interface.xacro + // parameters_ from lbr_system_interface.xacro (located in + // lbr_description/ros2_control/lbr_system_interface.xacro) if (!parse_parameters_(system_info)) { return controller_interface::CallbackReturn::ERROR; } @@ -531,7 +532,8 @@ bool SystemInterface::verify_sensors_() { } bool SystemInterface::verify_auxiliary_sensor_() { - // check all interfaces are defined in config/lbr_system_interface.xacro + // check all interfaces are defined in lbr_system_interface.xacro (located in + // lbr_description/ros2_control/lbr_system_interface.xacro) const auto &auxiliary_sensor = info_.sensors[0]; if (auxiliary_sensor.name != HW_IF_AUXILIARY_PREFIX) { RCLCPP_ERROR_STREAM(rclcpp::get_logger(LOGGER_NAME),