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

Minimal ros2_control xacro definitions #1

Merged
merged 7 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# robotiq_hande_description
### For the driver, check the [robotiq_hande_driver](https://github.com/AGH-CEAI/robotiq_hande_driver/) package from AGH UST.
---

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

Expand All @@ -7,6 +9,7 @@ This package contains meshes and URDF description of [Robotiq Hand-E gripper](ht
- The gripper comes with coupler model (but without flange).
- This repository comes with CAD models imported from STEP files to FreeCAD format (FCStd).
- Package has been developed and tested in ROS 2 Humble.
- 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.


> [!IMPORTANT]
Expand Down
29 changes: 29 additions & 0 deletions urdf/robotiq_hande_gripper.ros2_control.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:macro name="robotiq_hande_ros2_control" params="name prefix tty use_fake_hardware:=false">
<ros2_control name="${name}" type="system">
<hardware>
<xacro:if value="${use_fake_hardware}">
<plugin>mock_components/GenericSystem</plugin>
</xacro:if>

<xacro:unless value="${use_fake_hardware}">
<plugin>robotiq_hande_driver/RobotiqHandeHardwareInterface</plugin>
<param name="tty">${tty}</param>
</xacro:unless>
</hardware>

<!-- The right finger joint uses the mimic feature -->
<joint name="${prefix}robotiq_hande_left_finger_joint">
<command_interface name="position">
<param name="min">0</param>
<param name="max">0.025</param>
</command_interface>
<state_interface name="position">
<param name="initial_value">0.025</param>
</state_interface>
<state_interface name="velocity"/>
</joint>
</ros2_control>
</xacro:macro>
</robot>
8 changes: 6 additions & 2 deletions urdf/robotiq_hande_gripper.urdf.xacro
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="robotiq_hande_gripper">
<xacro:arg name="parent" default="tool0"/>
<xacro:arg name="tty" default="/dev/ttyXXX"/>
<xacro:arg name="use_fake_hardware" default="true"/>

<xacro:include filename="$(find robotiq_hande_description)/urdf/robotiq_hande_gripper.xacro"/>

<link name="tool0"/>
<xacro:robotiq_hande_gripper parent="tool0" prefix=""/>
<link name="$(arg parent)"/>
<xacro:robotiq_hande_gripper name="robotiq_hande_gripper" prefix="" parent="$(arg parent)" tty="$(arg tty)" use_fake_hardware="$(arg use_fake_hardware)"/>
</robot>
46 changes: 25 additions & 21 deletions urdf/robotiq_hande_gripper.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@
-->

<xacro:include filename="$(find robotiq_hande_description)/urdf/materials.xacro"/>
<xacro:include filename="$(find robotiq_hande_description)/urdf/robotiq_hande_gripper.ros2_control.xacro"/>

<xacro:macro name="robotiq_hande_gripper" params="name prefix parent tty use_fake_hardware">
<!-- ros2_control parameters -->
<xacro:robotiq_hande_ros2_control name="${name}" prefix="${prefix}" tty="${tty}" use_fake_hardware="${use_fake_hardware}"/>

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

<joint name="robotiq_coupler_joint" type="fixed">
<joint name="${prefix}robotiq_hande_coupler_joint" type="fixed">
<origin xyz="0 0 0.00695" rpy="0 0 ${-pi/2.0}"/>
<parent link="${parent}"/>
<child link="${prefix}robotiq_coupler"/>
<child link="${prefix}robotiq_hande_coupler"/>
</joint>

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

<joint name="${prefix}robotiq_hande_base_joint" type="fixed">
<origin rpy="0 0 0" xyz="0 0 0.055"/>
<parent link="${prefix}robotiq_coupler"/>
<child link="${prefix}hande_link"/>
<parent link="${prefix}robotiq_hande_coupler"/>
<child link="${prefix}robotiq_hande_link"/>
</joint>

<link name="${prefix}hande_link">
<link name="${prefix}robotiq_hande_link">
<inertial>
<mass value="0.86387"/>
<inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.0006"/>
Expand All @@ -64,15 +68,15 @@
</visual>
</link>

<joint name="${prefix}hande_left_finger_joint" type="prismatic">
<joint name="${prefix}robotiq_hande_left_finger_joint" type="prismatic">
<origin rpy="0 0 0" xyz="0 -0.025 0.0345"/>
<parent link="${prefix}hande_link"/>
<child link="${prefix}hande_left_finger"/>
<parent link="${prefix}robotiq_hande_link"/>
<child link="${prefix}robotiq_hande_left_finger"/>
<axis xyz="0 1 0"/>
<limit effort="130" lower="0" upper="0.025" velocity="0.15"/>
</joint>

<link name="${prefix}hande_left_finger">
<link name="${prefix}robotiq_hande_left_finger">
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="0.03804"/>
Expand All @@ -95,16 +99,16 @@
</visual>
</link>

<joint name="${prefix}hande_right_finger_joint" type="prismatic">
<joint name="${prefix}robotiq_hande_right_finger_joint" type="prismatic">
<origin rpy="0 0 0" xyz="0 0.025 0.0345"/>
<parent link="${prefix}hande_link"/>
<child link="${prefix}hande_right_finger"/>
<parent link="${prefix}robotiq_hande_link"/>
<child link="${prefix}robotiq_hande_right_finger"/>
<axis xyz="0 -1 0"/>
<limit effort="130" lower="0" upper="0.025" velocity="0.15"/>
<mimic joint="${prefix}hande_left_finger_joint" multiplier="1" offset="0"/>
<mimic joint="${prefix}robotiq_hande_left_finger_joint" multiplier="1" offset="0"/>
</joint>

<link name="${prefix}hande_right_finger">
<link name="${prefix}robotiq_hande_right_finger">
<inertial>
<origin rpy="0 0 0" xyz="0 0 0"/>
<mass value="0.03804"/>
Expand All @@ -129,10 +133,10 @@

<joint name="${prefix}robotiq_hande_end_joint" type="fixed">
<origin rpy="0 0 0" xyz="0 0 0.095"/>
<parent link="${prefix}hande_link"/>
<child link="${prefix}hande_end"/>
<parent link="${prefix}robotiq_hande_link"/>
<child link="${prefix}robotiq_hande_end"/>
</joint>

<link name="${prefix}hande_end"/>
<link name="${prefix}robotiq_hande_end"/>
</xacro:macro>
</robot>