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
69
70
      </joint>
      <joint name="FLHFE">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
71
72
          <param name="min">-1.7</param>
          <param name="max">1.7</param>
Paul Rouanet's avatar
Paul Rouanet committed
73
74
75
76
77
        </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
78
        <command_interface name="effort">
Paul Rouanet's avatar
Paul Rouanet committed
79
80
81
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
82
83
84
85
86
87
88
89
        <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
90
91
        <state_interface name="position"/>
        <state_interface name="velocity"/>
Paul Rouanet's avatar
Paul Rouanet committed
92
        <state_interface name="effort"/>
Paul Rouanet's avatar
Paul Rouanet committed
93
94
        <state_interface name="gain_kp"/>
        <state_interface name="gain_kd"/>
95
        <param name="motor_number">3</param>
96
97
98
99
100
        <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>
101
        <param name="motor_reversed_polarity">${true}</param>
Paul Rouanet's avatar
Paul Rouanet committed
102
        <param name="position_offset">-0.308</param>
Paul Rouanet's avatar
Paul Rouanet committed
103
104
105
      </joint>
      <joint name="FLK">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
106
107
          <param name="min">-3.4</param>
          <param name="max">3.4</param>
Paul Rouanet's avatar
Paul Rouanet committed
108
109
110
111
112
        </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
113
        <command_interface name="effort">
Paul Rouanet's avatar
Paul Rouanet committed
114
115
116
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
117
118
119
120
121
122
123
124
        <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
125
126
        <state_interface name="position"/>
        <state_interface name="velocity"/>
Paul Rouanet's avatar
Paul Rouanet committed
127
        <state_interface name="effort"/>
Paul Rouanet's avatar
Paul Rouanet committed
128
129
        <state_interface name="gain_kp"/>
        <state_interface name="gain_kd"/>
Paul Rouanet's avatar
Paul Rouanet committed
130
        <param name="motor_number">2</param>
131
132
133
134
135
        <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>
136
        <param name="motor_reversed_polarity">${true}</param>
Paul Rouanet's avatar
Paul Rouanet committed
137
        <param name="position_offset">0.276</param>
Paul Rouanet's avatar
Paul Rouanet committed
138
139
140
141
      </joint>
      <joint name="FRHAA">
        <command_interface name="position">
          <param name="min">-0.5</param>
Paul Rouanet's avatar
Paul Rouanet committed
142
          <param name="max">0.5</param>
Paul Rouanet's avatar
Paul Rouanet committed
143
144
145
146
147
        </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
148
        <command_interface name="effort">
Paul Rouanet's avatar
Paul Rouanet committed
149
150
151
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
152
153
154
155
156
157
158
159
        <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
160
161
        <state_interface name="position"/>
        <state_interface name="velocity"/>
Paul Rouanet's avatar
Paul Rouanet committed
162
        <state_interface name="effort"/>
Paul Rouanet's avatar
Paul Rouanet committed
163
164
        <state_interface name="gain_kp"/>
        <state_interface name="gain_kd"/>
165
        <param name="motor_number">1</param>
166
167
168
169
170
        <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>
171
        <param name="motor_reversed_polarity">${true}</param>
Paul Rouanet's avatar
Paul Rouanet committed
172
        <param name="position_offset">-0.115</param>
Paul Rouanet's avatar
Paul Rouanet committed
173
174
175
      </joint>
      <joint name="FRHFE">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
176
177
          <param name="min">-1.7</param>
          <param name="max">1.7</param>
Paul Rouanet's avatar
Paul Rouanet committed
178
179
180
181
182
        </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
183
        <command_interface name="effort">
Paul Rouanet's avatar
Paul Rouanet committed
184
185
186
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
187
188
189
190
191
192
193
194
        <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
195
196
        <state_interface name="position"/>
        <state_interface name="velocity"/>
Paul Rouanet's avatar
Paul Rouanet committed
197
        <state_interface name="effort"/>
Paul Rouanet's avatar
Paul Rouanet committed
198
199
        <state_interface name="gain_kp"/>
        <state_interface name="gain_kd"/>
200
        <param name="motor_number">5</param>
201
202
203
204
205
        <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>
206
        <param name="motor_reversed_polarity">${false}</param>
Paul Rouanet's avatar
Paul Rouanet committed
207
        <param name="position_offset">-0.584</param>
Paul Rouanet's avatar
Paul Rouanet committed
208
209
210
      </joint>
      <joint name="FRK">
        <command_interface name="position">
Paul Rouanet's avatar
Paul Rouanet committed
211
212
          <param name="min">-3.4</param>
          <param name="max">3.4</param>
Paul Rouanet's avatar
Paul Rouanet committed
213
214
215
216
        </command_interface>
        <command_interface name="velocity">
          <param name="min">-1</param>
          <param name="max">1</param>
Paul Rouanet's avatar
Paul Rouanet committed
217
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
218
        <command_interface name="effort">
Paul Rouanet's avatar
Paul Rouanet committed
219
220
221
          <param name="min">-1</param>
          <param name="max">1</param>
        </command_interface>
Paul Rouanet's avatar
Paul Rouanet committed
222
223
224
225
226
227
228
229
        <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
230
231
        <state_interface name="position"/>
        <state_interface name="velocity"/>
Paul Rouanet's avatar
Paul Rouanet committed
232
        <state_interface name="effort"/>
Paul Rouanet's avatar
Paul Rouanet committed
233
234
        <state_interface name="gain_kp"/>
        <state_interface name="gain_kd"/>
235
        <param name="motor_number">4</param>
236
237
238
239
240
        <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>
241
        <param name="motor_reversed_polarity">${false}</param>
Paul Rouanet's avatar
Paul Rouanet committed
242
        <param name="position_offset">0.432</param>
Paul Rouanet's avatar
Paul Rouanet committed
243
      </joint>
Paul Rouanet's avatar
Paul Rouanet committed
244
      <sensor name="IMU">
Paul Rouanet's avatar
Paul Rouanet committed
245
246
        <state_interface name="gyroscope"/>
        <state_interface name="accelerometer"/>
Paul Rouanet's avatar
Paul Rouanet committed
247
        <state_interface name="linear_acceleration"/>
Paul Rouanet's avatar
Paul Rouanet committed
248
249
        <state_interface name="attitude_euler"/>
        <state_interface name="attitude_quaternion"/>
250
251
        <param name="rotate_vector">"1 2 3"</param>
        <param name="orientation_vector">"1 2 3 4"</param>
Paul Rouanet's avatar
Paul Rouanet committed
252
      </sensor>
Paul Rouanet's avatar
Paul Rouanet committed
253
254
255
256
257
258
    </ros2_control>

  </xacro:macro>

</robot>