system_bolt.ros2_control.xacro 10.2 KB
Newer Older
Paul Rouanet's avatar
Paul Rouanet committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">

  <xacro:macro name="system_bolt" params="name prefix use_sim:=^|false use_fake_hardware:=^|true fake_sensor_commands:=^|false slowdown:=2.0">

    <ros2_control name="${name}" type="system">

      <xacro:if value="$(arg use_sim)">
        <hardware>
          <plugin>gazebo_ros2_control/GazeboSystem</plugin>
        </hardware>
      </xacro:if>
      <xacro:unless value="$(arg use_sim)">
        <hardware>
          <xacro:if value="${use_fake_hardware}">
            <plugin>fake_components/GenericSystem</plugin>
            <param name="fake_sensor_commands">${fake_sensor_commands}</param>
            <param name="state_following_offset">0.0</param>
          </xacro:if>
          <xacro:unless value="${use_fake_hardware}">
            <plugin>ros2_hardware_interface_bolt/SystemBoltMultiInterfaceHardware</plugin>
            <param name="example_param_hw_start_duration_sec">2.0</param>
            <param name="example_param_hw_stop_duration_sec">3.0</param>
            <param name="example_param_hw_slowdown">${slowdown}</param>
Paul Rouanet's avatar
Paul Rouanet committed
25
            <param name="eth_interface">${enp3s0}</param>
Paul Rouanet's avatar
Paul Rouanet committed
26
27
28
29
            <param name="calib_kp">3.</param>
            <param name="calib_kd">0.05</param>
            <param name="calib_T">2.</param>
            <param name="calib_dt">0.001</param>
Paul Rouanet's avatar
Paul Rouanet committed
30
            </xacro:unless>
Paul Rouanet's avatar
Paul Rouanet committed
31
32
33
34
35
        </hardware>
      </xacro:unless>

      <joint name="FLHAA">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
36
          <param name="min">-0.5</param>
Paul Rouanet's avatar
Paul Rouanet committed
37
38
39
40
41
42
          <param name="max">0.5</param>
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
43
        <command_interface name="effort">
Paul Rouanet's avatar
Paul Rouanet committed
44
45
46
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
47
48
49
50
51
52
53
54
        <command_interface name="gain_kp">
          <param name="min">-1000</param>
          <param name="max">1000</param>
        </command_interface>
        <command_interface name="gain_kd">
          <param name="min">-1000</param>
          <param name="max">1000</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
55
56
        <state_interface name="position"/>
        <state_interface name="velocity"/>
Paul Rouanet's avatar
Paul Rouanet committed
57
        <state_interface name="effort"/>
Paul Rouanet's avatar
Paul Rouanet committed
58
59
        <state_interface name="gain_kp"/>
        <state_interface name="gain_kd"/>
Paul Rouanet's avatar
Paul Rouanet committed
60
        <param name="motor_number">0</param>
61
62
63
64
65
        <param name="gear_ratio">9.</param>
        <param name="motor_constant">0.025</param>
        <param name="max_current">12.</param>
        <param name="max_joint_velocity">80.</param>
        <param name="safety_damping">0.5</param>
66
        <param name="motor_reversed_polarity">${true}</param>
Paul Rouanet's avatar
Paul Rouanet committed
67
        <param name="position_offset">0.238</param>
Paul Rouanet's avatar
Paul Rouanet committed
68
      </joint>
Paul Rouanet's avatar
Paul Rouanet committed
69
      
Paul Rouanet's avatar
Paul Rouanet committed
70
71
      <joint name="FLHFE">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
72
73
          <param name="min">-1.7</param>
          <param name="max">1.7</param>
Paul Rouanet's avatar
Paul Rouanet committed
74
75
76
77
78
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
79
        <command_interface name="effort">
Paul Rouanet's avatar
Paul Rouanet committed
80
81
82
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
83
84
85
86
87
88
89
90
        <command_interface name="gain_kp">
          <param name="min">-1000</param>
          <param name="max">1000</param>
        </command_interface>
        <command_interface name="gain_kd">
          <param name="min">-1000</param>
          <param name="max">1000</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
91
92
        <state_interface name="position"/>
        <state_interface name="velocity"/>
