Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual arm tutorial for ROS2 #3

Draft
wants to merge 26 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f3cd1e4
Extend single arm description to dual arm
ShahhhVihaan Jun 24, 2024
78fc1d8
Remove ur_type from tf_prefix
ShahhhVihaan Jun 24, 2024
5942dda
Add ros2 control parameters to dual arm urdf for dual arm driver
ShahhhVihaan Jun 24, 2024
ab6232e
Modify ur_control.launch.py to launch controllers for both arms
ShahhhVihaan Jun 24, 2024
8cd6f11
Generate dual_robot_cell moveit config using moveit setup assistant
ShahhhVihaan Jun 24, 2024
1976b71
Add acceleration limits
ShahhhVihaan Jun 25, 2024
6de9d5d
Add IK plugins for the two manipulators
ShahhhVihaan Jun 25, 2024
6f86075
Remove unwanted launch files + configuration files
ShahhhVihaan Jul 3, 2024
24bf6e1
Add io/status and forward velocity controllers
ShahhhVihaan Jul 3, 2024
458bcca
Calibrate arms
ShahhhVihaan Jul 3, 2024
9b4558f
Merge branch 'UniversalRobots:main' into dual_arm_tutorials
ShahhhVihaan Jul 3, 2024
998c2c1
Update arguments for alice and bob
ShahhhVihaan Jul 3, 2024
a0feb01
Merge branch 'dual_arm_tutorials' of https://github.com/ShahhhVihaan/…
ShahhhVihaan Jul 3, 2024
1695e55
Fix ur_type and mock_sensor_commands arguments
ShahhhVihaan Jul 3, 2024
55cbee3
Update rviz config for description launch
ShahhhVihaan Jul 3, 2024
b1a637a
Use rviz config file for moveit
ShahhhVihaan Jul 3, 2024
f080d11
Re use mesh files from custom_workcell in the my_robot_cell package
ShahhhVihaan Feb 12, 2025
443caa8
Add myself as author
ShahhhVihaan Feb 12, 2025
a60342c
Move alice and bob robots to a slightly better position
ShahhhVihaan Feb 12, 2025
d675d52
Remove redundant joint_state_broadcaster
ShahhhVihaan Feb 12, 2025
aa89633
Default to ur3e
ShahhhVihaan Feb 12, 2025
25430cd
Use alice and bob instead of a generic robot
ShahhhVihaan Feb 12, 2025
6ea2489
Add author
ShahhhVihaan Feb 12, 2025
140e4a0
Use single joint_state_broadcaster and update consistent_controllers
ShahhhVihaan Feb 12, 2025
e01dead
Use both alice and bob instead of generic robot
ShahhhVihaan Feb 12, 2025
b9434f7
Merge branch 'UniversalRobots:main' into dual_arm_tutorials
ShahhhVihaan Feb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add ros2 control parameters to dual arm urdf for dual arm driver
- Add ros2 control tags/parameters for each robot arm
- Some parameters are specific to each arm and some common to both
- Ports and IP different for each arm
- RTDE scripts, mock hardware, headless mode common to the arms
ShahhhVihaan committed Jun 24, 2024
commit 5942dda4602252c0a397c320d127f8383c8e874c
11 changes: 11 additions & 0 deletions my_dual_robot_cell/my_dual_robot_cell_control/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.8)
project(my_dual_robot_cell_control)

find_package(ament_cmake REQUIRED)

install(
DIRECTORY launch config urdf
DESTINATION share/${PROJECT_NAME}
)

ament_package()
29 changes: 29 additions & 0 deletions my_dual_robot_cell/my_dual_robot_cell_control/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2022, Universal Robots A/S
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. 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.

3. 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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
kinematics:
shoulder:
x: 0
y: 0
z: 0.1519
roll: 0
pitch: 0
yaw: 0
upper_arm:
x: 0
y: 0
z: 0
roll: 1.570796327
pitch: 0
yaw: 0
forearm:
x: -0.24365
y: 0
z: 0
roll: 0
pitch: 0
yaw: 0
wrist_1:
x: -0.21325
y: 0
z: 0.11235
roll: 0
pitch: 0
yaw: 0
wrist_2:
x: 0
y: -0.08535
z: -1.750557762378351e-11
roll: 1.570796327
pitch: 0
yaw: 0
wrist_3:
x: 0
y: 0.0819
z: -1.679797079540562e-11
roll: 1.570796326589793
pitch: 3.141592653589793
yaw: 3.141592653589793
hash: calib_9122066269688285636
28 changes: 28 additions & 0 deletions my_dual_robot_cell/my_dual_robot_cell_control/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>my_dual_robot_cell_control</name>
<version>1.0.0</version>
<description>ros2_control setup</description>
<maintainer email="Durchdewald@fzi.de">Felix Durchdewald</maintainer>
<license file="LICENSE">BSD-3-Clause</license>

<buildtool_depend>ament_cmake</buildtool_depend>


<exec_depend>joint_state_broadcaster</exec_depend>
<exec_depend>joint_trajectory_controller</exec_depend>
<exec_depend>position_controllers</exec_depend>
<exec_depend>robot_state_publisher</exec_depend>
<exec_depend>my_dual_robot_cell_description</exec_depend>
<exec_depend>ur_controllers</exec_depend>
<exec_depend>ur_robot_driver</exec_depend>
<exec_depend>ur_client_library</exec_depend>
<exec_depend>xacro</exec_depend>
<exec_depend>controller_manager</exec_depend>


<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
<?xml version="1.0"?>
<robot name="my_dual_robot_cell" xmlns:xacro="http://ros.org/wiki/xacro">

