Skip to content

Commit cbfb28e

Browse files
authored
Update gripper descriptions for use on HW (Kinovarobotics#206)
Pass though more hardware parameters for gripper control: * `use_internal_bus_gripper_comm`: specify if gripper comms will pass through the robot internally * `(gripper_)com_port`: specify the port the gripper can be exected on Use internal comm param in gripper macros: * Consider `use_internal_bus_gripper_comm` param in determination for whether or not to launch a ros2_control instance for the gripper. If `use_internal_bus_gripper_comm` is false and we're not running in simulation, that means we're expecting to communicate with the gripper via USB and we'll need to launch a separate ros2_control instance to control it. Add documentation on `load_robot` macro parameters
1 parent 915df14 commit cbfb28e

File tree

6 files changed

+108
-8
lines changed

6 files changed

+108
-8
lines changed

kortex_description/grippers/robotiq_2f_140/urdf/robotiq_2f_140_macro.xacro

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@
99
sim_isaac:=false
1010
isaac_joint_commands:=/isaac_joint_commands
1111
isaac_joint_states:=/isaac_joint_states
12-
use_internal_bus_gripper_comm:=false">
12+
use_internal_bus_gripper_comm:=false
13+
com_port:=/dev/ttyUSB0">
1314
<xacro:include filename="$(find robotiq_description)/urdf/robotiq_2f_140_macro.urdf.xacro" />
1415

1516
<!-- Hardware talks directly to the gripper so we don't need ros2_control unless we are simulating -->
1617
<xacro:property name="include_ros2_control" value="false"/>
17-
<xacro:if value="${sim_ignition or sim_isaac or use_fake_hardware}">
18+
<xacro:if value="${sim_ignition or sim_isaac or use_fake_hardware or not use_internal_bus_gripper_comm}">
1819
<xacro:property name="include_ros2_control" value="true"/>
1920
</xacro:if>
21+
2022
<xacro:robotiq_gripper
2123
name="RobotiqGripperHardwareInterface"
2224
prefix="${prefix}"
2325
parent="${parent}"
2426
include_ros2_control="${include_ros2_control}"
27+
com_port="${com_port}"
2528
use_fake_hardware="${use_fake_hardware}"
2629
fake_sensor_commands="${fake_sensor_commands}"
2730
sim_ignition="${sim_ignition}"

kortex_description/grippers/robotiq_2f_85/urdf/robotiq_2f_85_macro.xacro

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,22 @@
99
sim_isaac:=false
1010
isaac_joint_commands:=/isaac_joint_commands
1111
isaac_joint_states:=/isaac_joint_states
12-
use_internal_bus_gripper_comm:=false">
12+
use_internal_bus_gripper_comm:=false
13+
com_port:=/dev/ttyUSB0">
1314
<xacro:include filename="$(find robotiq_description)/urdf/robotiq_2f_85_macro.urdf.xacro" />
1415

1516
<!-- Hardware talks directly to the gripper so we don't need ros2_control unless we are simulating -->
1617
<xacro:property name="include_ros2_control" value="false"/>
17-
<xacro:if value="${sim_ignition or sim_isaac or use_fake_hardware}">
18+
<xacro:if value="${sim_ignition or sim_isaac or use_fake_hardware or not use_internal_bus_gripper_comm}">
1819
<xacro:property name="include_ros2_control" value="true"/>
1920
</xacro:if>
21+
2022
<xacro:robotiq_gripper
2123
name="RobotiqGripperHardwareInterface"
2224
prefix="${prefix}"
2325
parent="${parent}"
2426
include_ros2_control="${include_ros2_control}"
27+
com_port="${com_port}"
2528
use_fake_hardware="${use_fake_hardware}"
2629
fake_sensor_commands="${fake_sensor_commands}"
2730
sim_ignition="${sim_ignition}"

kortex_description/readme.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,73 @@ For example:
3131
## Tool frame
3232

3333
The `tool_frame` link refers to the tool frame used by the arm when it reports end effector position feedback.
34+
35+
## Xacro Parameters for `load_robot` macro
36+
37+
### Parameter Table
38+
Param | Description | Default |
39+
:---- | :---------- | :------ |
40+
`parent` | Parent link in the URDF the arm should be attached to | - |
41+
`origin` | Origin of the robot relative to the specified parent link | - |
42+
`prefix` | This is an optional prefix for all joint and link names in the kortex_description. It is used to allow differentiating between different arms in the same URDF. | - |
43+
`arm` | Name of your robot arm model. | - |
44+
`gripper` | Name of gripper type | - |
45+
`gripper_joint_name` | Name of gripper joint to be actuated | - |
46+
`dof` | Number of DOFs of your robot. | - |
47+
`vision` | Boolean value to indicate if your arm has a Vision Module. This argument only affects the visual representation of the arm in RViz. | - |
48+
`robot_ip` | The IP address of the robot you're connection to. | - |
49+
`username` | The username for the robot connection. | - |
50+
`password` | The password for the robot connection. | - |
51+
`port` | Port for Kortex hardware driver | - |
52+
`port_realtime` | Realtime port for Kortex hardware driver | - |
53+
`session_inactivity_timeout_ms` | The duration after which the robot will clean the client session if the client hangs up the connection brutally (should not happen with the ROS driver). | - |
54+
`connection_inactivity_timeout_ms` | The duration after which a connection is destroyed by the robot if no communication is detected between the client and the robot. | - |
55+
`use_internal_bus_gripper_comm` | Boolean value to indicate if your gripper will be communicated with through the internal Kinova communication interface. Set to true if the gripper is directly plugged into the kinova arm. Set to false if running in simulation or if gripper is connected to PC via USB. Setting to false will create a ros2_control instance for the gripper. | false |
56+
`use_fake_hardware` | Boolean value to indicate whether or not the hardware components will be mocked. If true the hardware params will be ignored and the hardware components will be mocked. | false |
57+
`fake_sensor_commands` | Boolean value. If set to true will create fake command interfaces for faking sensor measurements with an external command. | false |
58+
`sim_gazebo` | Boolean value to indicate whether or not the gazebo_ros2_control/GazeboSystem plugin will be loaded. | false |
59+
`sim_ignition` | Boolean value to indicate whether or not the ign_ros2_control/IgnitionSystem plugin will be loaded. | false |
60+
`sim_isaac` | Boolean value to indicate whether or not the topic_based_ros2_control/TopicBasedSystem plugin will be loaded and the "joint_commands_topic" and "joint_states_topic" parameters will be set to the `isaac_joint_commands` and `isaac_joint_states` values respectively. | false |
61+
`isaac_joint_commands` | Name of the joint commands topic to be used by Isaac Sim. | /isaac_joint_commands |
62+
`isaac_joint_states` | Name of the joint states topic to be used by Isaac Sim. | /isaac_joint_states |
63+
`use_external_cable` | Boolean value that sets joint limits to avoid wrapping of external cables if true. | false |
64+
`initial_positions` | Dictionary of initial joint positions. | {joint_1: 0.0, joint_2: 0.0, joint_3: 0.0, joint_4: 0.0, joint_5: 0.0, joint_6: 0.0, joint_7: 0.0} |
65+
`gripper_max_velocity` | Desired velocity in percentage (0.0-100.0%) with which the position will be set. | 100.0 |
66+
`gripper_max_force` | Desired force in percentage (0.0-100.0%) with which the position will be set. NOTE: deprecated according to the [Kortex repo](https://github.com/Kinovarobotics/kortex/blob/master/api_cpp/doc/markdown/messages/GripperCyclic/MotorCommand.md). | 100.0 |
67+
`gripper_com_port` | Specifies the USB port that the gripper is plugged in on. This will only be used if `use_internal_bus_gripper_comm` is false. | /dev/ttyUSB0 |
68+
69+
### Example Usage
70+
#### Kinova gen3 with robotiq_2f_85 end effector connected via the internal Kinova communication interface
71+
```
72+
<robot ...>
73+
...
74+
<xacro:property name="initial_positions" value="${dict(joint_1=0.0, joint_2=0.0, joint_3=-3.14, joint_4=-2.51, joint_5=0.0, joint_6=0.96, joint_7=1.57)}"/>
75+
<xacro:load_robot
76+
parent="world"
77+
arm="gen3"
78+
gripper="robotiq_2f_85"
79+
gripper_joint_name="robotiq_85_left_knuckle_joint"
80+
dof="7"
81+
vision="true"
82+
robot_ip="192.168.1.10"
83+
username="admin"
84+
password="admin"
85+
port="10000"
86+
port_realtime="10001"
87+
session_inactivity_timeout_ms="60000"
88+
connection_inactivity_timeout_ms="2000"
89+
use_internal_bus_gripper_comm="true"
90+
sim_gazebo="false"
91+
sim_ignition="false"
92+
sim_isaac="false"
93+
prefix=""
94+
use_fake_hardware="false"
95+
initial_positions="${initial_positions}"
96+
use_external_cable="true"
97+
fake_sensor_commands="false"
98+
gripper_com_port="">
99+
<origin xyz="0 0 0.0" rpy="0 0 0" />
100+
</xacro:load_robot>
101+
...
102+
</robot>
103+
```

kortex_description/robots/gen3_robotiq_2f_140.xacro

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,22 @@
88
<xacro:arg name="vision" default="true" />
99

1010
<xacro:arg name="gripper" default="robotiq_2f_140" />
11+
<xacro:arg name="use_internal_bus_gripper_comm" default="false" />
12+
<xacro:arg name="gripper_com_port" default="/dev/ttyUSB0" />
1113

1214
<xacro:arg name="sim" default="false" />
1315
<xacro:arg name="prefix" default="" />
1416

1517
<xacro:include filename="$(find kortex_description)/robots/kortex_robot.xacro" />
16-
<xacro:load_robot arm="$(arg arm)" gripper="$(arg gripper)" dof="$(arg dof)" vision="$(arg vision)" sim="$(arg sim)" prefix="$(arg prefix)"/>
18+
<xacro:load_robot
19+
arm="$(arg arm)"
20+
gripper="$(arg gripper)"
21+
dof="$(arg dof)"
22+
vision="$(arg vision)"
23+
sim="$(arg sim)"
24+
prefix="$(arg prefix)"
25+
use_internal_bus_gripper_comm="$(arg use_internal_bus_gripper_comm)"
26+
gripper_com_port="$(arg gripper_com_port)">
27+
</xacro:load_robot>
1728

1829
</robot>

kortex_description/robots/gen3_robotiq_2f_85.xacro

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,22 @@
88
<xacro:arg name="vision" default="true" />
99

1010
<xacro:arg name="gripper" default="robotiq_2f_85" />
11+
<xacro:arg name="use_internal_bus_gripper_comm" default="false" />
12+
<xacro:arg name="gripper_com_port" default="/dev/ttyUSB0" />
1113

1214
<xacro:arg name="sim" default="false" />
1315
<xacro:arg name="prefix" default="" />
1416

1517
<xacro:include filename="$(find kortex_description)/robots/kortex_robot.xacro" />
16-
<xacro:load_robot arm="$(arg arm)" gripper="$(arg gripper)" dof="$(arg dof)" vision="$(arg vision)" sim="$(arg sim)" prefix="$(arg prefix)" />
18+
<xacro:load_robot
19+
arm="$(arg arm)"
20+
gripper="$(arg gripper)"
21+
dof="$(arg dof)"
22+
vision="$(arg vision)"
23+
sim="$(arg sim)"
24+
prefix="$(arg prefix)"
25+
use_internal_bus_gripper_comm="$(arg use_internal_bus_gripper_comm)"
26+
gripper_com_port="$(arg gripper_com_port)">
27+
</xacro:load_robot>
1728

1829
</robot>

kortex_description/robots/kortex_robot.xacro

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
use_external_cable:=false
3030
initial_positions:=${dict(joint_1=0.0,joint_2=0.0,joint_3=0.0,joint_4=0.0,joint_5=0.0,joint_6=0.0,joint_7=0.0)}
3131
gripper_max_velocity:=100.0
32-
gripper_max_force:=100.0">
32+
gripper_max_force:=100.0
33+
gripper_com_port:=/dev/ttyUSB0">
3334

3435
<!-- Include and load arm macro files -->
3536
<xacro:include filename="$(find kortex_description)/arms/${arm}/${dof}dof/urdf/${arm}_macro.xacro" />
@@ -87,7 +88,8 @@
8788
sim_isaac="${sim_isaac}"
8889
isaac_joint_commands="${isaac_joint_commands}"
8990
isaac_joint_states="${isaac_joint_states}"
90-
use_internal_bus_gripper_comm="${use_internal_bus_gripper_comm}"/>
91+
use_internal_bus_gripper_comm="${use_internal_bus_gripper_comm}"
92+
com_port="${gripper_com_port}"/>
9193
</xacro:unless>
9294

9395
</xacro:macro>

0 commit comments

Comments
 (0)