|
1 | 1 | <?xml version="1.0"?>
|
2 | 2 | <robot xmlns:xacro="http://www.ros.org/wiki/xacro">
|
3 | 3 |
|
4 |
| - <xacro:macro name="robotiq_sim_gripper_ros2_control" params=" |
5 |
| - name |
6 |
| - sim_isaac:=false |
7 |
| - use_fake_hardware:=false"> |
| 4 | + <xacro:macro name="robotiq_sim_gripper_ros2_control" |
| 5 | + params="name sim_ignition:=false sim_isaac:=false use_fake_hardware:=true"> |
8 | 6 |
|
9 | 7 | <ros2_control name="${name}" type="system">
|
| 8 | + <!-- Plugins --> |
10 | 9 | <hardware>
|
11 | 10 | <xacro:if value="${sim_isaac}">
|
12 | 11 | <plugin>isaac_ros2_control/IsaacSystem</plugin>
|
13 | 12 | <param name="joint_commands_topic">/isaac_joint_commands</param>
|
14 | 13 | <param name="joint_states_topic">/isaac_joint_states</param>
|
15 | 14 | </xacro:if>
|
| 15 | + <xacro:if value="${sim_ignition}"> |
| 16 | + <plugin>ign_ros2_control/IgnitionSystem</plugin> |
| 17 | + </xacro:if> |
16 | 18 | <xacro:if value="${use_fake_hardware}">
|
17 | 19 | <plugin>mock_components/GenericSystem</plugin>
|
18 | 20 | <param name="fake_sensor_commands">${fake_sensor_commands}</param>
|
19 | 21 | <param name="state_following_offset">0.0</param>
|
20 | 22 | </xacro:if>
|
21 | 23 | </hardware>
|
| 24 | + |
| 25 | + <!-- Joint interfaces --> |
22 | 26 | <joint name="robotiq_85_left_knuckle_joint">
|
23 |
| - <param name="initial_position">0.7929</param> |
| 27 | + <!-- With Ignition, we have mimic joints, so we only need this command interface activated --> |
| 28 | + <xacro:if value="${sim_ignition}"> |
| 29 | + <state_interface name="position"> |
| 30 | + <param name="initial_value">0.2</param> |
| 31 | + </state_interface> |
| 32 | + </xacro:if> |
| 33 | + <xacro:unless value="${sim_ignition}"> |
| 34 | + <param name="initial_position">0.7929</param> |
| 35 | + <state_interface name="position"/> |
| 36 | + </xacro:unless> |
| 37 | + |
24 | 38 | <command_interface name="position" />
|
25 |
| - <state_interface name="position"/> |
26 | 39 | <state_interface name="velocity"/>
|
27 | 40 | </joint>
|
28 | 41 | <joint name="robotiq_85_right_knuckle_joint">
|
29 | 42 | <param name="mimic">robotiq_85_left_knuckle_joint</param>
|
30 | 43 | <param name="multiplier">-1</param>
|
31 |
| - <command_interface name="position"/> |
32 |
| - <state_interface name="position"/> |
33 |
| - <state_interface name="velocity"/> |
| 44 | + <xacro:unless value="${sim_ignition}"> |
| 45 | + <command_interface name="position"/> |
| 46 | + <state_interface name="position"/> |
| 47 | + <state_interface name="velocity"/> |
| 48 | + </xacro:unless> |
34 | 49 | </joint>
|
35 | 50 | <joint name="robotiq_85_left_inner_knuckle_joint">
|
36 | 51 | <param name="mimic">robotiq_85_left_knuckle_joint</param>
|
37 | 52 | <param name="multiplier">1</param>
|
38 |
| - <command_interface name="position" /> |
39 |
| - <state_interface name="position" /> |
40 |
| - <state_interface name="velocity" /> |
| 53 | + <xacro:unless value="${sim_ignition}"> |
| 54 | + <command_interface name="position"/> |
| 55 | + <state_interface name="position"/> |
| 56 | + <state_interface name="velocity"/> |
| 57 | + </xacro:unless> |
41 | 58 | </joint>
|
42 | 59 | <joint name="robotiq_85_right_inner_knuckle_joint">
|
43 | 60 | <param name="mimic">robotiq_85_left_knuckle_joint</param>
|
44 | 61 | <param name="multiplier">-1</param>
|
45 |
| - <command_interface name="position" /> |
46 |
| - <state_interface name="position" /> |
47 |
| - <state_interface name="velocity" /> |
| 62 | + <xacro:unless value="${sim_ignition}"> |
| 63 | + <command_interface name="position"/> |
| 64 | + <state_interface name="position"/> |
| 65 | + <state_interface name="velocity"/> |
| 66 | + </xacro:unless> |
48 | 67 | </joint>
|
49 | 68 | <joint name="robotiq_85_left_finger_tip_joint">
|
50 | 69 | <param name="mimic">robotiq_85_left_knuckle_joint</param>
|
51 | 70 | <param name="multiplier">-1</param>
|
52 |
| - <command_interface name="position" /> |
53 |
| - <state_interface name="position" /> |
54 |
| - <state_interface name="velocity" /> |
| 71 | + <xacro:unless value="${sim_ignition}"> |
| 72 | + <command_interface name="position"/> |
| 73 | + <state_interface name="position"/> |
| 74 | + <state_interface name="velocity"/> |
| 75 | + </xacro:unless> |
55 | 76 | </joint>
|
56 | 77 | <joint name="robotiq_85_right_finger_tip_joint">
|
57 | 78 | <param name="mimic">robotiq_85_left_knuckle_joint</param>
|
58 | 79 | <param name="multiplier">1</param>
|
59 |
| - <command_interface name="position" /> |
60 |
| - <state_interface name="position" /> |
61 |
| - <state_interface name="velocity" /> |
| 80 | + <xacro:unless value="${sim_ignition}"> |
| 81 | + <command_interface name="position"/> |
| 82 | + <state_interface name="position"/> |
| 83 | + <state_interface name="velocity"/> |
| 84 | + </xacro:unless> |
62 | 85 | </joint>
|
63 |
| - <gpio name="reactivate_gripper"> |
64 |
| - <command_interface name="reactivate_gripper_cmd" /> |
65 |
| - <command_interface name="reactivate_gripper_response" /> |
66 |
| - </gpio> |
| 86 | + |
| 87 | + <!-- Only add this with fake hardware mode --> |
| 88 | + <xacro:unless value="${sim_ignition or sim_isaac}"> |
| 89 | + <gpio name="reactivate_gripper"> |
| 90 | + <command_interface name="reactivate_gripper_cmd" /> |
| 91 | + <command_interface name="reactivate_gripper_response" /> |
| 92 | + </gpio> |
| 93 | + </xacro:unless> |
| 94 | + |
67 | 95 | </ros2_control>
|
68 | 96 | </xacro:macro>
|
69 | 97 |
|
|
0 commit comments