diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 7d0a411..5367a27 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -8,6 +8,7 @@ repos:
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
+ args: ['--unsafe']
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace
diff --git a/my_robot_cell/doc/assemble_urdf.rst b/my_robot_cell/doc/assemble_urdf.rst
index 1ea58e0..6ead4fc 100644
--- a/my_robot_cell/doc/assemble_urdf.rst
+++ b/my_robot_cell/doc/assemble_urdf.rst
@@ -57,7 +57,7 @@ The workcell macro is defined in the following manner:
.. literalinclude:: ../my_robot_cell_description/urdf/my_robot_cell_macro.xacro
:language: xml
:linenos:
- :caption: my_robot_cell_description/urdf/my_robot_cell_macro.urdf.xacro
+ :caption: my_robot_cell_description/urdf/my_robot_cell_macro.xacro
This macro provides an example of what a custom workcell could resemble. Your workspace will likely
vary from this one. Please feel free to modify this portion of the URDF to match your own setup. In
@@ -72,7 +72,7 @@ macro. In this example, we chose to create a link named **robot_mount**.
:start-at:
:end-at:
:linenos:
- :caption: my_robot_cell_description/urdf/my_robot_cell.urdf.xacro
+ :caption: my_robot_cell_description/urdf/my_robot_cell.xacro
After that we are finally able to actually **create the robot arm** by calling the macro.
@@ -81,7 +81,7 @@ After that we are finally able to actually **create the robot arm** by calling t
:start-at:
:linenos:
- :caption: my_robot_cell_description/urdf/my_robot_cell.urdf.xacro
+ :caption: my_robot_cell_description/urdf/my_robot_cell.xacro
Note that the **origin** argument is transmitted in a different manner than the other arguments.
diff --git a/my_robot_cell/doc/build_moveit_config.rst b/my_robot_cell/doc/build_moveit_config.rst
index 13a336d..9eebc17 100644
--- a/my_robot_cell/doc/build_moveit_config.rst
+++ b/my_robot_cell/doc/build_moveit_config.rst
@@ -129,7 +129,7 @@ First, we need to start a robot, simulated or real. If you start a real robot, m
.. code-block:: bash
# You can switch to real hardware if you prefer
- ros2 launch my_robot_cell_control start_robot.launch.py use_mock_hardware:=true
+ ros2 launch my_robot_cell_control start_robot.launch.py use_fake_hardware:=true
Second, we can start the move_group node by running the launch file the setup assistant created for us:
diff --git a/my_robot_cell/doc/start_ur_driver.rst b/my_robot_cell/doc/start_ur_driver.rst
index 1e24ede..f8294c2 100644
--- a/my_robot_cell/doc/start_ur_driver.rst
+++ b/my_robot_cell/doc/start_ur_driver.rst
@@ -23,8 +23,8 @@ This URDF is very similar to the one we have already assembled. We simply need t
.. literalinclude:: ../my_robot_cell_control/urdf/my_robot_cell_controlled.urdf.xacro
:language: xml
- :start-at:
- :end-at:
+ :start-at:
+ :end-at:
:caption: my_robot_cell_control/urdf/my_robot_cell_controlled.urdf.xacro
@@ -33,7 +33,7 @@ define the necessary arguments that need to be passed to the macro,
.. literalinclude:: ../my_robot_cell_control/urdf/my_robot_cell_controlled.urdf.xacro
:language: xml
:start-at:
- :end-at:
+ :end-at:
:caption: my_robot_cell_control/urdf/my_robot_cell_controlled.urdf.xacro
@@ -57,39 +57,12 @@ For now, we just copy the default one for the ur20.
cp $(ros2 pkg prefix ur_description)/share/ur_description/config/ur20/default_kinematics.yaml \
my_robot_cell_control/config/my_robot_calibration.yaml
-
-Create robot_state_publisher launchfile
----------------------------------------
-
-To use the custom controlled description, we need to generate a launchfile loading that description
-(Since it contains less / potentially different) arguments than the "default" one. In that
-launchfile we need to start a ``robot_state_publisher`` (RSP) node that will get the description as a
-parameter and redistribute it via the ``robot_description`` topic:
-
-.. literalinclude:: ../my_robot_cell_control/launch/rsp.launch.py
- :language: py
- :start-after: # Author: Felix Exner
- :linenos:
- :caption: my_robot_cell_control/launch/rsp.launch.py
-
-With this we could start our workcell using
-
-.. code-block:: bash
-
- ros2 launch ur_robot_driver ur_control.launch.py \
- description_launchfile:=$(ros2 pkg prefix my_robot_cell_control)/share/my_robot_cell_control/launch/rsp.launch.py \
- use_mock_hardware:=true \
- robot_ip:=123 \
- ur_type:=ur20 \
- rviz_config_file:=$(ros2 pkg prefix my_robot_cell_description)/share/my_robot_cell_description/rviz/urdf.rviz \
- tf_prefix:=ur20_
-
Create start_robot launchfile
-----------------------------
-Since the command above is obviously not very convenient to start our robot, we wrap that into another
-launchfile that includes the ``ur_control.launch.py`` launchfile with the correct description
-launchfile and prefix:
+To launch a controlled robot with our custom description, we need to generate a launchfile. We
+include the ``ur_control.launch.py`` file from the driver and set its parameters to match our
+custom workcell.
.. literalinclude:: ../my_robot_cell_control/launch/start_robot.launch.py
:language: py
@@ -100,7 +73,7 @@ With that we can start the robot using
.. code-block:: bash
- ros2 launch my_robot_cell_control start_robot.launch.py use_mock_hardware:=true
+ ros2 launch my_robot_cell_control start_robot.launch.py use_fake_hardware:=true
Testing everything
------------------
@@ -121,7 +94,7 @@ We can start the system in a mocked simulation
.. code-block:: bash
#start the driver with mocked hardware
- ros2 launch my_robot_cell_control start_robot.launch.py use_mock_hardware:=true
+ ros2 launch my_robot_cell_control start_robot.launch.py use_fake_hardware:=true
Or to use it with a real robot:
diff --git a/my_robot_cell/my_robot_cell_control/CMakeLists.txt b/my_robot_cell/my_robot_cell_control/CMakeLists.txt
index 05ab80e..e218b1c 100644
--- a/my_robot_cell/my_robot_cell_control/CMakeLists.txt
+++ b/my_robot_cell/my_robot_cell_control/CMakeLists.txt
@@ -4,7 +4,7 @@ project(my_robot_cell_control)
find_package(ament_cmake REQUIRED)
install(
- DIRECTORY launch config urdf
+ DIRECTORY launch config urdf rviz
DESTINATION share/${PROJECT_NAME}
)
diff --git a/my_robot_cell/my_robot_cell_control/config/ros2_controllers.yaml b/my_robot_cell/my_robot_cell_control/config/ros2_controllers.yaml
deleted file mode 100644
index edd5e3f..0000000
--- a/my_robot_cell/my_robot_cell_control/config/ros2_controllers.yaml
+++ /dev/null
@@ -1,94 +0,0 @@
-controller_manager:
- ros__parameters:
- joint_state_broadcaster:
- type: joint_state_broadcaster/JointStateBroadcaster
-
- io_and_status_controller:
- type: ur_controllers/GPIOController
-
- speed_scaling_state_broadcaster:
- type: ur_controllers/SpeedScalingStateBroadcaster
-
- force_torque_sensor_broadcaster:
- type: force_torque_sensor_broadcaster/ForceTorqueSensorBroadcaster
-
- scaled_joint_trajectory_controller:
- type: ur_controllers/ScaledJointTrajectoryController
-
- forward_velocity_controller:
- type: velocity_controllers/JointGroupVelocityController
-
- forward_position_controller:
- type: position_controllers/JointGroupPositionController
-
-
-speed_scaling_state_broadcaster:
- ros__parameters:
- state_publish_rate: 100.0
- tf_prefix: "ur20_"
-
-io_and_status_controller:
- ros__parameters:
- tf_prefix: "ur20_"
-
-force_torque_sensor_broadcaster:
- ros__parameters:
- sensor_name: ur20_tcp_fts_sensor
- state_interface_names:
- - force.x
- - force.y
- - force.z
- - torque.x
- - torque.y
- - torque.z
- frame_id: ur20_tool0
- topic_name: ft_data
-
-scaled_joint_trajectory_controller:
- ros__parameters:
- joints:
- - ur20_shoulder_pan_joint
- - ur20_shoulder_lift_joint
- - ur20_elbow_joint
- - ur20_wrist_1_joint
- - ur20_wrist_2_joint
- - ur20_wrist_3_joint
- command_interfaces:
- - position
- state_interfaces:
- - position
- - velocity
- state_publish_rate: 100.0
- action_monitor_rate: 20.0
- allow_partial_joints_goal: false
- constraints:
- stopped_velocity_tolerance: 0.2
- goal_time: 0.0
- ur20_shoulder_pan_joint: { trajectory: 0.2, goal: 0.1 }
- ur20_shoulder_lift_joint: { trajectory: 0.2, goal: 0.1 }
- ur20_elbow_joint: { trajectory: 0.2, goal: 0.1 }
- ur20_wrist_1_joint: { trajectory: 0.2, goal: 0.1 }
- ur20_wrist_2_joint: { trajectory: 0.2, goal: 0.1 }
- ur20_wrist_3_joint: { trajectory: 0.2, goal: 0.1 }
- speed_scaling_interface_name: ur20_speed_scaling/speed_scaling_factor
-
-forward_velocity_controller:
- ros__parameters:
- joints:
- - ur20_shoulder_pan_joint
- - ur20_shoulder_lift_joint
- - ur20_elbow_joint
- - ur20_wrist_1_joint
- - ur20_wrist_2_joint
- - ur20_wrist_3_joint
- interface_name: velocity
-
-forward_position_controller:
- ros__parameters:
- joints:
- - ur20_shoulder_pan_joint
- - ur20_shoulder_lift_joint
- - ur20_elbow_joint
- - ur20_wrist_1_joint
- - ur20_wrist_2_joint
- - ur20_wrist_3_joint
diff --git a/my_robot_cell/my_robot_cell_control/config/update_rate.yaml b/my_robot_cell/my_robot_cell_control/config/update_rate.yaml
deleted file mode 100644
index 66ef3d7..0000000
--- a/my_robot_cell/my_robot_cell_control/config/update_rate.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-controller_manager:
- ros__parameters:
- update_rate: 500 # Hz
diff --git a/my_robot_cell/my_robot_cell_control/config/ur20/default_kinematics.yaml b/my_robot_cell/my_robot_cell_control/config/ur20/default_kinematics.yaml
new file mode 100644
index 0000000..db20fd9
--- /dev/null
+++ b/my_robot_cell/my_robot_cell_control/config/ur20/default_kinematics.yaml
@@ -0,0 +1,44 @@
+kinematics:
+ shoulder:
+ x: 0
+ y: 0
+ z: 0.23630000000000001
+ roll: -0
+ pitch: 0
+ yaw: -0
+ upper_arm:
+ x: 0
+ y: 0
+ z: 0
+ roll: 1.570796327
+ pitch: 0
+ yaw: -0
+ forearm:
+ x: -0.86199999999999999
+ y: 0
+ z: 0
+ roll: -0
+ pitch: 0
+ yaw: -0
+ wrist_1:
+ x: -0.72870000000000001
+ y: 0
+ z: 0.20100000000000001
+ roll: -0
+ pitch: 0
+ yaw: -0
+ wrist_2:
+ x: 0
+ y: -0.1593
+ z: -3.2672976162492252e-11
+ roll: 1.570796327
+ pitch: 0
+ yaw: -0
+ wrist_3:
+ x: 0
+ y: 0.15429999999999999
+ z: -3.1647459019915597e-11
+ roll: 1.5707963265897931
+ pitch: 3.1415926535897931
+ yaw: 3.1415926535897931
+ hash: calib_4890363623803256388
diff --git a/my_robot_cell/my_robot_cell_control/config/ur20/joint_limits.yaml b/my_robot_cell/my_robot_cell_control/config/ur20/joint_limits.yaml
new file mode 100644
index 0000000..0d4b0fb
--- /dev/null
+++ b/my_robot_cell/my_robot_cell_control/config/ur20/joint_limits.yaml
@@ -0,0 +1,77 @@
+# Joints limits
+#
+# Sources:
+#
+# - Universal Robots e-Series, User Manual, UR20, Version 5.14
+# https://s3-eu-west-1.amazonaws.com/ur-support-site/203281/706-276-00_UR20_User_Manual_en_Global.pdf
+joint_limits:
+ shoulder_pan_joint:
+ # acceleration limits are not publicly available
+ has_acceleration_limits: false
+ has_effort_limits: true
+ has_position_limits: true
+ has_velocity_limits: true
+ max_effort: 738.0
+ max_position: !degrees 360.0
+ max_velocity: !degrees 120.0
+ min_position: !degrees -360.0
+ shoulder_lift_joint:
+ # acceleration limits are not publicly available
+ has_acceleration_limits: false
+ has_effort_limits: true
+ has_position_limits: true
+ has_velocity_limits: true
+ max_effort: 738.0
+ max_position: !degrees 360.0
+ max_velocity: !degrees 120.0
+ min_position: !degrees -360.0
+ elbow_joint:
+ # acceleration limits are not publicly available
+ has_acceleration_limits: false
+ has_effort_limits: true
+ has_position_limits: true
+ has_velocity_limits: true
+ max_effort: 433.0
+ # we artificially limit this joint to half its actual joint position limit
+ # to avoid (MoveIt/OMPL) planning problems, as due to the physical
+ # construction of the robot, it's impossible to rotate the 'elbow_joint'
+ # over more than approx +- 1 pi (the shoulder lift joint gets in the way).
+ #
+ # This leads to planning problems as the search space will be divided into
+ # two sections, with no connections from one to the other.
+ #
+ # Refer to https://github.com/ros-industrial/universal_robot/issues/265 for
+ # more information.
+ max_position: !degrees 180.0
+ max_velocity: !degrees 150.0
+ min_position: !degrees -180.0
+ wrist_1_joint:
+ # acceleration limits are not publicly available
+ has_acceleration_limits: false
+ has_effort_limits: true
+ has_position_limits: true
+ has_velocity_limits: true
+ max_effort: 107.0
+ max_position: !degrees 360.0
+ max_velocity: !degrees 210.0
+ min_position: !degrees -360.0
+ wrist_2_joint:
+ # acceleration limits are not publicly available
+ has_acceleration_limits: false
+ has_effort_limits: true
+ has_position_limits: true
+ has_velocity_limits: true
+ max_effort: 107.0
+ max_position: !degrees 360.0
+ max_velocity: !degrees 210.0
+ min_position: !degrees -360.0
+ wrist_3_joint:
+ # acceleration limits are not publicly available
+ has_acceleration_limits: false
+ has_effort_limits: true
+ has_position_limits: true
+ has_velocity_limits: true
+ max_effort: 107.0
+ max_position: !degrees 360.0
+ max_velocity: !degrees 210.0
+ min_position: !degrees -360.0
diff --git a/my_robot_cell/my_robot_cell_control/config/ur20/physical_parameters.yaml b/my_robot_cell/my_robot_cell_control/config/ur20/physical_parameters.yaml
new file mode 100644
index 0000000..71e7314
--- /dev/null
+++ b/my_robot_cell/my_robot_cell_control/config/ur20/physical_parameters.yaml
@@ -0,0 +1,122 @@
+# Physical parameters
+
+offsets:
+ shoulder_offset: 0.260 # measured from model
+ elbow_offset: 0.043 # measured from model
+
+inertia_parameters:
+ # taken from https://www.universal-robots.com/articles/ur/application-installation/dh-parameters-for-calculations-of-kinematics-and-dynamics/
+ base_mass: 4.0 # This mass might be incorrect
+ shoulder_mass: 16.343
+ upper_arm_mass: 29.632
+ forearm_mass: 7.879
+ wrist_1_mass: 3.054
+ wrist_2_mass: 3.126
+ wrist_3_mass: 0.926
+
+ shoulder_radius: x0.060 # FROM UR5 CURRENTLY NOT USED ANYMORE
+ upper_arm_radius: x0.054 # FROM UR5 CURRENTLY NOT USED ANYMORE
+ elbow_radius: x0.060 # FROM UR5 CURRENTLY NOT USED ANYMORE
+ forearm_radius: x0.040 # FROM UR5 CURRENTLY NOT USED ANYMORE
+ wrist_radius: x0.045 # FROM UR5 CURRENTLY NOT USED ANYMORE
+
+ links:
+ base:
+ radius: 0.075
+ length: 0.038
+
+ center_of_mass:
+ shoulder_cog:
+ x: 0.0 # model.x
+ y: -0.0062 # -model.z
+ z: -0.061 # model.y
+ upper_arm_cog:
+ x: -0.3394 # model.x - upperarm_length
+ y: 0.0 # model.y
+ z: 0.2098 # model.z
+ forearm_cog:
+ x: -0.4053 # model.x - forearm_length
+ y: 0.0 # model.y
+ z: 0.0604 # model.z
+ wrist_1_cog:
+ x: 0.0 # model.x
+ y: -0.0393 # -model.z
+ z: -0.0026 # model.y
+ wrist_2_cog:
+ x: 0.0 # model.x
+ y: 0.0379 # model.z
+ z: -0.0024 # -model.y
+ wrist_3_cog:
+ x: 0.0 # model.x
+ y: 0.0 # model.y
+ z: -0.0293 # model.z
+
+ rotation:
+ shoulder:
+ roll: 1.570796326794897
+ pitch: 0
+ yaw: 0
+ upper_arm:
+ roll: 0
+ pitch: 0
+ yaw: 0
+ forearm:
+ roll: 0
+ pitch: 0
+ yaw: 0
+ wrist_1:
+ roll: 1.570796326794897
+ pitch: 0
+ yaw: 0
+ wrist_2:
+ roll: -1.570796326794897
+ pitch: 0
+ yaw: 0
+ wrist_3:
+ roll: 0
+ pitch: 0
+ yaw: 0
+
+ tensor:
+ shoulder:
+ ixx: 0.08866
+ ixy: -0.00011
+ ixz: -0.00011
+ iyy: 0.07632
+ iyz: 0.00720
+ izz: 0.08418
+ upper_arm:
+ ixx: 0.14670
+ ixy: 0.00019
+ ixz: -0.05163
+ iyy: 4.66590
+ iyz: 0.00004
+ izz: 4.63480
+ forearm:
+ ixx: 0.02612
+ ixy: -0.00005
+ ixz: -0.02898
+ iyy: 0.75763
+ iyz: -0.00001
+ izz: 0.75327
+ wrist_1:
+ ixx: 0.00555
+ ixy: -0.00001
+ ixz: -0.00002
+ iyy: 0.00537
+ iyz: 0.00036
+ izz: 0.00402
+ wrist_2:
+ ixx: 0.00586
+ ixy: -0.00001
+ ixz: -0.00002
+ iyy: 0.00578
+ iyz: -0.00037
+ izz: 0.00427
+ wrist_3:
+ ixx: 0.00092
+ ixy: 0.0
+ ixz: 0.0
+ iyy: 0.00091
+ iyz: 0.0
+ izz: 0.00117
diff --git a/my_robot_cell/my_robot_cell_control/config/ur20/visual_parameters.yaml b/my_robot_cell/my_robot_cell_control/config/ur20/visual_parameters.yaml
new file mode 100644
index 0000000..8e896dd
--- /dev/null
+++ b/my_robot_cell/my_robot_cell_control/config/ur20/visual_parameters.yaml
@@ -0,0 +1,97 @@
+# Visualisation
+
+mesh_files:
+ base:
+ visual:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/visual/base.dae
+ material:
+ name: "LightGrey"
+ color: "0.7 0.7 0.7 1.0"
+ collision:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/collision/base.stl
+
+ shoulder:
+ visual:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/visual/shoulder.dae
+ material:
+ name: "LightGrey"
+ color: "0.7 0.7 0.7 1.0"
+ collision:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/collision/shoulder.stl
+
+ upper_arm:
+ visual:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/visual/upperarm.dae
+ material:
+ name: "LightGrey"
+ color: "0.7 0.7 0.7 1.0"
+ collision:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/collision/upperarm.stl
+ mesh_files:
+
+ forearm:
+ visual:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/visual/forearm.dae
+ material:
+ name: "LightGrey"
+ color: "0.7 0.7 0.7 1.0"
+ collision:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/collision/forearm.stl
+
+ wrist_1:
+ visual:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/visual/wrist1.dae
+ material:
+ name: "LightGrey"
+ color: "0.7 0.7 0.7 1.0"
+ collision:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/collision/wrist1.stl
+ visual_offset: -0.0775
+
+ wrist_2:
+ visual:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/visual/wrist2.dae
+ material:
+ name: "LightGrey"
+ color: "0.7 0.7 0.7 1.0"
+ collision:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/collision/wrist2.stl
+ visual_offset: -0.0749
+
+ wrist_3:
+ visual:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/visual/wrist3.dae
+ material:
+ name: "LightGrey"
+ color: "0.7 0.7 0.7 1.0"
+ collision:
+ mesh:
+ package: ur_description
+ path: meshes/ur20/collision/wrist3.stl
+ visual_offset: -0.07
diff --git a/my_robot_cell/my_robot_cell_control/launch/rsp.launch.py b/my_robot_cell/my_robot_cell_control/launch/rsp.launch.py
deleted file mode 100644
index 59823a2..0000000
--- a/my_robot_cell/my_robot_cell_control/launch/rsp.launch.py
+++ /dev/null
@@ -1,161 +0,0 @@
-# Copyright (c) 2024 FZI Forschungszentrum Informatik
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-#
-# * Neither the name of the {copyright_holder} nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGE.
-
-#
-# Author: Felix Exner
-
-from launch_ros.actions import Node
-from launch_ros.substitutions import FindPackageShare
-
-from launch import LaunchDescription
-from launch.actions import DeclareLaunchArgument
-from launch.substitutions import (
- Command,
- FindExecutable,
- LaunchConfiguration,
- PathJoinSubstitution,
-)
-
-
-def generate_launch_description():
- ur_type = LaunchConfiguration("ur_type")
- robot_ip = LaunchConfiguration("robot_ip")
-
- use_mock_hardware = LaunchConfiguration("use_mock_hardware")
- mock_sensor_commands = LaunchConfiguration("mock_sensor_commands")
-
- headless_mode = LaunchConfiguration("headless_mode")
-
- kinematics_parameters_file = LaunchConfiguration("kinematics_parameters_file")
-
- # Load description with necessary parameters
- robot_description_content = Command(
- [
- PathJoinSubstitution([FindExecutable(name="xacro")]),
- " ",
- PathJoinSubstitution(
- [
- FindPackageShare("my_robot_cell_control"),
- "urdf",
- "my_robot_cell_controlled.urdf.xacro",
- ]
- ),
- " ",
- "robot_ip:=",
- robot_ip,
- " ",
- "ur_type:=",
- ur_type,
- " ",
- "kinematics_parameters_file:=",
- kinematics_parameters_file,
- " ",
- "use_mock_hardware:=",
- use_mock_hardware,
- " ",
- "mock_sensor_commands:=",
- mock_sensor_commands,
- " ",
- "headless_mode:=",
- headless_mode,
- ]
- )
- robot_description = {"robot_description": robot_description_content}
-
- declared_arguments = []
- # UR specific arguments
- declared_arguments.append(
- DeclareLaunchArgument(
- "ur_type",
- description="Typo/series of used UR robot.",
- choices=[
- "ur3",
- "ur3e",
- "ur5",
- "ur5e",
- "ur10",
- "ur10e",
- "ur16e",
- "ur20",
- "ur30",
- ],
- default_value="ur20",
- )
- )
- declared_arguments.append(
- DeclareLaunchArgument(
- "robot_ip", description="IP address by which the robot can be reached."
- )
- )
- declared_arguments.append(
- DeclareLaunchArgument(
- "kinematics_parameters_file",
- default_value=PathJoinSubstitution(
- [
- FindPackageShare("my_robot_cell_control"),
- "config",
- "my_robot_calibration.yaml",
- ]
- ),
- description="The calibration configuration of the actual robot used.",
- )
- )
- declared_arguments.append(
- DeclareLaunchArgument(
- "use_mock_hardware",
- default_value="false",
- description="Start robot with mock hardware mirroring command to its states.",
- )
- )
- declared_arguments.append(
- DeclareLaunchArgument(
- "mock_sensor_commands",
- default_value="false",
- description="Enable mock command interfaces for sensors used for simple simulations. "
- "Used only if 'use_mock_hardware' parameter is true.",
- )
- )
- declared_arguments.append(
- DeclareLaunchArgument(
- "headless_mode",
- default_value="false",
- description="Enable headless mode for robot control",
- )
- )
-
- return LaunchDescription(
- declared_arguments
- + [
- Node(
- package="robot_state_publisher",
- executable="robot_state_publisher",
- output="both",
- parameters=[robot_description],
- ),
- ]
- )
diff --git a/my_robot_cell/my_robot_cell_control/launch/start_robot.launch.py b/my_robot_cell/my_robot_cell_control/launch/start_robot.launch.py
index 9da26ae..8d5e0e4 100644
--- a/my_robot_cell/my_robot_cell_control/launch/start_robot.launch.py
+++ b/my_robot_cell/my_robot_cell_control/launch/start_robot.launch.py
@@ -1,23 +1,15 @@
-from launch_ros.actions import Node
-from launch_ros.parameter_descriptions import ParameterFile
from launch_ros.substitutions import FindPackageShare
-
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
-from launch.conditions import IfCondition
from launch.substitutions import (
- Command,
- FindExecutable,
LaunchConfiguration,
PathJoinSubstitution,
- TextSubstitution,
)
def generate_launch_description():
- ur_type = LaunchConfiguration("ur_type")
- robot_ip = LaunchConfiguration("robot_ip")
+ # declare arguments
declared_arguments = []
declared_arguments.append(
DeclareLaunchArgument(
@@ -47,41 +39,111 @@ def generate_launch_description():
declared_arguments.append(
DeclareLaunchArgument("launch_rviz", default_value="true", description="Launch RViz?")
)
-
- return LaunchDescription(
- declared_arguments
- + [
- IncludeLaunchDescription(
- PythonLaunchDescriptionSource(
- [
- PathJoinSubstitution(
- [
- FindPackageShare("ur_robot_driver"),
- "launch",
- "ur_control.launch.py",
- ]
- )
- ]
- ),
- launch_arguments={
- "ur_type": ur_type,
- "robot_ip": robot_ip,
- "tf_prefix": [LaunchConfiguration("ur_type"), "_"],
- "rviz_config_file": PathJoinSubstitution(
- [
- FindPackageShare("my_robot_cell_description"),
- "rviz",
- "urdf.rviz",
- ]
- ),
- "description_launchfile": PathJoinSubstitution(
- [
- FindPackageShare("my_robot_cell_control"),
- "launch",
- "rsp.launch.py",
- ]
- ),
- }.items(),
+ declared_arguments.append(
+ DeclareLaunchArgument(
+ "use_fake_hardware",
+ default_value="false",
+ description="Start robot with fake hardware mirroring command to its states.",
+ )
+ )
+ declared_arguments.append(
+ DeclareLaunchArgument(
+ "fake_sensor_commands",
+ default_value="false",
+ description="Enable fake command interfaces for sensors used for simple simulations. "
+ "Used only if 'use_fake_hardware' parameter is true.",
+ )
+ )
+ declared_arguments.append(
+ DeclareLaunchArgument(
+ "description_package",
+ default_value="my_robot_cell_control",
+ description="description package",
+ )
+ )
+ declared_arguments.append(
+ DeclareLaunchArgument(
+ "description_file",
+ default_value="my_robot_cell_controlled.urdf.xacro",
+ description="URDF/XACRO description file with the robot.",
+ )
+ )
+ declared_arguments.append(
+ DeclareLaunchArgument(
+ "kinematics_params_file",
+ default_value=PathJoinSubstitution(
+ [
+ FindPackageShare("my_robot_cell_control"),
+ "config",
+ "my_robot_calibration.yaml",
+ ]
),
- ]
+ description="The calibration configuration of the actual robot used.",
+ )
+ )
+ declared_arguments.append(
+ DeclareLaunchArgument(
+ "initial_joint_controller",
+ default_value="scaled_joint_trajectory_controller",
+ description="Initially loaded robot controller.",
+ choices=[
+ "scaled_joint_trajectory_controller",
+ "joint_trajectory_controller",
+ "forward_velocity_controller",
+ "forward_position_controller",
+ ],
+ )
+ )
+ declared_arguments.append(
+ DeclareLaunchArgument(
+ "activate_joint_controller",
+ default_value="true",
+ description="Activate loaded joint controller.",
+ )
)
+ declared_arguments.append(
+ DeclareLaunchArgument(
+ "headless_mode",
+ default_value="false",
+ description="Enable headless mode for robot control",
+ )
+ )
+
+ # initialize arguments
+ ur_type = LaunchConfiguration("ur_type")
+ robot_ip = LaunchConfiguration("robot_ip")
+ launch_rviz = LaunchConfiguration("launch_rviz")
+ use_fake_hardware = LaunchConfiguration("use_fake_hardware")
+ fake_sensor_commands = LaunchConfiguration("fake_sensor_commands")
+ controllers_file = LaunchConfiguration("controllers_file")
+ description_package = LaunchConfiguration("description_package")
+ description_file = LaunchConfiguration("description_file")
+ kinematics_params_file = LaunchConfiguration("kinematics_params_file")
+ initial_joint_controller = LaunchConfiguration("initial_joint_controller")
+ activate_joint_controller = LaunchConfiguration("activate_joint_controller")
+ headless_mode = LaunchConfiguration("headless_mode")
+
+ base_launch = IncludeLaunchDescription(
+ PythonLaunchDescriptionSource(
+ [
+ PathJoinSubstitution([FindPackageShare("ur_robot_driver"), "launch"]),
+ "/ur_control.launch.py",
+ ]
+ ),
+ launch_arguments={
+ "ur_type": ur_type,
+ "robot_ip": robot_ip,
+ "tf_prefix": [LaunchConfiguration("ur_type"), "_"],
+ "launch_rviz": launch_rviz,
+ "use_fake_hardware": use_fake_hardware,
+ "fake_sensor_commands": fake_sensor_commands,
+ "description_package": description_package,
+ "description_file": description_file,
+ "kinematics_params_file": kinematics_params_file,
+ "initial_joint_controller": initial_joint_controller,
+ "activate_joint_controller": activate_joint_controller,
+ "headless_mode": headless_mode,
+ }.items(),
+ )
+
+ return LaunchDescription(declared_arguments + [base_launch])
diff --git a/my_robot_cell/my_robot_cell_control/package.xml b/my_robot_cell/my_robot_cell_control/package.xml
index af4c00b..5c70cfe 100644
--- a/my_robot_cell/my_robot_cell_control/package.xml
+++ b/my_robot_cell/my_robot_cell_control/package.xml
@@ -9,7 +9,6 @@
ament_cmake
-
joint_state_broadcaster
joint_trajectory_controller
position_controllers
diff --git a/my_robot_cell/my_robot_cell_control/rviz/view_robot.rviz b/my_robot_cell/my_robot_cell_control/rviz/view_robot.rviz
new file mode 100644
index 0000000..e6b74d0
--- /dev/null
+++ b/my_robot_cell/my_robot_cell_control/rviz/view_robot.rviz
@@ -0,0 +1,257 @@
+Panels:
+ - Class: rviz_common/Displays
+ Help Height: 87
+ Name: Displays
+ Property Tree Widget:
+ Expanded:
+ - /RobotModel1
+ - /TF1
+ - /TF1/Tree1
+ Splitter Ratio: 0.5
+ Tree Height: 637
+ - Class: rviz_common/Views
+ Expanded:
+ - /Current View1
+ Name: Views
+ Splitter Ratio: 0.5
+Visualization Manager:
+ Class: ""
+ Displays:
+ - Alpha: 0.5
+ Cell Size: 1
+ Class: rviz_default_plugins/Grid
+ Color: 160; 160; 164
+ Enabled: true
+ Line Style:
+ Line Width: 0.029999999329447746
+ Value: Lines
+ Name: Grid
+ Normal Cell Count: 0
+ Offset:
+ X: 0
+ Y: 0
+ Z: 0
+ Plane: XY
+ Plane Cell Count: 10
+ Reference Frame:
+ Value: true
+ - Alpha: 1
+ Class: rviz_default_plugins/RobotModel
+ Collision Enabled: false
+ Description File: ""
+ Description Source: Topic
+ Description Topic:
+ Depth: 5
+ Durability Policy: Volatile
+ History Policy: Keep Last
+ Reliability Policy: Reliable
+ Value: /robot_description
+ Enabled: true
+ Links:
+ All Links Enabled: true
+ Expand Joint Details: false
+ Expand Link Details: false
+ Expand Tree: false
+ Link Tree Style: Links in Alphabetic Order
+ monitor:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ Value: true
+ robot_mount:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ table:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ Value: true
+ ur20_base:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ ur20_base_link:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ ur20_base_link_inertia:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ Value: true
+ ur20_flange:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ ur20_forearm_link:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ Value: true
+ ur20_ft_frame:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ ur20_shoulder_link:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ Value: true
+ ur20_tool0:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ ur20_upper_arm_link:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ Value: true
+ ur20_wrist_1_link:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ Value: true
+ ur20_wrist_2_link:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ Value: true
+ ur20_wrist_3_link:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ Value: true
+ wall:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ Value: true
+ world:
+ Alpha: 1
+ Show Axes: false
+ Show Trail: false
+ Mass Properties:
+ Inertia: false
+ Mass: false
+ Name: RobotModel
+ TF Prefix: ""
+ Update Interval: 0
+ Value: true
+ Visual Enabled: true
+ - Class: rviz_default_plugins/TF
+ Enabled: true
+ Frame Timeout: 15
+ Frames:
+ All Enabled: true
+ monitor:
+ Value: true
+ robot_mount:
+ Value: true
+ table:
+ Value: true
+ ur20_base:
+ Value: true
+ ur20_base_link:
+ Value: true
+ ur20_base_link_inertia:
+ Value: true
+ ur20_flange:
+ Value: true
+ ur20_forearm_link:
+ Value: true
+ ur20_ft_frame:
+ Value: true
+ ur20_shoulder_link:
+ Value: true
+ ur20_tool0:
+ Value: true
+ ur20_upper_arm_link:
+ Value: true
+ ur20_wrist_1_link:
+ Value: true
+ ur20_wrist_2_link:
+ Value: true
+ ur20_wrist_3_link:
+ Value: true
+ wall:
+ Value: true
+ world:
+ Value: true
+ Marker Scale: 1
+ Name: TF
+ Show Arrows: true
+ Show Axes: true
+ Show Names: false
+ Tree:
+ world:
+ table:
+ monitor:
+ {}
+ robot_mount:
+ ur20_base_link:
+ ur20_base:
+ {}
+ ur20_base_link_inertia:
+ ur20_shoulder_link:
+ ur20_upper_arm_link:
+ ur20_forearm_link:
+ ur20_wrist_1_link:
+ ur20_wrist_2_link:
+ ur20_wrist_3_link:
+ ur20_flange:
+ ur20_tool0:
+ {}
+ ur20_ft_frame:
+ {}
+ wall:
+ {}
+ Update Interval: 0
+ Value: true
+ Enabled: true
+ Global Options:
+ Background Color: 48; 48; 48
+ Fixed Frame: world
+ Frame Rate: 30
+ Name: root
+ Tools:
+ - Class: rviz_default_plugins/MoveCamera
+ Transformation:
+ Current:
+ Class: rviz_default_plugins/TF
+ Value: true
+ Views:
+ Current:
+ Class: rviz_default_plugins/Orbit
+ Distance: 4.839867115020752
+ Enable Stereo Rendering:
+ Stereo Eye Separation: 0.05999999865889549
+ Stereo Focal Distance: 1
+ Swap Stereo Eyes: false
+ Value: false
+ Focal Point:
+ X: 0.8393054604530334
+ Y: 0.6853293776512146
+ Z: 1.452785611152649
+ Focal Shape Fixed Size: true
+ Focal Shape Size: 0.05000000074505806
+ Invert Z Axis: false
+ Name: Current View
+ Near Clip Distance: 0.009999999776482582
+ Pitch: 0.16000038385391235
+ Target Frame:
+ Value: Orbit (rviz)
+ Yaw: 4.324998378753662
+ Saved: ~
+Window Geometry:
+ Displays:
+ collapsed: false
+ Height: 1412
+ Hide Left Dock: false
+ Hide Right Dock: false
+ QMainWindow State: 000000ff00000000fd0000000100000000000001ad0000052efc0200000002fb000000100044006900730070006c006100790073010000003b0000030f000000c700fffffffb0000000a00560069006500770073010000035000000219000000a000ffffff0000084d0000052e00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
+ Views:
+ collapsed: false
+ Width: 2560
+ X: 1920
+ Y: 0
diff --git a/my_robot_cell/my_robot_cell_control/urdf/my_robot_cell_controlled.urdf.xacro b/my_robot_cell/my_robot_cell_control/urdf/my_robot_cell_controlled.urdf.xacro
index d55fa1d..adf736e 100644
--- a/my_robot_cell/my_robot_cell_control/urdf/my_robot_cell_controlled.urdf.xacro
+++ b/my_robot_cell/my_robot_cell_control/urdf/my_robot_cell_controlled.urdf.xacro
@@ -3,23 +3,29 @@
-
-
+
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
+
+
+
+
@@ -27,25 +33,26 @@
+
diff --git a/my_robot_cell/my_robot_cell_description/urdf/my_robot_cell_macro.xacro b/my_robot_cell/my_robot_cell_description/urdf/my_robot_cell_macro.xacro
index 5681339..0d9ac63 100644
--- a/my_robot_cell/my_robot_cell_description/urdf/my_robot_cell_macro.xacro
+++ b/my_robot_cell/my_robot_cell_description/urdf/my_robot_cell_macro.xacro
@@ -89,6 +89,7 @@
kinematics_parameters_file="${kinematics_parameters_file}"
physical_parameters_file="${physical_parameters_file}"
visual_parameters_file="${visual_parameters_file}"
+ generate_ros2_control_tag="false"
>
diff --git a/my_robot_cell/my_robot_cell_moveit_config/.setup_assistant b/my_robot_cell/my_robot_cell_moveit_config/.setup_assistant
index 8f9e05b..d139bcf 100644
--- a/my_robot_cell/my_robot_cell_moveit_config/.setup_assistant
+++ b/my_robot_cell/my_robot_cell_moveit_config/.setup_assistant
@@ -6,20 +6,5 @@ moveit_setup_assistant_config:
relative_path: config/my_robot_cell.srdf
package_settings:
author_name: Felix Exner
- author_email: exner@fzi.de
- generated_timestamp: 1713785068
- control_xacro:
- command:
- - position
- state:
- - position
- - velocity
- modified_urdf:
- xacros:
- - control_xacro
- control_xacro:
- command:
- - position
- state:
- - position
- - velocity
+ author_email: urfeex@universal-robots.com
+ generated_timestamp: 1742223443
diff --git a/my_robot_cell/my_robot_cell_moveit_config/CMakeLists.txt b/my_robot_cell/my_robot_cell_moveit_config/CMakeLists.txt
index 39624b6..fc24ced 100644
--- a/my_robot_cell/my_robot_cell_moveit_config/CMakeLists.txt
+++ b/my_robot_cell/my_robot_cell_moveit_config/CMakeLists.txt
@@ -5,7 +5,12 @@ find_package(ament_cmake REQUIRED)
ament_package()
-install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}
- PATTERN "setup_assistant.launch" EXCLUDE)
+if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/launch")
+ install(
+ DIRECTORY launch
+ DESTINATION share/${PROJECT_NAME}
+ PATTERN "setup_assistant.launch" EXCLUDE)
+endif()
+
install(DIRECTORY config DESTINATION share/${PROJECT_NAME})
install(FILES .setup_assistant DESTINATION share/${PROJECT_NAME})
diff --git a/my_robot_cell/my_robot_cell_moveit_config/package.xml b/my_robot_cell/my_robot_cell_moveit_config/package.xml
index 5924d78..f22a034 100644
--- a/my_robot_cell/my_robot_cell_moveit_config/package.xml
+++ b/my_robot_cell/my_robot_cell_moveit_config/package.xml
@@ -6,7 +6,7 @@
An automatically generated package with all the configuration and launch files for using the my_robot_cell with the MoveIt Motion Planning Framework
- Felix Exner
+ Felix Exner
BSD-3-Clause
@@ -14,7 +14,7 @@
https://github.com/ros-planning/moveit2/issues
https://github.com/ros-planning/moveit2
- Felix Exner
+ Felix Exner
ament_cmake
@@ -38,7 +38,6 @@
rviz2
rviz_common
rviz_default_plugins
- xacro