|
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="name"> |
| 4 | + <xacro:macro name="robotiq_sim_gripper_ros2_control" |
| 5 | + params="name sim_ignition:=false sim_isaac:=false use_fake_hardware:=true"> |
| 6 | + |
5 | 7 | <ros2_control name="${name}" type="system">
|
| 8 | + <!-- Plugins --> |
6 | 9 | <hardware>
|
7 |
| - <plugin>fake_components/GenericSystem</plugin> |
| 10 | + <xacro:if value="${sim_isaac}"> |
| 11 | + <plugin>isaac_ros2_control/IsaacSystem</plugin> |
| 12 | + <param name="joint_commands_topic">/isaac_joint_commands</param> |
| 13 | + <param name="joint_states_topic">/isaac_joint_states</param> |
| 14 | + </xacro:if> |
| 15 | + <xacro:if value="${sim_ignition}"> |
| 16 | + <plugin>ign_ros2_control/IgnitionSystem</plugin> |
| 17 | + </xacro:if> |
| 18 | + <xacro:if value="${use_fake_hardware}"> |
| 19 | + <plugin>mock_components/GenericSystem</plugin> |
| 20 | + <param name="fake_sensor_commands">${fake_sensor_commands}</param> |
| 21 | + <param name="state_following_offset">0.0</param> |
| 22 | + </xacro:if> |
8 | 23 | </hardware>
|
| 24 | + |
| 25 | + <!-- Joint interfaces --> |
9 | 26 | <joint name="robotiq_85_left_knuckle_joint">
|
10 |
| - <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 | + |
11 | 38 | <command_interface name="position" />
|
12 |
| - <state_interface name="position"/> |
13 | 39 | <state_interface name="velocity"/>
|
14 | 40 | </joint>
|
15 | 41 | <joint name="robotiq_85_right_knuckle_joint">
|
16 | 42 | <param name="mimic">robotiq_85_left_knuckle_joint</param>
|
17 | 43 | <param name="multiplier">-1</param>
|
18 |
| - <command_interface name="position"/> |
19 |
| - <state_interface name="position"/> |
20 |
| - <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> |
21 | 49 | </joint>
|
22 | 50 | <joint name="robotiq_85_left_inner_knuckle_joint">
|
23 | 51 | <param name="mimic">robotiq_85_left_knuckle_joint</param>
|
24 | 52 | <param name="multiplier">1</param>
|
25 |
| - <command_interface name="position" /> |
26 |
| - <state_interface name="position" /> |
27 |
| - <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> |
28 | 58 | </joint>
|
29 | 59 | <joint name="robotiq_85_right_inner_knuckle_joint">
|
30 | 60 | <param name="mimic">robotiq_85_left_knuckle_joint</param>
|
31 | 61 | <param name="multiplier">-1</param>
|
32 |
| - <command_interface name="position" /> |
33 |
| - <state_interface name="position" /> |
34 |
| - <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> |
35 | 67 | </joint>
|
36 | 68 | <joint name="robotiq_85_left_finger_tip_joint">
|
37 | 69 | <param name="mimic">robotiq_85_left_knuckle_joint</param>
|
38 | 70 | <param name="multiplier">-1</param>
|
39 |
| - <command_interface name="position" /> |
40 |
| - <state_interface name="position" /> |
41 |
| - <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> |
42 | 76 | </joint>
|
43 | 77 | <joint name="robotiq_85_right_finger_tip_joint">
|
44 | 78 | <param name="mimic">robotiq_85_left_knuckle_joint</param>
|
45 | 79 | <param name="multiplier">1</param>
|
46 |
| - <command_interface name="position" /> |
47 |
| - <state_interface name="position" /> |
48 |
| - <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> |
49 | 85 | </joint>
|
50 |
| - <gpio name="reactivate_gripper"> |
51 |
| - <command_interface name="reactivate_gripper_cmd" /> |
52 |
| - <command_interface name="reactivate_gripper_response" /> |
53 |
| - </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 | + |
54 | 95 | </ros2_control>
|
55 | 96 | </xacro:macro>
|
56 | 97 |
|
|
0 commit comments