Paul Rouanet's avatar
Paul Rouanet committed
93
        <state_interface name="effort"/>
Paul Rouanet's avatar
Paul Rouanet committed
94
95
        <state_interface name="gain_kp"/>
        <state_interface name="gain_kd"/>
96
        <param name="motor_number">3</param>
97
98
99
100
101
        <param name="gear_ratio">9.</param>
        <param name="motor_constant">0.025</param>
        <param name="max_current">12.</param>
        <param name="max_joint_velocity">80.</param>
        <param name="safety_damping">0.5</param>
102
        <param name="motor_reversed_polarity">${true}</param>
Paul Rouanet's avatar
Paul Rouanet committed
103
        <param name="position_offset">-0.308</param>
Paul Rouanet's avatar
Paul Rouanet committed
104
      </joint>
Paul Rouanet's avatar
Paul Rouanet committed
105

Paul Rouanet's avatar
Paul Rouanet committed
106
107
      <joint name="FLK">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
108
109
          <param name="min">-3.4</param>
          <param name="max">3.4</param>
Paul Rouanet's avatar
Paul Rouanet committed
110
111
112
113
114
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
115
        <command_interface name="effort">
Paul Rouanet's avatar
Paul Rouanet committed
116
117
118
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
119
120
121
122
123
124
125
126
        <command_interface name="gain_kp">
          <param name="min">-1000</param>
          <param name="max">1000</param>
        </command_interface>
        <command_interface name="gain_kd">
          <param name="min">-1000</param>
          <param name="max">1000</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
127
128
        <state_interface name="position"/>
        <state_interface name="velocity"/>
Paul Rouanet's avatar
Paul Rouanet committed
129
        <state_interface name="effort"/>
Paul Rouanet's avatar
Paul Rouanet committed
130
131
        <state_interface name="gain_kp"/>
        <state_interface name="gain_kd"/>
Paul Rouanet's avatar
Paul Rouanet committed
132
        <param name="motor_number">2</param>
133
134
135
136
137
        <param name="gear_ratio">9.</param>
        <param name="motor_constant">0.025</param>
        <param name="max_current">12.</param>
        <param name="max_joint_velocity">80.</param>
        <param name="safety_damping">0.5</param>
138
        <param name="motor_reversed_polarity">${true}</param>
Paul Rouanet's avatar
Paul Rouanet committed
139
        <param name="position_offset">0.276</param>
Paul Rouanet's avatar
Paul Rouanet committed
140
      </joint>
Paul Rouanet's avatar
Paul Rouanet committed
141

Paul Rouanet's avatar
Paul Rouanet committed
142
143
144
      <joint name="FRHAA">
        <command_interface name="position">
          <param name="min">-0.5</param>
Paul Rouanet's avatar
Paul Rouanet committed
145
          <param name="max">0.5</param>
Paul Rouanet's avatar
Paul Rouanet committed
146
147
148
149
150
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
151
        <command_interface name="effort">
Paul Rouanet's avatar
Paul Rouanet committed
152
153
154
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
155
156
157
158
159
160
161
162
        <command_interface name="gain_kp">
          <param name="min">-1000</param>
          <param name="max">1000</param>
        </command_interface>
        <command_interface name="gain_kd">
          <param name="min">-1000</param>
          <param name="max">1000</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
163
164
        <state_interface name="position"/>
        <state_interface name="velocity"/>
Paul Rouanet's avatar
Paul Rouanet committed
165
        <state_interface name="effort"/>
Paul Rouanet's avatar
Paul Rouanet committed
166
167
        <state_interface name="gain_kp"/>
        <state_interface name="gain_kd"/>
168
        <param name="motor_number">1</param>
169
170
171
172
173
        <param name="gear_ratio">9.</param>
        <param name="motor_constant">0.025</param>
        <param name="max_current">12.</param>
        <param name="max_joint_velocity">80.</param>
        <param name="safety_damping">0.5</param>
174
        <param name="motor_reversed_polarity">${true}</param>
Paul Rouanet's avatar
Paul Rouanet committed
175
        <param name="position_offset">-0.115</param>
Paul Rouanet's avatar
Paul Rouanet committed
176
      </joint>
Paul Rouanet's avatar
Paul Rouanet committed
177