<!--First, include the macro from our custom description-->
<xacro:include filename="$(find my_dual_robot_cell_description)/urdf/my_dual_robot_cell_macro.xacro"/>
<!--The driver already provides a control tag for the UR arm, we can directly include-->
<xacro:include filename="$(find ur_robot_driver)/urdf/ur.ros2_control.xacro"/>

<!--We need to specify the arguments used for parametrizing our description-->
<xacro:arg name="alice_ur_type" default="ur3"/>
<xacro:arg name="alice_joint_limits_parameters_file" default="$(find ur_description)/config/$(arg alice_ur_type)/joint_limits.yaml"/>
<xacro:arg name="alice_kinematics_parameters_file" default="$(find ur_description)/config/$(arg alice_ur_type)/default_kinematics.yaml"/>
<xacro:arg name="alice_physical_parameters_file" default="$(find ur_description)/config/$(arg alice_ur_type)/physical_parameters.yaml"/>
<xacro:arg name="alice_visual_parameters_file" default="$(find ur_description)/config/$(arg alice_ur_type)/visual_parameters.yaml"/>

<xacro:arg name="bob_ur_type" default="ur3"/>
<xacro:arg name="bob_joint_limits_parameters_file" default="$(find ur_description)/config/$(arg bob_ur_type)/joint_limits.yaml"/>
<xacro:arg name="bob_kinematics_parameters_file" default="$(find ur_description)/config/$(arg bob_ur_type)/default_kinematics.yaml"/>
<xacro:arg name="bob_physical_parameters_file" default="$(find ur_description)/config/$(arg bob_ur_type)/physical_parameters.yaml"/>
<xacro:arg name="bob_visual_parameters_file" default="$(find ur_description)/config/$(arg bob_ur_type)/visual_parameters.yaml"/>

<xacro:arg name="headless_mode" default="false" />
<xacro:arg name="ur_script_filename" default="$(find ur_client_library)/resources/external_control.urscript"/>
<xacro:arg name="ur_output_recipe_filename" default="$(find ur_robot_driver)/resources/rtde_output_recipe.txt"/>
<xacro:arg name="ur_input_recipe_filename" default="$(find ur_robot_driver)/resources/rtde_input_recipe.txt"/>
<xacro:arg name="use_mock_hardware" default="true" />
<xacro:arg name="mock_sensor_commands" default="false" />

<xacro:arg name="alice_robot_ip" default="192.168.0.101"/>
<xacro:arg name="alice_reverse_port" default="50001"/>
<xacro:arg name="alice_script_sender_port" default="50002"/>
<xacro:arg name="alice_script_command_port" default="50004"/>
<xacro:arg name="alice_trajectory_port" default="50003"/>

<xacro:arg name="bob_robot_ip" default="192.168.0.100"/>
<xacro:arg name="bob_reverse_port" default="50006"/>
<xacro:arg name="bob_script_sender_port" default="50007"/>
<xacro:arg name="bob_script_command_port" default="50010"/>
<xacro:arg name="bob_trajectory_port" default="50009"/>


<link name="world" />

<!--Create the scene description including the robot-->
<xacro:my_dual_robot_cell
parent="world"

alice_ur_type="$(arg alice_ur_type)"
alice_joint_limits_parameters_file="$(arg alice_joint_limits_parameters_file)"
alice_kinematics_parameters_file="$(arg alice_kinematics_parameters_file)"
alice_physical_parameters_file="$(arg alice_physical_parameters_file)"
alice_visual_parameters_file="$(arg alice_visual_parameters_file)"

bob_ur_type="$(arg bob_ur_type)"
bob_joint_limits_parameters_file="$(arg bob_joint_limits_parameters_file)"
bob_kinematics_parameters_file="$(arg bob_kinematics_parameters_file)"
bob_physical_parameters_file="$(arg bob_physical_parameters_file)"
bob_visual_parameters_file="$(arg bob_visual_parameters_file)"
>
<origin xyz="0 0 1" rpy="0 0 0" />
</xacro:my_dual_robot_cell>

<!--Create the control tag for the UR robot-->
<xacro:ur_ros2_control
name="alice"
tf_prefix="alice_"
kinematics_parameters_file="$(arg alice_kinematics_parameters_file)"
robot_ip="$(arg alice_robot_ip)"
script_filename="$(arg ur_script_filename)"
output_recipe_filename="$(arg ur_output_recipe_filename)"
input_recipe_filename="$(arg ur_input_recipe_filename)"
use_mock_hardware="$(arg use_mock_hardware)"
mock_sensor_commands="$(arg mock_sensor_commands)"
headless_mode="$(arg headless_mode)"
reverse_port="$(arg alice_reverse_port)"
script_sender_port="$(arg alice_script_sender_port)"
script_command_port="$(arg alice_script_command_port)"
trajectory_port="$(arg alice_trajectory_port)"
/>

<xacro:ur_ros2_control
name="bob"
tf_prefix="bob_"
kinematics_parameters_file="$(arg bob_kinematics_parameters_file)"
robot_ip="$(arg bob_robot_ip)"
script_filename="$(arg ur_script_filename)"
output_recipe_filename="$(arg ur_output_recipe_filename)"
input_recipe_filename="$(arg ur_input_recipe_filename)"
use_mock_hardware="$(arg use_mock_hardware)"
mock_sensor_commands="$(arg mock_sensor_commands)"
headless_mode="$(arg headless_mode)"
reverse_port="$(arg bob_reverse_port)"
script_sender_port="$(arg bob_script_sender_port)"
script_command_port="$(arg bob_script_command_port)"
trajectory_port="$(arg bob_trajectory_port)"
/>

<!--If you had more controlled devices in your description, e.g. a gripper, you can add another ros2_control tag here-->

</robot>