diff --git a/my_dual_robot_cell/doc/assemble_urdf.rst b/my_dual_robot_cell/doc/assemble_urdf.rst new file mode 100644 index 0000000..faccb71 --- /dev/null +++ b/my_dual_robot_cell/doc/assemble_urdf.rst @@ -0,0 +1,113 @@ +:github_url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Tutorials/blob/main/my_dual_robot_cell/doc/assemble_urdf.rst + +Assembling the URDF +=================== + +The `ur_description `_ package provides `macro files `_ to generate an instance of a Universal Robots arm. +We'll use this to create a custom workcell with two robots in it, both a UR3e (called Alice) and a UR5e (called Bob). In this section we will only go into +detail about the URDF / xacro files, not the complete package structure. Please see the +`description package source code +`_ for all other files assembling the description package. + +Workcell description +-------------------- + +.. literalinclude:: ../my_dual_robot_cell_description/urdf/my_dual_robot_cell.urdf.xacro + :language: xml + :linenos: + :caption: my_robot_cell_description/urdf/my_robot_cell.urdf.xacro + +Let's break it down: + +First, we'll have to **include** the macro to generate our custom workcell: + +.. literalinclude:: ../my_dual_robot_cell_description/urdf/my_dual_robot_cell.urdf.xacro + :language: xml + :start-at: + :end-at: + :caption: my_dual_robot_cell_description/urdf/my_dual_robot_cell.urdf.xacro + +This line only loads the macro for generating the robot workcell. + +We will need to provide some parameters to our workcell in order to parametrize the arms. Therefore, +we need to declare certain arguments that must be passed to the macro. + +.. literalinclude:: ../my_dual_robot_cell_description/urdf/my_dual_robot_cell.urdf.xacro + :language: xml + :start-at: + :end-at: + :caption: my_dual_robot_cell_description/urdf/my_dual_robot_cell.urdf.xacro + +The workspace macro contains all items within the workcell including the robot arm. If you are not +experienced in writing URDFs, you may want to refer to this `tutorial +`_. The macro's content +is generated using + +.. literalinclude:: ../my_dual_robot_cell_description/urdf/my_dual_robot_cell.urdf.xacro + :language: xml + :start-at: + :end-at: + :caption: my_dual_robot_cell_description/urdf/my_dual_robot_cell.urdf.xacro + +Here, a ``world`` link is created, and the robot workcell is created relative to the ``world`` link. + +Workcell macro +-------------- + +The workcell macro is defined in the following manner: + +.. literalinclude:: ../my_dual_robot_cell_description/urdf/my_dual_robot_cell_macro.xacro + :language: xml + :linenos: + :caption: my_dual_robot_cell_description/urdf/my_dual_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 +this instance, our workspace comprises a table in front of a wall, featuring a monitor, and the +two robot arms mounted on top. + +Ensure that your custom workcell includes the parent link, which must be passed to the **ur_robot** +macro. In this example, we chose to create two links, one named **alice_robot_mount** and one named **bob_robot_mount**. + +.. literalinclude:: ../my_dual_robot_cell_description/urdf/my_dual_robot_cell_macro.xacro + :language: xml + :start-at: + :end-before: + :linenos: + :caption: my_dual_robot_cell_description/urdf/my_dual_robot_cell_macro.xacro + +After that we are finally able to actually **create the robot arms** by calling the macro. + +.. literalinclude:: ../my_dual_robot_cell_description/urdf/my_dual_robot_cell_macro.xacro + :language: xml + :start-at: + :end-before: + :linenos: + :caption: my_dual_robot_cell_description/urdf/my_dual_robot_cell_macro.xacro + +Note that the **origin** argument is transmitted in a different manner than the other arguments. + +Before we can test our code, it's essential to build and source our Colcon workspace: + +.. code-block:: bash + + #cd to your colcon workspace root + cd ~/colcon_ws + + #source and build your workspace + colcon build + source install/setup.bash + + +We can view our custom workspace by running: + +.. code-block:: bash + + #launch rviz + ros2 launch my_dual_robot_cell_description view_robot.launch.py + +Use the sliders of the ``joint_state_puplisher_gui`` to move the virtual robots around. +It should look something like this: + +.. image:: figures/rviz.png + :alt: RViz window showing the custom workspace diff --git a/my_dual_robot_cell/doc/conf.py b/my_dual_robot_cell/doc/conf.py new file mode 100644 index 0000000..4e7828c --- /dev/null +++ b/my_dual_robot_cell/doc/conf.py @@ -0,0 +1,82 @@ +project = "ur_dual_arm_tutorial" +copyright = "2025, Universal Robots A/S" +author = "Jacob Larsen" + +# The short X.Y version +version = "" +# The full version, including alpha/beta/rc tags +release = "" + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +source_suffix = [".rst"] + +# The master toctree document. +master_doc = "index" + +numfig = True + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = "en" + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "migration/*.rst"] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = None + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +# html_static_path = ["_static"] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = "ur_dual_arm_tutorial_doc" diff --git a/my_dual_robot_cell/doc/figures/rviz.png b/my_dual_robot_cell/doc/figures/rviz.png new file mode 100644 index 0000000..4503938 Binary files /dev/null and b/my_dual_robot_cell/doc/figures/rviz.png differ diff --git a/my_dual_robot_cell/doc/index.rst b/my_dual_robot_cell/doc/index.rst new file mode 100644 index 0000000..a834a74 --- /dev/null +++ b/my_dual_robot_cell/doc/index.rst @@ -0,0 +1,26 @@ +:github_url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Tutorials/blob/main/my_dual_robot_cell/doc/index.rst + +.. _dual_arm_tutorial: + +=================== +Dual robot arm cell +=================== + +Example about integrating two UR arms into a custom workspace. We will build a custom workcell +description containing two robot arms, start the driver and create a MoveIt config to enable trajectory planning with MoveIt. + +Please see the `package source code +`_ for +all files relevant for this example. + +.. toctree:: + :maxdepth: 4 + :caption: Contents: + + assemble_urdf + start_ur_driver + +MoveIt! Configuration +--------------------- +For inspiration on how to configure MoveIt! 2 using the setup assistant, please see the `single arm robot cell tutorial +`_ diff --git a/my_dual_robot_cell/doc/start_ur_driver.rst b/my_dual_robot_cell/doc/start_ur_driver.rst new file mode 100644 index 0000000..19db314 --- /dev/null +++ b/my_dual_robot_cell/doc/start_ur_driver.rst @@ -0,0 +1,135 @@ +:github_url: https://github.com/UniversalRobots/Universal_Robots_ROS2_Tutorials/blob/main/my_dual_robot_cell/doc/start_ur_driver.rst + +========================= +Start the ur_robot_driver +========================= + +In the last chapter we created a custom scene description containing our two robots. In order to make +that description usable to ``ros2_control`` and hence the ``ur_robot_driver``, we need to add +control information. We will also add a custom launchfile to start up our demonstrator. + +We will generate a new package called `my_dual_robot_cell_control `_ for that purpose. + +Create a description with ros2_control tag +------------------------------------------ + +The first step is to create a description containing the control instructions: + +.. literalinclude:: ../my_dual_robot_cell_control/urdf/my_dual_robot_cell_controlled.urdf.xacro + :language: xml + :linenos: + :caption: my_dual_robot_cell_control/urdf/my_dual_robot_cell_controlled.urdf.xacro + +This URDF is very similar to the one we have already assembled. We simply need to include the ros2_control macro, + +.. literalinclude:: ../my_dual_robot_cell_control/urdf/my_dual_robot_cell_controlled.urdf.xacro + :language: xml + :start-at: + :end-at: + :caption: my_dual_robot_cell_control/urdf/my_dual_robot_cell_controlled.urdf.xacro + +define the necessary arguments that need to be passed to the macro, + +.. literalinclude:: ../my_dual_robot_cell_control/urdf/my_dual_robot_cell_controlled.urdf.xacro + :language: xml + :start-at: + :end-at: + :caption: my_dual_robot_cell_control/urdf/my_dual_robot_cell_controlled.urdf.xacro + +and then call the macro by providing all the specified arguments. + +.. literalinclude:: ../my_dual_robot_cell_control/urdf/my_dual_robot_cell_controlled.urdf.xacro + :language: xml + :start-at: + :caption: my_robot_cell_control/urdf/my_robot_cell_controlled.urdf.xacro + +Extract the calibration +----------------------- + +One very important step is to extract each robot's specific calibration and save it to our +workcell's startup package. For details, please refer to `our documentation on extracting the calibration information `_. +For now, we just copy the default ones for the UR3e and UR5e. + +.. code-block:: + + cp $(ros2 pkg prefix ur_description)/share/ur_description/config/ur3e/default_kinematics.yaml \ + my_dual_robot_cell_control/config/alice_calibration.yaml + + cp $(ros2 pkg prefix ur_description)/share/ur_description/config/ur5e/default_kinematics.yaml \ + my_dual_robot_cell_control/config/bob_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_dual_robot_cell_control/launch/rsp.launch.py + :language: py + :start-at: from launch import LaunchDescription + :linenos: + :caption: my_dual_robot_cell_control/launch/rsp.launch.py + +Before we can start our workcell we need to create a launchfile that will launch the two robot descriptions correctly. + +Create start_robot launchfile +----------------------------- + +Here we create a launch file which will launch the driver with the correct description and robot state publisher, as well as start all of the controllers necessary to use the two robots. + +.. literalinclude:: ../my_dual_robot_cell_control/launch/start_robots.launch.py + :language: py + :linenos: + :caption: my_dual_robot_cell_control/launch/start_robots.launch.py + +With that we can start the robot using + +.. code-block:: bash + + ros2 launch my_dual_robot_cell_control start_robots.launch.py alice_use_mock_hardware:=true bob_use_mock_hardware:=true + +Testing everything +------------------ + +Before we can test our code, it's essential to build and source our Colcon workspace: + +.. code-block:: bash + + #cd to your colcon workspace root, e.g. + cd ~/colcon_ws + + #source and build your workspace + colcon build + source install/setup.bash + +We can start the system in a mocked simulation + +.. code-block:: bash + + #start the driver with mocked hardware + ros2 launch my_dual_robot_cell_control start_robots.launch.py alice_use_mock_hardware:=true bob_use_mock_hardware:=true + +Or to use it with a real robot: + +.. code-block:: bash + + #start the driver with real hardware (or the docker simulator included in this example) + ros2 launch my_dual_robot_cell_control start_robots.launch.py + +.. note:: + We extracted the calibration information from the robot and saved it in the + ``my_robot_cell_control`` package. If you have a different robot, you need to extract the + calibration information from that, and pass that to the launch file. Changing the ``ur_type`` + parameter only will lead to a wrong model, as it will still be using the example kinematics from + a UR3e and UR5e. To use a UR10e and UR20, for example, you can do + + .. code-block:: bash + + ros2 launch my_dual_robot_cell_control start_robots.launch.py bob_ur_type:=ur10e bob_use_mock_hardware:=true \ + bob_kinematics_parameters_file:=$(ros2 pkg prefix ur_description)/share/ur_description/config/ur10e/default_kinematics.yaml \ + alice_ur_type:=ur20 alice_use_mock_hardware:=true \ + alice_kinematics_parameters_file:=$(ros2 pkg prefix ur_description)/share/ur_description/config/ur20/default_kinematics.yaml diff --git a/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.installation b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.installation index 45a1d9b..c793559 100644 Binary files a/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.installation and b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.installation differ diff --git a/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.installation.problem b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.installation.problem new file mode 100644 index 0000000..45a1d9b Binary files /dev/null and b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.installation.problem differ diff --git a/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.variables b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.variables index f163609..c5cba97 100644 Binary files a/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.variables and b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.variables differ diff --git a/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.variables.problem b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.variables.problem new file mode 100644 index 0000000..f163609 Binary files /dev/null and b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_alice/programs/default.variables.problem differ diff --git a/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.installation b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.installation index 7535e41..0c76ca1 100644 Binary files a/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.installation and b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.installation differ diff --git a/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.installation.problem b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.installation.problem new file mode 100644 index 0000000..7535e41 Binary files /dev/null and b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.installation.problem differ diff --git a/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.variables b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.variables index c444be6..c5cba97 100644 Binary files a/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.variables and b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.variables differ diff --git a/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.variables.problem b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.variables.problem new file mode 100644 index 0000000..c444be6 Binary files /dev/null and b/my_dual_robot_cell/my_dual_robot_cell_control/dual-arm-simulator/persistent_storage_bob/programs/default.variables.problem differ diff --git a/my_dual_robot_cell/my_dual_robot_cell_control/launch/rsp.launch.py b/my_dual_robot_cell/my_dual_robot_cell_control/launch/rsp.launch.py index bc0d8d5..d665ab7 100644 --- a/my_dual_robot_cell/my_dual_robot_cell_control/launch/rsp.launch.py +++ b/my_dual_robot_cell/my_dual_robot_cell_control/launch/rsp.launch.py @@ -104,7 +104,7 @@ def generate_launch_description(): "ur20", "ur30", ], - default_value="ur3e", + default_value="ur5e", ) ) declared_arguments.append( diff --git a/my_dual_robot_cell/my_dual_robot_cell_description/launch/view_robot.launch.py b/my_dual_robot_cell/my_dual_robot_cell_description/launch/view_robot.launch.py index 4a8c477..3506ecd 100644 --- a/my_dual_robot_cell/my_dual_robot_cell_description/launch/view_robot.launch.py +++ b/my_dual_robot_cell/my_dual_robot_cell_description/launch/view_robot.launch.py @@ -19,10 +19,10 @@ def generate_launch_description(): description_file, " ", "alice_ur_type:=", - "ur3", + "ur3e", " ", "bob_ur_type:=", - "ur3", + "ur5e", ] ), value_type=str, diff --git a/my_dual_robot_cell/my_dual_robot_cell_description/urdf/my_dual_robot_cell_macro.xacro b/my_dual_robot_cell/my_dual_robot_cell_description/urdf/my_dual_robot_cell_macro.xacro index 899c25e..9a54ac5 100644 --- a/my_dual_robot_cell/my_dual_robot_cell_description/urdf/my_dual_robot_cell_macro.xacro +++ b/my_dual_robot_cell/my_dual_robot_cell_description/urdf/my_dual_robot_cell_macro.xacro @@ -86,7 +86,7 @@ - + diff --git a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/.setup_assistant b/my_dual_robot_cell/my_dual_robot_cell_moveit_config/.setup_assistant deleted file mode 100644 index 44d47a0..0000000 --- a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/.setup_assistant +++ /dev/null @@ -1,10 +0,0 @@ -moveit_setup_assistant_config: - urdf: - package: my_dual_robot_cell_description - relative_path: urdf/my_dual_robot_cell.urdf.xacro - srdf: - relative_path: config/my_dual_robot_cell.srdf - package_settings: - author_name: Vihaan Shah - author_email: vihaan.shah@uconn.edu - generated_timestamp: 1719324402 diff --git a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/CMakeLists.txt b/my_dual_robot_cell/my_dual_robot_cell_moveit_config/CMakeLists.txt deleted file mode 100644 index 0cb4e73..0000000 --- a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 3.22) -project(my_dual_robot_cell_moveit_config) - -find_package(ament_cmake REQUIRED) - -ament_package() - -install(DIRECTORY launch DESTINATION share/${PROJECT_NAME} - PATTERN "setup_assistant.launch" EXCLUDE) -install(DIRECTORY config DESTINATION share/${PROJECT_NAME}) -install(FILES .setup_assistant DESTINATION share/${PROJECT_NAME}) diff --git a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/initial_positions.yaml b/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/initial_positions.yaml deleted file mode 100644 index 27a6a59..0000000 --- a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/initial_positions.yaml +++ /dev/null @@ -1,15 +0,0 @@ -# Default initial positions for my_dual_robot_cell's ros2_control fake system - -initial_positions: - alice_elbow_joint: 0 - alice_shoulder_lift_joint: 0 - alice_shoulder_pan_joint: 0 - alice_wrist_1_joint: 0 - alice_wrist_2_joint: 0 - alice_wrist_3_joint: 0 - bob_elbow_joint: 0 - bob_shoulder_lift_joint: 0 - bob_shoulder_pan_joint: 0 - bob_wrist_1_joint: 0 - bob_wrist_2_joint: 0 - bob_wrist_3_joint: 0 diff --git a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/joint_limits.yaml b/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/joint_limits.yaml deleted file mode 100644 index bdb5311..0000000 --- a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/joint_limits.yaml +++ /dev/null @@ -1,70 +0,0 @@ -# joint_limits.yaml allows the dynamics properties specified in the URDF to be overwritten or augmented as needed - -# For beginners, we downscale velocity and acceleration limits. -# You can always specify higher scaling factors (<= 1.0) in your motion requests. # Increase the values below to 1.0 to always move at maximum speed. -default_velocity_scaling_factor: 0.1 -default_acceleration_scaling_factor: 0.1 - -# Specific joint properties can be changed with the keys [max_position, min_position, max_velocity, max_acceleration] -# Joint limits can be turned off with [has_velocity_limits, has_acceleration_limits] -joint_limits: - alice_elbow_joint: - has_velocity_limits: true - max_velocity: 3.1415926535897931 - has_acceleration_limits: true - max_acceleration: 5.0 - alice_shoulder_lift_joint: - has_velocity_limits: true - max_velocity: 3.1415926535897931 - has_acceleration_limits: true - max_acceleration: 5.0 - alice_shoulder_pan_joint: - has_velocity_limits: true - max_velocity: 3.1415926535897931 - has_acceleration_limits: true - max_acceleration: 5.0 - alice_wrist_1_joint: - has_velocity_limits: true - max_velocity: 6.2831853071795862 - has_acceleration_limits: true - max_acceleration: 5.0 - alice_wrist_2_joint: - has_velocity_limits: true - max_velocity: 6.2831853071795862 - has_acceleration_limits: true - max_acceleration: 5.0 - alice_wrist_3_joint: - has_velocity_limits: true - max_velocity: 6.2831853071795862 - has_acceleration_limits: true - max_acceleration: 5.0 - bob_elbow_joint: - has_velocity_limits: true - max_velocity: 3.1415926535897931 - has_acceleration_limits: true - max_acceleration: 5.0 - bob_shoulder_lift_joint: - has_velocity_limits: true - max_velocity: 3.1415926535897931 - has_acceleration_limits: true - max_acceleration: 5.0 - bob_shoulder_pan_joint: - has_velocity_limits: true - max_velocity: 3.1415926535897931 - has_acceleration_limits: true - max_acceleration: 5.0 - bob_wrist_1_joint: - has_velocity_limits: true - max_velocity: 6.2831853071795862 - has_acceleration_limits: true - max_acceleration: 5.0 - bob_wrist_2_joint: - has_velocity_limits: true - max_velocity: 6.2831853071795862 - has_acceleration_limits: true - max_acceleration: 5.0 - bob_wrist_3_joint: - has_velocity_limits: true - max_velocity: 6.2831853071795862 - has_acceleration_limits: true - max_acceleration: 5.0 diff --git a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/kinematics.yaml b/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/kinematics.yaml deleted file mode 100644 index 195e5a9..0000000 --- a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/kinematics.yaml +++ /dev/null @@ -1,8 +0,0 @@ -alice_manipulator: - kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin - kinematics_solver_search_resolution: 0.0050000000000000001 - kinematics_solver_timeout: 0.0050000000000000001 -bob_manipulator: - kinematics_solver: kdl_kinematics_plugin/KDLKinematicsPlugin - kinematics_solver_search_resolution: 0.0050000000000000001 - kinematics_solver_timeout: 0.0050000000000000001 diff --git a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/moveit.rviz b/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/moveit.rviz deleted file mode 100644 index 2cbcdc6..0000000 --- a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/moveit.rviz +++ /dev/null @@ -1,484 +0,0 @@ -Panels: - - Class: rviz_common/Displays - Help Height: 87 - Name: Displays - Property Tree Widget: - Expanded: ~ - Splitter Ratio: 0.4957627058029175 - Tree Height: 380 - - Class: rviz_common/Selection - Name: Selection - - Class: rviz_common/Tool Properties - Expanded: - - /2D Goal Pose1 - - /Publish Point1 - Name: Tool Properties - Splitter Ratio: 0.5886790156364441 - - 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 - - Acceleration_Scaling_Factor: 0.1 - Class: moveit_rviz_plugin/MotionPlanning - Enabled: true - Move Group Namespace: "" - MoveIt_Allow_Approximate_IK: false - MoveIt_Allow_External_Program: false - MoveIt_Allow_Replanning: false - MoveIt_Allow_Sensor_Positioning: false - MoveIt_Planning_Attempts: 10 - MoveIt_Planning_Time: 5 - MoveIt_Use_Cartesian_Path: false - MoveIt_Use_Constraint_Aware_IK: false - MoveIt_Workspace: - Center: - X: 0 - Y: 0 - Z: 0 - Size: - X: 2 - Y: 2 - Z: 2 - Name: MotionPlanning - Planned Path: - Color Enabled: true - Interrupt Display: true - Links: - All Links Enabled: true - Expand Joint Details: false - Expand Link Details: false - Expand Tree: false - Link Tree Style: Links in Alphabetic Order - alice_base: - Alpha: 1 - Show Axes: false - Show Trail: false - alice_base_link: - Alpha: 1 - Show Axes: false - Show Trail: false - alice_base_link_inertia: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - alice_flange: - Alpha: 1 - Show Axes: false - Show Trail: false - alice_forearm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - alice_ft_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - alice_robot_mount: - Alpha: 1 - Show Axes: false - Show Trail: false - alice_shoulder_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - alice_tool0: - Alpha: 1 - Show Axes: false - Show Trail: false - alice_upper_arm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - alice_wrist_1_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - alice_wrist_2_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - alice_wrist_3_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_base: - Alpha: 1 - Show Axes: false - Show Trail: false - bob_base_link: - Alpha: 1 - Show Axes: false - Show Trail: false - bob_base_link_inertia: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_flange: - Alpha: 1 - Show Axes: false - Show Trail: false - bob_forearm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_ft_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - bob_robot_mount: - Alpha: 1 - Show Axes: false - Show Trail: false - bob_shoulder_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_tool0: - Alpha: 1 - Show Axes: false - Show Trail: false - bob_upper_arm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_wrist_1_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_wrist_2_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_wrist_3_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - monitor: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - table: - 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 - Loop Animation: false - Robot Alpha: 0.5 - Robot Color: 150; 50; 150 - Show Robot Collision: false - Show Robot Visual: true - Show Trail: false - State Display Time: 0.05 s - Trail Step Size: 1 - Trajectory Topic: /display_planned_path - Use Sim Time: false - Planning Metrics: - Payload: 1 - Show Joint Torques: false - Show Manipulability: false - Show Manipulability Index: false - Show Weight Limit: false - TextHeight: 0.07999999821186066 - Planning Request: - Colliding Link Color: 255; 0; 0 - Goal State Alpha: 1 - Goal State Color: 250; 128; 0 - Interactive Marker Size: 0 - Joint Violation Color: 255; 0; 255 - Planning Group: alice_manipulator - Query Goal State: true - Query Start State: false - Show Workspace: false - Start State Alpha: 1 - Start State Color: 0; 255; 0 - Planning Scene Topic: monitored_planning_scene - Robot Description: robot_description - Scene Geometry: - Scene Alpha: 0.8999999761581421 - Scene Color: 50; 230; 50 - Scene Display Time: 0.009999999776482582 - Show Scene Geometry: true - Voxel Coloring: Z-Axis - Voxel Rendering: Occupied Voxels - Scene Robot: - Attached Body Color: 150; 50; 150 - Links: - All Links Enabled: true - Expand Joint Details: false - Expand Link Details: false - Expand Tree: false - Link Tree Style: Links in Alphabetic Order - alice_base: - Alpha: 1 - Show Axes: false - Show Trail: false - alice_base_link: - Alpha: 1 - Show Axes: false - Show Trail: false - alice_base_link_inertia: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - alice_flange: - Alpha: 1 - Show Axes: false - Show Trail: false - alice_forearm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - alice_ft_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - alice_robot_mount: - Alpha: 1 - Show Axes: false - Show Trail: false - alice_shoulder_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - alice_tool0: - Alpha: 1 - Show Axes: false - Show Trail: false - alice_upper_arm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - alice_wrist_1_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - alice_wrist_2_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - alice_wrist_3_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_base: - Alpha: 1 - Show Axes: false - Show Trail: false - bob_base_link: - Alpha: 1 - Show Axes: false - Show Trail: false - bob_base_link_inertia: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_flange: - Alpha: 1 - Show Axes: false - Show Trail: false - bob_forearm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_ft_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - bob_robot_mount: - Alpha: 1 - Show Axes: false - Show Trail: false - bob_shoulder_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_tool0: - Alpha: 1 - Show Axes: false - Show Trail: false - bob_upper_arm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_wrist_1_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_wrist_2_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - bob_wrist_3_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - monitor: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - table: - 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 - Robot Alpha: 1 - Show Robot Collision: false - Show Robot Visual: true - Value: true - Velocity_Scaling_Factor: 0.1 - Enabled: true - Global Options: - Background Color: 48; 48; 48 - Fixed Frame: world - Frame Rate: 30 - Name: root - Tools: - - Class: rviz_default_plugins/Interact - Hide Inactive Objects: true - - Class: rviz_default_plugins/MoveCamera - - Class: rviz_default_plugins/Select - - Class: rviz_default_plugins/FocusCamera - - Class: rviz_default_plugins/Measure - Line color: 128; 128; 0 - - Class: rviz_default_plugins/SetInitialPose - Covariance x: 0.25 - Covariance y: 0.25 - Covariance yaw: 0.06853891909122467 - Topic: - Depth: 5 - Durability Policy: Volatile - History Policy: Keep Last - Reliability Policy: Reliable - Value: /initialpose - - Class: rviz_default_plugins/SetGoal - Topic: - Depth: 5 - Durability Policy: Volatile - History Policy: Keep Last - Reliability Policy: Reliable - Value: /goal_pose - - Class: rviz_default_plugins/PublishPoint - Single click: true - Topic: - Depth: 5 - Durability Policy: Volatile - History Policy: Keep Last - Reliability Policy: Reliable - Value: /clicked_point - Transformation: - Current: - Class: rviz_default_plugins/TF - Value: true - Views: - Current: - Class: rviz_default_plugins/Orbit - Distance: 4.587055683135986 - Enable Stereo Rendering: - Stereo Eye Separation: 0.05999999865889549 - Stereo Focal Distance: 1 - Swap Stereo Eyes: false - Value: false - Focal Point: - X: 0.4825928509235382 - Y: 0.6104342937469482 - Z: 1.4097795486450195 - Focal Shape Fixed Size: true - Focal Shape Size: 0.05000000074505806 - Invert Z Axis: false - Name: Current View - Near Clip Distance: 0.009999999776482582 - Pitch: 0.41039803624153137 - Target Frame: - Value: Orbit (rviz) - Yaw: 4.133575916290283 - Saved: ~ -Window Geometry: - Displays: - collapsed: false - Height: 1016 - Hide Left Dock: false - Hide Right Dock: false - MotionPlanning: - collapsed: false - MotionPlanning - Trajectory Slider: - collapsed: false - QMainWindow State: 000000ff00000000fd0000000400000000000001f30000039efc020000000bfb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d00000210000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb00000044004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000004100fffffffb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e00670100000253000001880000017d00ffffff00000001000001100000039efc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d0000039e000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d00650100000000000004500000000000000000000004710000039e00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 - Selection: - collapsed: false - Tool Properties: - collapsed: false - Views: - collapsed: false - Width: 1920 - X: 0 - Y: 27 diff --git a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/moveit_controllers.yaml b/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/moveit_controllers.yaml deleted file mode 100644 index 01b20bc..0000000 --- a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/moveit_controllers.yaml +++ /dev/null @@ -1,32 +0,0 @@ -# MoveIt uses this configuration for controller management - -moveit_controller_manager: moveit_simple_controller_manager/MoveItSimpleControllerManager - -moveit_simple_controller_manager: - controller_names: - - alice_scaled_joint_trajectory_controller - - bob_scaled_joint_trajectory_controller - - alice_scaled_joint_trajectory_controller: - type: FollowJointTrajectory - action_ns: follow_joint_trajectory - default: true - joints: - - alice_shoulder_pan_joint - - alice_shoulder_lift_joint - - alice_elbow_joint - - alice_wrist_1_joint - - alice_wrist_2_joint - - alice_wrist_3_joint - - bob_scaled_joint_trajectory_controller: - type: FollowJointTrajectory - action_ns: follow_joint_trajectory - default: true - joints: - - bob_shoulder_pan_joint - - bob_shoulder_lift_joint - - bob_elbow_joint - - bob_wrist_1_joint - - bob_wrist_2_joint - - bob_wrist_3_joint diff --git a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/my_dual_robot_cell.srdf b/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/my_dual_robot_cell.srdf deleted file mode 100644 index 70480a0..0000000 --- a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/my_dual_robot_cell.srdf +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/pilz_cartesian_limits.yaml b/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/pilz_cartesian_limits.yaml deleted file mode 100644 index b2997ca..0000000 --- a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/config/pilz_cartesian_limits.yaml +++ /dev/null @@ -1,6 +0,0 @@ -# Limits for the Pilz planner -cartesian_limits: - max_trans_vel: 1.0 - max_trans_acc: 2.25 - max_trans_dec: -5.0 - max_rot_vel: 1.57 diff --git a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/launch/dual_ur_moveit.launch.py b/my_dual_robot_cell/my_dual_robot_cell_moveit_config/launch/dual_ur_moveit.launch.py deleted file mode 100644 index 875ab92..0000000 --- a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/launch/dual_ur_moveit.launch.py +++ /dev/null @@ -1,78 +0,0 @@ -import os -from pathlib import Path - -import yaml -from ament_index_python.packages import get_package_share_directory -from launch import LaunchDescription -from launch.actions import DeclareLaunchArgument, ExecuteProcess, RegisterEventHandler -from launch.conditions import IfCondition -from launch.event_handlers import OnProcessExit -from launch.substitutions import LaunchConfiguration, PathJoinSubstitution -from launch_ros.actions import Node -from launch_ros.substitutions import FindPackageShare -from moveit_configs_utils import MoveItConfigsBuilder - - -def load_yaml(package_name, file_path): - package_path = get_package_share_directory(package_name) - absolute_file_path = os.path.join(package_path, file_path) - - try: - with open(absolute_file_path) as file: - return yaml.safe_load(file) - except OSError: # parent of IOError, OSError *and* WindowsError where available - return None - - -def generate_launch_description(): - moveit_config = MoveItConfigsBuilder( - "my_dual_robot_cell", package_name="my_dual_robot_cell_moveit_config" - ).to_moveit_configs() - - move_group_configuration = { - "publish_robot_description_semantic": True, - "allow_trajectory_execution": True, - "publish_planning_scene": True, - "publish_geometry_updates": True, - "publish_state_updates": True, - "publish_transforms_updates": True, - } - - move_group_params = [ - moveit_config.to_dict(), - move_group_configuration, - ] - - move_group_node = Node( - package="moveit_ros_move_group", - executable="move_group", - output="screen", - parameters=move_group_params, - additional_env={"DISPLAY": ":0"}, - ) - - rviz_config_file = PathJoinSubstitution( - [FindPackageShare("my_dual_robot_cell_moveit_config"), "config", "moveit.rviz"] - ) - - rviz_node = Node( - package="rviz2", - executable="rviz2", - name="rviz2_moveit", - output="log", - arguments=["-d", rviz_config_file], - parameters=[ - moveit_config.robot_description, - moveit_config.robot_description_semantic, - moveit_config.robot_description_kinematics, - moveit_config.planning_pipelines, - moveit_config.joint_limits, - ], - ) - - return LaunchDescription( - [ - move_group_node, - rviz_node, - ] - ) diff --git a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/package.xml b/my_dual_robot_cell/my_dual_robot_cell_moveit_config/package.xml deleted file mode 100644 index ae4308f..0000000 --- a/my_dual_robot_cell/my_dual_robot_cell_moveit_config/package.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - my_dual_robot_cell_moveit_config - 0.3.0 - - An automatically generated package with all the configuration and launch files for using the my_dual_robot_cell with the MoveIt Motion Planning Framework - - Vihaan Shah - - BSD-3-Clause - - http://moveit.ros.org/ - https://github.com/ros-planning/moveit2/issues - https://github.com/ros-planning/moveit2 - - Vihaan Shah - - ament_cmake - - moveit_ros_move_group - moveit_kinematics - moveit_planners - moveit_simple_controller_manager - joint_state_publisher - joint_state_publisher_gui - tf2_ros - xacro - moveit_configs_utils - moveit_ros_move_group - moveit_ros_visualization - my_dual_robot_cell_description - rviz2 - rviz_common - rviz_default_plugins - - - - ament_cmake - - diff --git a/my_robot_cell/doc/assemble_urdf.rst b/my_robot_cell/doc/assemble_urdf.rst index fbf675f..1c5831f 100644 --- a/my_robot_cell/doc/assemble_urdf.rst +++ b/my_robot_cell/doc/assemble_urdf.rst @@ -27,7 +27,7 @@ First, we'll have to **include** the macro to generate our custom workcell: :end-at: :caption: my_robot_cell_description/urdf/my_robot_cell.urdf.xacro -This line only loadeded the macro for generating the robot workcell. +This line only loads the macro for generating the robot workcell. We will need to provide some parameters to our workcell in order to parametrize the arm. Therefore, we need to declare certain arguments that must be passed to the macro. diff --git a/my_robot_cell/doc/conf.py b/my_robot_cell/doc/conf.py new file mode 100644 index 0000000..80d8726 --- /dev/null +++ b/my_robot_cell/doc/conf.py @@ -0,0 +1,82 @@ +project = "ur_custom_workcell_tutorial" +copyright = "2025, Universal Robots A/S" +author = "Felix Exner" + +# The short X.Y version +version = "" +# The full version, including alpha/beta/rc tags +release = "" + +# -- General configuration --------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +source_suffix = [".rst"] + +# The master toctree document. +master_doc = "index" + +numfig = True + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = "en" + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "migration/*.rst"] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = None + + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "alabaster" + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +# html_static_path = ["_static"] + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +# html_sidebars = {} + + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = "ur_custom_workcell_tutorial_doc" diff --git a/tutorial_index.rst b/tutorial_index.rst index 22fcaae..506f065 100644 --- a/tutorial_index.rst +++ b/tutorial_index.rst @@ -14,3 +14,4 @@ Example tutorials :titlesonly: my_robot_cell/doc/index.rst + my_dual_robot_cell/doc/index.rst