Paul Rouanet's avatar
Paul Rouanet committed
178
179
      <joint name="FRHFE">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
180
181
          <param name="min">-1.7</param>
          <param name="max">1.7</param>
Paul Rouanet's avatar
Paul Rouanet committed
182
183
184
185
186
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
187
        <command_interface name="effort">
Paul Rouanet's avatar
Paul Rouanet committed
188
189
190
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
191
192
193
194
195
196
197
198
        <command_interface name="gain_kp">
          <param name="min">-1000</param>
          <param name="max">1000</param>
        </command_interface>
        <command_interface name="gain_kd">
          <param name="min">-1000</param>
          <param name="max">1000</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
199
200
        <state_interface name="position"/>
        <state_interface name="velocity"/>
Paul Rouanet's avatar
Paul Rouanet committed
201
        <state_interface name="effort"/>
Paul Rouanet's avatar
Paul Rouanet committed
202
203
        <state_interface name="gain_kp"/>
        <state_interface name="gain_kd"/>
204
        <param name="motor_number">5</param>
205
206
207
208
209
        <param name="gear_ratio">9.</param>
        <param name="motor_constant">0.025</param>
        <param name="max_current">12.</param>
        <param name="max_joint_velocity">80.</param>
        <param name="safety_damping">0.5</param>
210
        <param name="motor_reversed_polarity">${false}</param>
Paul Rouanet's avatar
Paul Rouanet committed
211
        <param name="position_offset">-0.584</param>
Paul Rouanet's avatar
Paul Rouanet committed
212
      </joint>
Paul Rouanet's avatar
Paul Rouanet committed
213

Paul Rouanet's avatar
Paul Rouanet committed
214
215
      <joint name="FRK">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
216
217
          <param name="min">-3.4</param>
          <param name="max">3.4</param>
Paul Rouanet's avatar
Paul Rouanet committed
218
219
220
221
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
Paul Rouanet's avatar
Paul Rouanet committed
222
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
223
        <command_interface name="effort">
Paul Rouanet's avatar
Paul Rouanet committed
224
225
226
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
227
228
229
230
231
232
233
234
        <command_interface name="gain_kp">
          <param name="min">-1000</param>
          <param name="max">1000</param>
        </command_interface>
        <command_interface name="gain_kd">
          <param name="min">-1000</param>
          <param name="max">1000</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
235
236
        <state_interface name="position"/>
        <state_interface name="velocity"/>
Paul Rouanet's avatar
Paul Rouanet committed
237
        <state_interface name="effort"/>
Paul Rouanet's avatar
Paul Rouanet committed
238
239
        <state_interface name="gain_kp"/>
        <state_interface name="gain_kd"/>
240
        <param name="motor_number">4</param>
241
242
243
244
245
        <param name="gear_ratio">9.</param>
        <param name="motor_constant">0.025</param>
        <param name="max_current">12.</param>
        <param name="max_joint_velocity">80.</param>
        <param name="safety_damping">0.5</param>
246
        <param name="motor_reversed_polarity">${false}</param>
Paul Rouanet's avatar
Paul Rouanet committed
247
        <param name="position_offset">0.432</param>
Paul Rouanet's avatar
Paul Rouanet committed
248
      </joint>
Paul Rouanet's avatar
Paul Rouanet committed
249

Paul Rouanet's avatar
Paul Rouanet committed
250
      <sensor name="IMU">
Paul Rouanet's avatar
Paul Rouanet committed
251
252
        <state_interface name="gyroscope"/>
        <state_interface name="accelerometer"/>
Paul Rouanet's avatar
Paul Rouanet committed
253
        <state_interface name="linear_acceleration"/>
Paul Rouanet's avatar
Paul Rouanet committed
254
255
        <state_interface name="attitude_euler"/>
        <state_interface name="attitude_quaternion"/>
256
257
        <param name="rotate_vector">"1 2 3"</param>
        <param name="orientation_vector">"1 2 3 4"</param>
Paul Rouanet's avatar
Paul Rouanet committed
258
      </sensor>
Paul Rouanet's avatar
Paul Rouanet committed
259
260
261
262
263
264
    </ros2_control>

  </xacro:macro>

</robot>