Skip to content

Commit 52de37c

Browse files
authored
Merge pull request #1 from macmacal/feature/ros2_control
Minimal ros2_control xacro definitions
2 parents 8f5e6ac + 6f2741f commit 52de37c

File tree

4 files changed

+63
-23
lines changed

4 files changed

+63
-23
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# robotiq_hande_description
2+
### For the driver, check the [robotiq_hande_driver](https://github.com/AGH-CEAI/robotiq_hande_driver/) package from AGH UST.
3+
---
24

35
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
46

@@ -7,6 +9,7 @@ This package contains meshes and URDF description of [Robotiq Hand-E gripper](ht
79
- The gripper comes with coupler model (but without flange).
810
- This repository comes with CAD models imported from STEP files to FreeCAD format (FCStd).
911
- Package has been developed and tested in ROS 2 Humble.
12+
- The definitions for the `ros2_control` framework are available in the [robotiq_hande_gripper.ros2_control.xacro](./urdf/robotiq_hande_gripper.ros2_control.xacro) file.
1013

1114

1215
> [!IMPORTANT]
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0"?>
2+
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
3+
<xacro:macro name="robotiq_hande_ros2_control" params="name prefix tty use_fake_hardware:=false">
4+
<ros2_control name="${name}" type="system">
5+
<hardware>
6+
<xacro:if value="${use_fake_hardware}">
7+
<plugin>mock_components/GenericSystem</plugin>
8+
</xacro:if>
9+
10+
<xacro:unless value="${use_fake_hardware}">
11+
<plugin>robotiq_hande_driver/RobotiqHandeHardwareInterface</plugin>
12+
<param name="tty">${tty}</param>
13+
</xacro:unless>
14+
</hardware>
15+
16+
<!-- The right finger joint uses the mimic feature -->
17+
<joint name="${prefix}robotiq_hande_left_finger_joint">
18+
<command_interface name="position">
19+
<param name="min">0</param>
20+
<param name="max">0.025</param>
21+
</command_interface>
22+
<state_interface name="position">
23+
<param name="initial_value">0.025</param>
24+
</state_interface>
25+
<state_interface name="velocity"/>
26+
</joint>
27+
</ros2_control>
28+
</xacro:macro>
29+
</robot>

urdf/robotiq_hande_gripper.urdf.xacro

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?xml version="1.0"?>
22
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="robotiq_hande_gripper">
3+
<xacro:arg name="parent" default="tool0"/>
4+
<xacro:arg name="tty" default="/dev/ttyXXX"/>
5+
<xacro:arg name="use_fake_hardware" default="true"/>
6+
37
<xacro:include filename="$(find robotiq_hande_description)/urdf/robotiq_hande_gripper.xacro"/>
48

5-
<link name="tool0"/>
6-
<xacro:robotiq_hande_gripper parent="tool0" prefix=""/>
9+
<link name="$(arg parent)"/>
10+
<xacro:robotiq_hande_gripper name="robotiq_hande_gripper" prefix="" parent="$(arg parent)" tty="$(arg tty)" use_fake_hardware="$(arg use_fake_hardware)"/>
711
</robot>

urdf/robotiq_hande_gripper.xacro

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@
55
-->
66

77
<xacro:include filename="$(find robotiq_hande_description)/urdf/materials.xacro"/>
8+
<xacro:include filename="$(find robotiq_hande_description)/urdf/robotiq_hande_gripper.ros2_control.xacro"/>
9+
10+
<xacro:macro name="robotiq_hande_gripper" params="name prefix parent tty use_fake_hardware">
11+
<!-- ros2_control parameters -->
12+
<xacro:robotiq_hande_ros2_control name="${name}" prefix="${prefix}" tty="${tty}" use_fake_hardware="${use_fake_hardware}"/>
813

9-
<xacro:macro name="robotiq_hande_gripper" params="prefix parent">
1014
<!-- Robotiq Coupler -->
11-
<!-- + Height added by the coupler: 13.9mm -->
12-
<!-- + Reference frame: at the middle (6.95mm) -->
15+
<!-- + Height added by the coupler (13.9mm) -->
16+
<!-- + Reference frame at the middle (6.95mm) -->
1317

14-
<joint name="robotiq_coupler_joint" type="fixed">
18+
<joint name="${prefix}robotiq_hande_coupler_joint" type="fixed">
1519
<origin xyz="0 0 0.00695" rpy="0 0 ${-pi/2.0}"/>
1620
<parent link="${parent}"/>
17-
<child link="${prefix}robotiq_coupler"/>
21+
<child link="${prefix}robotiq_hande_coupler"/>
1822
</joint>
1923

20-
<link name="${prefix}robotiq_coupler">
24+
<link name="${prefix}robotiq_hande_coupler">
2125
<inertial>
2226
<mass value="0.168"/>
2327
<inertia ixx="6.17674E-05" ixy="0.0" ixz="0.0" iyy="6.17674E-05" iyz="0.0" izz="1.18125E-04"/>
@@ -39,11 +43,11 @@
3943

4044
<joint name="${prefix}robotiq_hande_base_joint" type="fixed">
4145
<origin rpy="0 0 0" xyz="0 0 0.055"/>
42-
<parent link="${prefix}robotiq_coupler"/>
43-
<child link="${prefix}hande_link"/>
46+
<parent link="${prefix}robotiq_hande_coupler"/>
47+
<child link="${prefix}robotiq_hande_link"/>
4448
</joint>
4549

46-
<link name="${prefix}hande_link">
50+
<link name="${prefix}robotiq_hande_link">
4751
<inertial>
4852
<mass value="0.86387"/>
4953
<inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.0006"/>
@@ -64,15 +68,15 @@
6468
</visual>
6569
</link>
6670

67-
<joint name="${prefix}hande_left_finger_joint" type="prismatic">
71+
<joint name="${prefix}robotiq_hande_left_finger_joint" type="prismatic">
6872
<origin rpy="0 0 0" xyz="0 -0.025 0.0345"/>
69-
<parent link="${prefix}hande_link"/>
70-
<child link="${prefix}hande_left_finger"/>
73+
<parent link="${prefix}robotiq_hande_link"/>
74+
<child link="${prefix}robotiq_hande_left_finger"/>
7175
<axis xyz="0 1 0"/>
7276
<limit effort="130" lower="0" upper="0.025" velocity="0.15"/>
7377
</joint>
7478

75-
<link name="${prefix}hande_left_finger">
79+
<link name="${prefix}robotiq_hande_left_finger">
7680
<inertial>
7781
<origin rpy="0 0 0" xyz="0 0 0"/>
7882
<mass value="0.03804"/>
@@ -95,16 +99,16 @@
9599
</visual>
96100
</link>
97101

98-
<joint name="${prefix}hande_right_finger_joint" type="prismatic">
102+
<joint name="${prefix}robotiq_hande_right_finger_joint" type="prismatic">
99103
<origin rpy="0 0 0" xyz="0 0.025 0.0345"/>
100-
<parent link="${prefix}hande_link"/>
101-
<child link="${prefix}hande_right_finger"/>
104+
<parent link="${prefix}robotiq_hande_link"/>
105+
<child link="${prefix}robotiq_hande_right_finger"/>
102106
<axis xyz="0 -1 0"/>
103107
<limit effort="130" lower="0" upper="0.025" velocity="0.15"/>
104-
<mimic joint="${prefix}hande_left_finger_joint" multiplier="1" offset="0"/>
108+
<mimic joint="${prefix}robotiq_hande_left_finger_joint" multiplier="1" offset="0"/>
105109
</joint>
106110

107-
<link name="${prefix}hande_right_finger">
111+
<link name="${prefix}robotiq_hande_right_finger">
108112
<inertial>
109113
<origin rpy="0 0 0" xyz="0 0 0"/>
110114
<mass value="0.03804"/>
@@ -129,10 +133,10 @@
129133

130134
<joint name="${prefix}robotiq_hande_end_joint" type="fixed">
131135
<origin rpy="0 0 0" xyz="0 0 0.095"/>
132-
<parent link="${prefix}hande_link"/>
133-
<child link="${prefix}hande_end"/>
136+
<parent link="${prefix}robotiq_hande_link"/>
137+
<child link="${prefix}robotiq_hande_end"/>
134138
</joint>
135139

136-
<link name="${prefix}hande_end"/>
140+
<link name="${prefix}robotiq_hande_end"/>
137141
</xacro:macro>
138142
</robot>

0 commit comments

Comments
 (0)