|
| 1 | +lbr_dual_arm_description |
| 2 | +======================== |
| 3 | +This demo gives a walk through on using the ``lbr_description`` to generate a custom robot description. In this case, we will be investigating a dual-arm setup. |
| 4 | + |
| 5 | +.. contents:: Table of Contents |
| 6 | + :depth: 2 |
| 7 | + :local: |
| 8 | + :backlinks: none |
| 9 | + |
| 10 | +Creating the Package |
| 11 | +-------------------- |
| 12 | +#. Inside your workspace, create a package: |
| 13 | + |
| 14 | +.. code-block:: bash |
| 15 | +
|
| 16 | + ros2 pkg create lbr_dual_arm_description \ |
| 17 | + --build-type ament_cmake \ |
| 18 | + --license Apache-2.0 \ |
| 19 | + --maintainer-name mhubii \ |
| 20 | + --maintainer-email "m.huber_1994@hotmail.de" \ |
| 21 | + --description "A dual LBR description package using lbr_description." \ |
| 22 | + --dependencies lbr_description |
| 23 | +
|
| 24 | +#. Remove unused folders and create a Universal Robot Description File (URDF) folder: |
| 25 | + |
| 26 | +.. code-block:: bash |
| 27 | +
|
| 28 | + cd lbr_dual_arm_description && \ |
| 29 | + rm -r lbr_dual_arm_description/include && \ |
| 30 | + rm -r lbr_dual_arm_description/src && \ |
| 31 | + mkdir urdf |
| 32 | +
|
| 33 | +Creating the Dual-arm Robot Description |
| 34 | +--------------------------------------- |
| 35 | +#. Create a dual-arm robot description: |
| 36 | + |
| 37 | +.. code-block:: bash |
| 38 | +
|
| 39 | + touch urdf/lbr_dual_arm.xacro |
| 40 | +
|
| 41 | +#. Fill it with the following contents (note that `xacro <https://github.com/ros/xacro/tree/ros2>`_:octicon:`link-external` is used): |
| 42 | + |
| 43 | +.. code-block:: XML |
| 44 | +
|
| 45 | + <?xml version="1.0"?> |
| 46 | +
|
| 47 | + <robot name="lbr_dual_arm" xmlns:xacro="http://www.ros.org/wiki/xacro"> |
| 48 | + <!-- include the lbr iiwa macro --> |
| 49 | + <xacro:include filename="$(find lbr_description)/urdf/iiwa7/iiwa7_description.xacro" /> |
| 50 | +
|
| 51 | + <!-- add an arguent to allow for mock / hardware / gazebo --> |
| 52 | + <xacro:arg name="mode" default="mock" /> |
| 53 | +
|
| 54 | + <!-- add a base / floating link --> |
| 55 | + <link name="base_link" /> |
| 56 | +
|
| 57 | + <!-- add robot 1 via macro, note that different lbr_one_system_config.yaml are used (to |
| 58 | + configure port id) --> |
| 59 | + <xacro:iiwa7 |
| 60 | + robot_name="lbr_one" |
| 61 | + mode="$(arg mode)" |
| 62 | + system_config_path="$(find lbr_dual_arm_description)/ros2_control/lbr_one_system_config.yaml" /> |
| 63 | +
|
| 64 | + <!-- add robot 2 via macro --> |
| 65 | + <xacro:iiwa7 |
| 66 | + robot_name="lbr_two" |
| 67 | + mode="$(arg mode)" |
| 68 | + system_config_path="$(find lbr_dual_arm_description)/ros2_control/lbr_two_system_config.yaml" /> |
| 69 | + </robot> |
| 70 | +
|
| 71 | +#. Create the ROS 2 Control configuration files: |
| 72 | + |
| 73 | + #. Create a configurations file for the controller manager and respective controllers: |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + #. FRI system configurations (only necessary when hardware is used): |
| 78 | + |
| 79 | + .. code-block:: bash |
| 80 | +
|
| 81 | + cp `ros2 pkg prefix lbr_description`/share/lbr_description/ros2_control/lbr_system_config.yaml ros2_control/lbr_one_system_config.yaml && \ |
| 82 | + cp `ros2 pkg prefix lbr_description`/share/lbr_description/ros2_control/lbr_system_config.yaml ros2_control/lbr_two_system_config.yaml |
| 83 | +
|
| 84 | +#. Open ``lbr_two_system_config.yaml``: |
| 85 | + |
| 86 | + #. Change ``port_id`` to ``30201`` (or as desired, but different from ``lbr_one_system_config.yaml``) |
| 87 | + #. Update ``estimated_ft_sensor`` frames: |
| 88 | + |
| 89 | + .. code-black:: yaml |
| 90 | + |
| 91 | + chain_root: lbr_one_link_0 # and lbr_two_link_0 respectively |
| 92 | + chain_tip: lbr_one_link_ee # and lbr_two_link_0 respectively |
| 93 | + |
| 94 | +#. Add the following to the ``CMakeLists.txt``: |
| 95 | + |
| 96 | + .. code-block:: cmake |
| 97 | +
|
| 98 | + install(DIRECTORY ros2_control urdf |
| 99 | + DESTINATION share/${PROJECT_NAME} |
| 100 | + ) |
| 101 | +
|
| 102 | +
|
| 103 | +
|
| 104 | +.. #. Build the package in your workspace: |
| 105 | +
|
| 106 | +.. .. code-block:: bash |
| 107 | +
|
| 108 | +.. colcon build --packages-select lbr_dual_arm_description --symlink-install |
0 commit comments