ros2_control - rolling
Loading...
Searching...
No Matches
descriptions.hpp
1// Copyright 2020 ros2_control Development Team
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef ROS2_CONTROL_TEST_ASSETS__DESCRIPTIONS_HPP_
16#define ROS2_CONTROL_TEST_ASSETS__DESCRIPTIONS_HPP_
17
18#include <string>
19#include <vector>
20
21namespace ros2_control_test_assets
22{
23const auto urdf_head =
24 R"(
25<?xml version="1.0" encoding="utf-8"?>
26<robot name="MinimalRobot">
27 <!-- Used for fixing robot -->
28 <link name="world"/>
29 <joint name="base_joint" type="fixed">
30 <origin rpy="0 0 0" xyz="0 0 0"/>
31 <parent link="world"/>
32 <child link="base_link"/>
33 </joint>
34 <link name="base_link">
35 <inertial>
36 <mass value="0.01"/>
37 <origin xyz="0 0 0"/>
38 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
39 </inertial>
40 <visual>
41 <origin rpy="0 0 0" xyz="0 0 0"/>
42 <geometry>
43 <cylinder length="0.2" radius="0.1"/>
44 </geometry>
45 <material name="DarkGrey">
46 <color rgba="0.4 0.4 0.4 1.0"/>
47 </material>
48 </visual>
49 <collision>
50 <origin rpy="0 0 0" xyz="0 0 0"/>
51 <geometry>
52 <cylinder length="1" radius="0.1"/>
53 </geometry>
54 </collision>
55 </link>
56 <joint name="joint1" type="revolute">
57 <origin rpy="-1.57079632679 0 0" xyz="0 0 0.2"/>
58 <parent link="base_link"/>
59 <child link="link1"/>
60 <limit effort="0.1" lower="-3.14159265359" upper="3.14159265359" velocity="0.2"/>
61 </joint>
62 <link name="link1">
63 <inertial>
64 <mass value="0.01"/>
65 <origin xyz="0 0 0"/>
66 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
67 </inertial>
68 <visual>
69 <origin rpy="0 0 0" xyz="0 0 0"/>
70 <geometry>
71 <cylinder length="1" radius="0.1"/>
72 </geometry>
73 <material name="DarkGrey">
74 <color rgba="0.4 0.4 0.4 1.0"/>
75 </material>
76 </visual>
77 <collision>
78 <origin rpy="0 0 0" xyz="0 0 0"/>
79 <geometry>
80 <cylinder length="1" radius="0.1"/>
81 </geometry>
82 </collision>
83 </link>
84 <joint name="joint2" type="revolute">
85 <origin rpy="1.57079632679 0 0" xyz="0 0 0.9"/>
86 <parent link="link1"/>
87 <child link="link2"/>
88 <limit effort="0.1" lower="-3.14159265359" upper="3.14159265359" velocity="0.2"/>
89 <safety_controller soft_lower_limit="-1.5" soft_upper_limit="0.5" k_position="10.0" k_velocity="20.0"/>
90 </joint>
91 <link name="link2">
92 <inertial>
93 <mass value="0.01"/>
94 <origin xyz="0 0 0"/>
95 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
96 </inertial>
97 <visual>
98 <origin rpy="0 0 0" xyz="0 0 0"/>
99 <geometry>
100 <cylinder length="1" radius="0.1"/>
101 </geometry>
102 <material name="DarkGrey">
103 <color rgba="0.4 0.4 0.4 1.0"/>
104 </material>
105 </visual>
106 <collision>
107 <origin rpy="0 0 0" xyz="0 0 0"/>
108 <geometry>
109 <cylinder length="1" radius="0.1"/>
110 </geometry>
111 </collision>
112 </link>
113 <joint name="joint3" type="revolute">
114 <origin rpy="1.57079632679 0 0" xyz="0 0 0.9"/>
115 <parent link="link2"/>
116 <child link="link3"/>
117 <limit effort="0.1" lower="-3.14159265359" upper="3.14159265359" velocity="0.2"/>
118 </joint>
119 <link name="link3">
120 <inertial>
121 <mass value="0.01"/>
122 <origin xyz="0 0 0"/>
123 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
124 </inertial>
125 <visual>
126 <origin rpy="0 0 0" xyz="0 0 0"/>
127 <geometry>
128 <cylinder length="1" radius="0.1"/>
129 </geometry>
130 <material name="DarkGrey">
131 <color rgba="0.4 0.4 0.4 1.0"/>
132 </material>
133 </visual>
134 <collision>
135 <origin rpy="0 0 0" xyz="0 0 0"/>
136 <geometry>
137 <cylinder length="1" radius="0.1"/>
138 </geometry>
139 </collision>
140 </link>
141 <joint name="tool_joint" type="fixed">
142 <origin rpy="0 0 0" xyz="0 0 1"/>
143 <parent link="link2"/>
144 <child link="tool_link"/>
145 </joint>
146 <link name="tool_link">
147 </link>
148)";
149
150const auto urdf_head_revolute_missing_limits =
151 R"(
152<?xml version="1.0" encoding="utf-8"?>
153<robot name="MinimalRobot">
154 <!-- Used for fixing robot -->
155 <link name="world"/>
156 <joint name="base_joint" type="fixed">
157 <origin rpy="0 0 0" xyz="0 0 0"/>
158 <parent link="world"/>
159 <child link="base_link"/>
160 </joint>
161 <link name="base_link">
162 <inertial>
163 <mass value="0.01"/>
164 <origin xyz="0 0 0"/>
165 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
166 </inertial>
167 <visual>
168 <origin rpy="0 0 0" xyz="0 0 0"/>
169 <geometry>
170 <cylinder length="0.2" radius="0.1"/>
171 </geometry>
172 <material name="DarkGrey">
173 <color rgba="0.4 0.4 0.4 1.0"/>
174 </material>
175 </visual>
176 <collision>
177 <origin rpy="0 0 0" xyz="0 0 0"/>
178 <geometry>
179 <cylinder length="1" radius="0.1"/>
180 </geometry>
181 </collision>
182 </link>
183 <joint name="joint1" type="revolute">
184 <origin rpy="-1.57079632679 0 0" xyz="0 0 0.2"/>
185 <parent link="base_link"/>
186 <child link="link1"/>
187 </joint>
188 <link name="link1">
189 <inertial>
190 <mass value="0.01"/>
191 <origin xyz="0 0 0"/>
192 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
193 </inertial>
194 <visual>
195 <origin rpy="0 0 0" xyz="0 0 0"/>
196 <geometry>
197 <cylinder length="1" radius="0.1"/>
198 </geometry>
199 <material name="DarkGrey">
200 <color rgba="0.4 0.4 0.4 1.0"/>
201 </material>
202 </visual>
203 <collision>
204 <origin rpy="0 0 0" xyz="0 0 0"/>
205 <geometry>
206 <cylinder length="1" radius="0.1"/>
207 </geometry>
208 </collision>
209 </link>
210 <joint name="joint2" type="revolute">
211 <origin rpy="1.57079632679 0 0" xyz="0 0 0.9"/>
212 <parent link="link1"/>
213 <child link="link2"/>
214 <limit effort="0.1" lower="-3.14159265359" upper="3.14159265359" velocity="0.2"/>
215 </joint>
216 <link name="link2">
217 <inertial>
218 <mass value="0.01"/>
219 <origin xyz="0 0 0"/>
220 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
221 </inertial>
222 <visual>
223 <origin rpy="0 0 0" xyz="0 0 0"/>
224 <geometry>
225 <cylinder length="1" radius="0.1"/>
226 </geometry>
227 <material name="DarkGrey">
228 <color rgba="0.4 0.4 0.4 1.0"/>
229 </material>
230 </visual>
231 <collision>
232 <origin rpy="0 0 0" xyz="0 0 0"/>
233 <geometry>
234 <cylinder length="1" radius="0.1"/>
235 </geometry>
236 </collision>
237 </link>
238)";
239
240const auto urdf_head_continuous_missing_limits =
241 R"(
242<?xml version="1.0" encoding="utf-8"?>
243<robot name="MinimalRobot">
244 <!-- Used for fixing robot -->
245 <link name="world"/>
246 <joint name="base_joint" type="fixed">
247 <origin rpy="0 0 0" xyz="0 0 0"/>
248 <parent link="world"/>
249 <child link="base_link"/>
250 </joint>
251 <link name="base_link">
252 <inertial>
253 <mass value="0.01"/>
254 <origin xyz="0 0 0"/>
255 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
256 </inertial>
257 <visual>
258 <origin rpy="0 0 0" xyz="0 0 0"/>
259 <geometry>
260 <cylinder length="0.2" radius="0.1"/>
261 </geometry>
262 <material name="DarkGrey">
263 <color rgba="0.4 0.4 0.4 1.0"/>
264 </material>
265 </visual>
266 <collision>
267 <origin rpy="0 0 0" xyz="0 0 0"/>
268 <geometry>
269 <cylinder length="1" radius="0.1"/>
270 </geometry>
271 </collision>
272 </link>
273 <joint name="joint1" type="continuous">
274 <origin rpy="-1.57079632679 0 0" xyz="0 0 0.2"/>
275 <parent link="base_link"/>
276 <child link="link1"/>
277 </joint>
278 <link name="link1">
279 <inertial>
280 <mass value="0.01"/>
281 <origin xyz="0 0 0"/>
282 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
283 </inertial>
284 <visual>
285 <origin rpy="0 0 0" xyz="0 0 0"/>
286 <geometry>
287 <cylinder length="1" radius="0.1"/>
288 </geometry>
289 <material name="DarkGrey">
290 <color rgba="0.4 0.4 0.4 1.0"/>
291 </material>
292 </visual>
293 <collision>
294 <origin rpy="0 0 0" xyz="0 0 0"/>
295 <geometry>
296 <cylinder length="1" radius="0.1"/>
297 </geometry>
298 </collision>
299 </link>
300 <joint name="joint2" type="continuous">
301 <origin rpy="1.57079632679 0 0" xyz="0 0 0.9"/>
302 <parent link="link1"/>
303 <child link="link2"/>
304 </joint>
305 <link name="link2">
306 <inertial>
307 <mass value="0.01"/>
308 <origin xyz="0 0 0"/>
309 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
310 </inertial>
311 <visual>
312 <origin rpy="0 0 0" xyz="0 0 0"/>
313 <geometry>
314 <cylinder length="1" radius="0.1"/>
315 </geometry>
316 <material name="DarkGrey">
317 <color rgba="0.4 0.4 0.4 1.0"/>
318 </material>
319 </visual>
320 <collision>
321 <origin rpy="0 0 0" xyz="0 0 0"/>
322 <geometry>
323 <cylinder length="1" radius="0.1"/>
324 </geometry>
325 </collision>
326 </link>
327 <joint name="joint3" type="revolute">
328 <origin rpy="1.57079632679 0 0" xyz="0 0 0.9"/>
329 <parent link="link2"/>
330 <child link="link3"/>
331 <limit effort="0.1" lower="-3.14159265359" upper="3.14159265359" velocity="0.2"/>
332 </joint>
333 <link name="link3">
334 <inertial>
335 <mass value="0.01"/>
336 <origin xyz="0 0 0"/>
337 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
338 </inertial>
339 <visual>
340 <origin rpy="0 0 0" xyz="0 0 0"/>
341 <geometry>
342 <cylinder length="1" radius="0.1"/>
343 </geometry>
344 <material name="DarkGrey">
345 <color rgba="0.4 0.4 0.4 1.0"/>
346 </material>
347 </visual>
348 <collision>
349 <origin rpy="0 0 0" xyz="0 0 0"/>
350 <geometry>
351 <cylinder length="1" radius="0.1"/>
352 </geometry>
353 </collision>
354 </link>
355 <joint name="tool_joint" type="fixed">
356 <origin rpy="0 0 0" xyz="0 0 1"/>
357 <parent link="link2"/>
358 <child link="tool_link"/>
359 </joint>
360 <link name="tool_link">
361 </link>
362)";
363
364const auto urdf_head_continuous_with_limits =
365 R"(
366<?xml version="1.0" encoding="utf-8"?>
367<robot name="MinimalRobot">
368 <!-- Used for fixing robot -->
369 <link name="world"/>
370 <joint name="base_joint" type="fixed">
371 <origin rpy="0 0 0" xyz="0 0 0"/>
372 <parent link="world"/>
373 <child link="base_link"/>
374 </joint>
375 <link name="base_link">
376 <inertial>
377 <mass value="0.01"/>
378 <origin xyz="0 0 0"/>
379 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
380 </inertial>
381 <visual>
382 <origin rpy="0 0 0" xyz="0 0 0"/>
383 <geometry>
384 <cylinder length="0.2" radius="0.1"/>
385 </geometry>
386 <material name="DarkGrey">
387 <color rgba="0.4 0.4 0.4 1.0"/>
388 </material>
389 </visual>
390 <collision>
391 <origin rpy="0 0 0" xyz="0 0 0"/>
392 <geometry>
393 <cylinder length="1" radius="0.1"/>
394 </geometry>
395 </collision>
396 </link>
397 <joint name="joint1" type="continuous">
398 <origin rpy="-1.57079632679 0 0" xyz="0 0 0.2"/>
399 <parent link="base_link"/>
400 <child link="link1"/>
401 <limit effort="0.1" velocity="0.2"/>
402 </joint>
403 <link name="link1">
404 <inertial>
405 <mass value="0.01"/>
406 <origin xyz="0 0 0"/>
407 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
408 </inertial>
409 <visual>
410 <origin rpy="0 0 0" xyz="0 0 0"/>
411 <geometry>
412 <cylinder length="1" radius="0.1"/>
413 </geometry>
414 <material name="DarkGrey">
415 <color rgba="0.4 0.4 0.4 1.0"/>
416 </material>
417 </visual>
418 <collision>
419 <origin rpy="0 0 0" xyz="0 0 0"/>
420 <geometry>
421 <cylinder length="1" radius="0.1"/>
422 </geometry>
423 </collision>
424 </link>
425 <joint name="joint2" type="continuous">
426 <origin rpy="1.57079632679 0 0" xyz="0 0 0.9"/>
427 <parent link="link1"/>
428 <child link="link2"/>
429 <limit effort="0.1" velocity="0.2"/>
430 </joint>
431 <link name="link2">
432 <inertial>
433 <mass value="0.01"/>
434 <origin xyz="0 0 0"/>
435 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
436 </inertial>
437 <visual>
438 <origin rpy="0 0 0" xyz="0 0 0"/>
439 <geometry>
440 <cylinder length="1" radius="0.1"/>
441 </geometry>
442 <material name="DarkGrey">
443 <color rgba="0.4 0.4 0.4 1.0"/>
444 </material>
445 </visual>
446 <collision>
447 <origin rpy="0 0 0" xyz="0 0 0"/>
448 <geometry>
449 <cylinder length="1" radius="0.1"/>
450 </geometry>
451 </collision>
452 </link>
453)";
454
455const auto urdf_head_prismatic_missing_limits =
456 R"(
457<?xml version="1.0" encoding="utf-8"?>
458<robot name="MinimalRobot">
459 <!-- Used for fixing robot -->
460 <link name="world"/>
461 <joint name="base_joint" type="fixed">
462 <origin rpy="0 0 0" xyz="0 0 0"/>
463 <parent link="world"/>
464 <child link="base_link"/>
465 </joint>
466 <link name="base_link">
467 <inertial>
468 <mass value="0.01"/>
469 <origin xyz="0 0 0"/>
470 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
471 </inertial>
472 <visual>
473 <origin rpy="0 0 0" xyz="0 0 0"/>
474 <geometry>
475 <cylinder length="0.2" radius="0.1"/>
476 </geometry>
477 <material name="DarkGrey">
478 <color rgba="0.4 0.4 0.4 1.0"/>
479 </material>
480 </visual>
481 <collision>
482 <origin rpy="0 0 0" xyz="0 0 0"/>
483 <geometry>
484 <cylinder length="1" radius="0.1"/>
485 </geometry>
486 </collision>
487 </link>
488 <joint name="joint1" type="prismatic">
489 <origin rpy="-1.57079632679 0 0" xyz="0 0 0.2"/>
490 <parent link="base_link"/>
491 <child link="link1"/>
492 </joint>
493 <link name="link1">
494 <inertial>
495 <mass value="0.01"/>
496 <origin xyz="0 0 0"/>
497 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
498 </inertial>
499 <visual>
500 <origin rpy="0 0 0" xyz="0 0 0"/>
501 <geometry>
502 <cylinder length="1" radius="0.1"/>
503 </geometry>
504 <material name="DarkGrey">
505 <color rgba="0.4 0.4 0.4 1.0"/>
506 </material>
507 </visual>
508 <collision>
509 <origin rpy="0 0 0" xyz="0 0 0"/>
510 <geometry>
511 <cylinder length="1" radius="0.1"/>
512 </geometry>
513 </collision>
514 </link>
515 <joint name="joint2" type="revolute">
516 <origin rpy="1.57079632679 0 0" xyz="0 0 0.9"/>
517 <parent link="link1"/>
518 <child link="link2"/>
519 <limit effort="0.1" lower="-3.14159265359" upper="3.14159265359" velocity="0.2"/>
520 </joint>
521 <link name="link2">
522 <inertial>
523 <mass value="0.01"/>
524 <origin xyz="0 0 0"/>
525 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
526 </inertial>
527 <visual>
528 <origin rpy="0 0 0" xyz="0 0 0"/>
529 <geometry>
530 <cylinder length="1" radius="0.1"/>
531 </geometry>
532 <material name="DarkGrey">
533 <color rgba="0.4 0.4 0.4 1.0"/>
534 </material>
535 </visual>
536 <collision>
537 <origin rpy="0 0 0" xyz="0 0 0"/>
538 <geometry>
539 <cylinder length="1" radius="0.1"/>
540 </geometry>
541 </collision>
542 </link>
543)";
544
545const auto urdf_head_mimic =
546 R"(
547<?xml version="1.0" encoding="utf-8"?>
548<robot name="MinimalRobot">
549 <!-- Used for fixing robot -->
550 <link name="world"/>
551 <joint name="base_joint" type="fixed">
552 <origin rpy="0 0 0" xyz="0 0 0"/>
553 <parent link="world"/>
554 <child link="base_link"/>
555 </joint>
556 <link name="base_link">
557 <inertial>
558 <mass value="0.01"/>
559 <origin xyz="0 0 0"/>
560 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
561 </inertial>
562 <visual>
563 <origin rpy="0 0 0" xyz="0 0 0"/>
564 <geometry>
565 <cylinder length="0.2" radius="0.1"/>
566 </geometry>
567 <material name="DarkGrey">
568 <color rgba="0.4 0.4 0.4 1.0"/>
569 </material>
570 </visual>
571 <collision>
572 <origin rpy="0 0 0" xyz="0 0 0"/>
573 <geometry>
574 <cylinder length="1" radius="0.1"/>
575 </geometry>
576 </collision>
577 </link>
578 <joint name="joint1" type="revolute">
579 <origin rpy="-1.57079632679 0 0" xyz="0 0 0.2"/>
580 <parent link="base_link"/>
581 <child link="link1"/>
582 <limit effort="0.1" lower="-3.14159265359" upper="3.14159265359" velocity="0.2"/>
583 </joint>
584 <link name="link1">
585 <inertial>
586 <mass value="0.01"/>
587 <origin xyz="0 0 0"/>
588 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
589 </inertial>
590 <visual>
591 <origin rpy="0 0 0" xyz="0 0 0"/>
592 <geometry>
593 <cylinder length="1" radius="0.1"/>
594 </geometry>
595 <material name="DarkGrey">
596 <color rgba="0.4 0.4 0.4 1.0"/>
597 </material>
598 </visual>
599 <collision>
600 <origin rpy="0 0 0" xyz="0 0 0"/>
601 <geometry>
602 <cylinder length="1" radius="0.1"/>
603 </geometry>
604 </collision>
605 </link>
606 <joint name="joint2" type="revolute">
607 <mimic joint="joint1" multiplier="-2" offset="0"/>
608 <origin rpy="1.57079632679 0 0" xyz="0 0 0.9"/>
609 <parent link="link1"/>
610 <child link="link2"/>
611 <limit effort="0.1" lower="-3.14159265359" upper="3.14159265359" velocity="0.2"/>
612 </joint>
613 <link name="link2">
614 <inertial>
615 <mass value="0.01"/>
616 <origin xyz="0 0 0"/>
617 <inertia ixx="0.001" ixy="0.0" ixz="0.0" iyy="0.001" iyz="0.0" izz="0.001"/>
618 </inertial>
619 <visual>
620 <origin rpy="0 0 0" xyz="0 0 0"/>
621 <geometry>
622 <cylinder length="1" radius="0.1"/>
623 </geometry>
624 <material name="DarkGrey">
625 <color rgba="0.4 0.4 0.4 1.0"/>
626 </material>
627 </visual>
628 <collision>
629 <origin rpy="0 0 0" xyz="0 0 0"/>
630 <geometry>
631 <cylinder length="1" radius="0.1"/>
632 </geometry>
633 </collision>
634 </link>
635 <joint name="tool_joint" type="fixed">
636 <origin rpy="0 0 0" xyz="0 0 1"/>
637 <parent link="link2"/>
638 <child link="tool_link"/>
639 </joint>
640 <link name="tool_link">
641 </link>
642)";
643
644const auto urdf_tail =
645 R"(
646</robot>
647)";
648
649const auto hardware_resources =
650 R"(
651 <ros2_control name="TestActuatorHardware" type="actuator">
652 <hardware>
653 <plugin>test_actuator</plugin>
654 </hardware>
655 <joint name="joint1">
656 <command_interface name="position"/>
657 <state_interface name="position"/>
658 <state_interface name="velocity"/>
659 <command_interface name="max_velocity" />
660 </joint>
661 </ros2_control>
662 <ros2_control name="TestSensorHardware" type="sensor">
663 <hardware>
664 <plugin>test_sensor</plugin>
665 <param name="example_param_write_for_sec">2</param>
666 <param name="example_param_read_for_sec">2</param>
667 </hardware>
668 <sensor name="sensor1">
669 <state_interface name="velocity"/>
670 </sensor>
671 </ros2_control>
672 <ros2_control name="TestSystemHardware" type="system">
673 <hardware>
674 <plugin>test_system</plugin>
675 <param name="example_param_write_for_sec">2</param>
676 <param name="example_param_read_for_sec">2</param>
677 </hardware>
678 <joint name="joint2">
679 <command_interface name="velocity"/>
680 <state_interface name="position"/>
681 <state_interface name="velocity"/>
682 <state_interface name="acceleration"/>
683 <command_interface name="max_acceleration" />
684 </joint>
685 <joint name="joint3">
686 <command_interface name="velocity"/>
687 <state_interface name="position"/>
688 <state_interface name="velocity"/>
689 <state_interface name="acceleration"/>
690 </joint>
691 <gpio name="configuration">
692 <command_interface name="max_tcp_jerk"/>
693 <state_interface name="max_tcp_jerk"/>
694 </gpio>
695 </ros2_control>
696)";
697
698const auto async_hardware_resources =
699 R"(
700 <ros2_control name="TestActuatorHardware" type="actuator" is_async="true" thread_priority="30">
701 <properties>
702 <async affinity="[2, 4,6]" scheduling_policy="detached" print_warnings="false"/>
703 </properties>
704 <hardware>
705 <plugin>test_actuator</plugin>
706 </hardware>
707 <joint name="joint1">
708 <command_interface name="position"/>
709 <state_interface name="position"/>
710 <state_interface name="velocity"/>
711 <command_interface name="max_velocity" />
712 </joint>
713 </ros2_control>
714 <ros2_control name="TestSensorHardware" type="sensor" is_async="true">
715 <hardware>
716 <plugin>test_sensor</plugin>
717 <param name="example_param_write_for_sec">2</param>
718 <param name="example_param_read_for_sec">2</param>
719 </hardware>
720 <sensor name="sensor1">
721 <state_interface name="velocity"/>
722 </sensor>
723 </ros2_control>
724 <ros2_control name="TestSystemHardware" type="system" is_async="true">
725 <properties>
726 <async thread_priority="70" affinity="[1]" scheduling_policy="synchronized"/>
727 </properties>
728 <hardware>
729 <plugin>test_system</plugin>
730 <param name="example_param_write_for_sec">2</param>
731 <param name="example_param_read_for_sec">2</param>
732 </hardware>
733 <joint name="joint2">
734 <command_interface name="velocity"/>
735 <state_interface name="position"/>
736 <state_interface name="velocity"/>
737 <state_interface name="acceleration"/>
738 <command_interface name="max_acceleration" />
739 </joint>
740 <joint name="joint3">
741 <command_interface name="velocity"/>
742 <state_interface name="position"/>
743 <state_interface name="velocity"/>
744 <state_interface name="acceleration"/>
745 </joint>
746 <gpio name="configuration">
747 <command_interface name="max_tcp_jerk"/>
748 <state_interface name="max_tcp_jerk"/>
749 </gpio>
750 </ros2_control>
751)";
752
753const auto hardware_resources_with_different_rw_rates =
754 R"(
755 <ros2_control name="TestActuatorHardware" type="actuator" rw_rate="50">
756 <hardware>
757 <plugin>test_actuator</plugin>
758 </hardware>
759 <joint name="joint1">
760 <command_interface name="position"/>
761 <state_interface name="position"/>
762 <state_interface name="velocity"/>
763 <command_interface name="max_velocity" />
764 </joint>
765 </ros2_control>
766 <ros2_control name="TestSensorHardware" type="sensor" rw_rate="20">
767 <hardware>
768 <plugin>test_sensor</plugin>
769 <param name="example_param_write_for_sec">2</param>
770 <param name="example_param_read_for_sec">2</param>
771 </hardware>
772 <sensor name="sensor1">
773 <state_interface name="velocity"/>
774 </sensor>
775 </ros2_control>
776 <ros2_control name="TestSystemHardware" type="system" rw_rate="25">
777 <hardware>
778 <plugin>test_system</plugin>
779 <param name="example_param_write_for_sec">2</param>
780 <param name="example_param_read_for_sec">2</param>
781 </hardware>
782 <joint name="joint2">
783 <command_interface name="velocity"/>
784 <state_interface name="position"/>
785 <state_interface name="velocity"/>
786 <state_interface name="acceleration"/>
787 <command_interface name="max_acceleration" />
788 </joint>
789 <joint name="joint3">
790 <command_interface name="velocity"/>
791 <state_interface name="position"/>
792 <state_interface name="velocity"/>
793 <state_interface name="acceleration"/>
794 </joint>
795 <gpio name="configuration">
796 <command_interface name="max_tcp_jerk"/>
797 <state_interface name="max_tcp_jerk"/>
798 </gpio>
799 </ros2_control>
800)";
801
802const auto hardware_resources_with_different_rw_rates_with_async =
803 R"(
804 <ros2_control name="TestActuatorHardware" type="actuator" rw_rate="50" is_async="true">
805 <hardware>
806 <plugin>test_actuator</plugin>
807 </hardware>
808 <joint name="joint1">
809 <command_interface name="position"/>
810 <state_interface name="position"/>
811 <state_interface name="velocity"/>
812 <command_interface name="max_velocity" />
813 </joint>
814 </ros2_control>
815 <ros2_control name="TestSensorHardware" type="sensor" rw_rate="20" is_async="true">
816 <hardware>
817 <plugin>test_sensor</plugin>
818 <param name="example_param_write_for_sec">2</param>
819 <param name="example_param_read_for_sec">2</param>
820 </hardware>
821 <sensor name="sensor1">
822 <state_interface name="velocity"/>
823 </sensor>
824 </ros2_control>
825 <ros2_control name="TestSystemHardware" type="system" rw_rate="25" is_async="true">
826 <hardware>
827 <plugin>test_system</plugin>
828 <param name="example_param_write_for_sec">2</param>
829 <param name="example_param_read_for_sec">2</param>
830 </hardware>
831 <joint name="joint2">
832 <command_interface name="velocity"/>
833 <state_interface name="position"/>
834 <state_interface name="velocity"/>
835 <state_interface name="acceleration"/>
836 <command_interface name="max_acceleration" />
837 </joint>
838 <joint name="joint3">
839 <command_interface name="velocity"/>
840 <state_interface name="position"/>
841 <state_interface name="velocity"/>
842 <state_interface name="acceleration"/>
843 </joint>
844 <gpio name="configuration">
845 <command_interface name="max_tcp_jerk"/>
846 <state_interface name="max_tcp_jerk"/>
847 </gpio>
848 </ros2_control>
849)";
850
851const auto hardware_resources_with_negative_rw_rates =
852 R"(
853 <ros2_control name="TestActuatorHardware" type="actuator" rw_rate="-50">
854 <hardware>
855 <plugin>test_actuator</plugin>
856 </hardware>
857 <joint name="right_finger_joint">
858 <command_interface name="position"/>
859 <state_interface name="position"/>
860 <state_interface name="velocity"/>
861 <command_interface name="max_velocity" />
862 </joint>
863 </ros2_control>
864)";
865
866const auto hardware_resources_invalid_with_text_in_rw_rates =
867 R"(
868 <ros2_control name="TestActuatorHardware" type="actuator" rw_rate="d 50">
869 <hardware>
870 <plugin>test_actuator</plugin>
871 </hardware>
872 <joint name="right_finger_joint">
873 <command_interface name="position"/>
874 <state_interface name="position"/>
875 <state_interface name="velocity"/>
876 <command_interface name="max_velocity" />
877 </joint>
878 </ros2_control>
879)";
880
881const auto hardware_resources_invalid_out_of_range_in_rw_rates =
882 R"(
883 <ros2_control name="TestActuatorHardware" type="actuator" rw_rate="12345678901">
884 <hardware>
885 <plugin>test_actuator</plugin>
886 </hardware>
887 <joint name="right_finger_joint">
888 <command_interface name="position"/>
889 <state_interface name="position"/>
890 <state_interface name="velocity"/>
891 <command_interface name="max_velocity" />
892 </joint>
893 </ros2_control>
894)";
895
896const auto uninitializable_hardware_resources =
897 R"(
898 <ros2_control name="TestUninitializableActuatorHardware" type="actuator">
899 <hardware>
900 <plugin>test_uninitializable_actuator</plugin>
901 </hardware>
902 <joint name="joint1">
903 <command_interface name="position"/>
904 <state_interface name="position"/>
905 <state_interface name="velocity"/>
906 <command_interface name="max_velocity" />
907 </joint>
908 </ros2_control>
909 <ros2_control name="TestUninitializableSensorHardware" type="sensor">
910 <hardware>
911 <plugin>test_uninitializable_sensor</plugin>
912 <param name="example_param_write_for_sec">2</param>
913 <param name="example_param_read_for_sec">2</param>
914 </hardware>
915 <sensor name="sensor1">
916 <state_interface name="velocity"/>
917 </sensor>
918 </ros2_control>
919 <ros2_control name="TestUninitializableSystemHardware" type="system">
920 <hardware>
921 <plugin>test_uninitializable_system</plugin>
922 <param name="example_param_write_for_sec">2</param>
923 <param name="example_param_read_for_sec">2</param>
924 </hardware>
925 <joint name="joint2">
926 <command_interface name="velocity"/>
927 <state_interface name="position"/>
928 <state_interface name="velocity"/>
929 <state_interface name="acceleration"/>
930 <command_interface name="max_acceleration" />
931 </joint>
932 <joint name="joint3">
933 <command_interface name="velocity"/>
934 <state_interface name="position"/>
935 <state_interface name="velocity"/>
936 <state_interface name="acceleration"/>
937 </joint>
938 </ros2_control>
939)";
940
941const auto hardware_resources_not_existing_actuator_plugin =
942 R"(
943 <ros2_control name="TestActuatorHardware" type="actuator">
944 <hardware>
945 <plugin>test_actuator23</plugin>
946 </hardware>
947 <joint name="joint1">
948 <command_interface name="position"/>
949 <state_interface name="position"/>
950 <state_interface name="velocity"/>
951 <command_interface name="max_velocity" />
952 </joint>
953 </ros2_control>
954 <ros2_control name="TestSensorHardware" type="sensor">
955 <hardware>
956 <plugin>test_sensor</plugin>
957 <param name="example_param_write_for_sec">2</param>
958 <param name="example_param_read_for_sec">2</param>
959 </hardware>
960 <sensor name="sensor1">
961 <state_interface name="velocity"/>
962 </sensor>
963 </ros2_control>
964 <ros2_control name="TestSystemHardware" type="system">
965 <hardware>
966 <plugin>test_system</plugin>
967 <param name="example_param_write_for_sec">2</param>
968 <param name="example_param_read_for_sec">2</param>
969 </hardware>
970 <joint name="joint2">
971 <command_interface name="velocity"/>
972 <state_interface name="position"/>
973 <state_interface name="velocity"/>
974 <state_interface name="acceleration"/>
975 <command_interface name="max_acceleration" />
976 </joint>
977 <joint name="joint3">
978 <command_interface name="velocity"/>
979 <state_interface name="position"/>
980 <state_interface name="velocity"/>
981 <state_interface name="acceleration"/>
982 </joint>
983 <gpio name="configuration">
984 <command_interface name="max_tcp_jerk"/>
985 <state_interface name="max_tcp_jerk"/>
986 </gpio>
987 </ros2_control>
988)";
989
990const auto hardware_resources_not_existing_sensor_plugin =
991 R"(
992 <ros2_control name="TestActuatorHardware" type="actuator">
993 <hardware>
994 <plugin>test_actuator</plugin>
995 </hardware>
996 <joint name="joint1">
997 <command_interface name="position"/>
998 <state_interface name="position"/>
999 <state_interface name="velocity"/>
1000 <command_interface name="max_velocity" />
1001 </joint>
1002 </ros2_control>
1003 <ros2_control name="TestSensorHardware" type="sensor">
1004 <hardware>
1005 <plugin>test_sensor23</plugin>
1006 <param name="example_param_write_for_sec">2</param>
1007 <param name="example_param_read_for_sec">2</param>
1008 </hardware>
1009 <sensor name="sensor1">
1010 <state_interface name="velocity"/>
1011 </sensor>
1012 </ros2_control>
1013 <ros2_control name="TestSystemHardware" type="system">
1014 <hardware>
1015 <plugin>test_system</plugin>
1016 <param name="example_param_write_for_sec">2</param>
1017 <param name="example_param_read_for_sec">2</param>
1018 </hardware>
1019 <joint name="joint2">
1020 <command_interface name="velocity"/>
1021 <state_interface name="position"/>
1022 <state_interface name="velocity"/>
1023 <state_interface name="acceleration"/>
1024 <command_interface name="max_acceleration" />
1025 </joint>
1026 <joint name="joint3">
1027 <command_interface name="velocity"/>
1028 <state_interface name="position"/>
1029 <state_interface name="velocity"/>
1030 <state_interface name="acceleration"/>
1031 </joint>
1032 <gpio name="configuration">
1033 <command_interface name="max_tcp_jerk"/>
1034 <state_interface name="max_tcp_jerk"/>
1035 </gpio>
1036 </ros2_control>
1037)";
1038const auto hardware_resources_not_existing_system_plugin =
1039 R"(
1040 <ros2_control name="TestActuatorHardware" type="actuator">
1041 <hardware>
1042 <plugin>test_actuator</plugin>
1043 </hardware>
1044 <joint name="joint1">
1045 <command_interface name="position"/>
1046 <state_interface name="position"/>
1047 <state_interface name="velocity"/>
1048 <command_interface name="max_velocity" />
1049 </joint>
1050 </ros2_control>
1051 <ros2_control name="TestSensorHardware" type="sensor">
1052 <hardware>
1053 <plugin>test_sensor</plugin>
1054 <param name="example_param_write_for_sec">2</param>
1055 <param name="example_param_read_for_sec">2</param>
1056 </hardware>
1057 <sensor name="sensor1">
1058 <state_interface name="velocity"/>
1059 </sensor>
1060 </ros2_control>
1061 <ros2_control name="TestSystemHardware" type="system">
1062 <hardware>
1063 <plugin>test_system23</plugin>
1064 <param name="example_param_write_for_sec">2</param>
1065 <param name="example_param_read_for_sec">2</param>
1066 </hardware>
1067 <joint name="joint2">
1068 <command_interface name="velocity"/>
1069 <state_interface name="position"/>
1070 <state_interface name="velocity"/>
1071 <state_interface name="acceleration"/>
1072 <command_interface name="max_acceleration" />
1073 </joint>
1074 <joint name="joint3">
1075 <command_interface name="velocity"/>
1076 <state_interface name="position"/>
1077 <state_interface name="velocity"/>
1078 <state_interface name="acceleration"/>
1079 </joint>
1080 <gpio name="configuration">
1081 <command_interface name="max_tcp_jerk"/>
1082 <state_interface name="max_tcp_jerk"/>
1083 </gpio>
1084 </ros2_control>
1085)";
1086
1087const auto hardware_resources_duplicated_component =
1088 R"(
1089 <ros2_control name="TestActuatorHardware" type="actuator">
1090 <hardware>
1091 <plugin>test_actuator</plugin>
1092 </hardware>
1093 <joint name="joint1">
1094 <command_interface name="position"/>
1095 <state_interface name="position"/>
1096 <state_interface name="velocity"/>
1097 <command_interface name="max_velocity" />
1098 </joint>
1099 </ros2_control>
1100 <ros2_control name="TestActuatorHardware" type="sensor">
1101 <hardware>
1102 <plugin>test_sensor</plugin>
1103 <param name="example_param_write_for_sec">2</param>
1104 <param name="example_param_read_for_sec">2</param>
1105 </hardware>
1106 <sensor name="sensor1">
1107 <state_interface name="velocity"/>
1108 </sensor>
1109 </ros2_control>
1110 <ros2_control name="TestSystemHardware" type="system">
1111 <hardware>
1112 <plugin>test_system</plugin>
1113 <param name="example_param_write_for_sec">2</param>
1114 <param name="example_param_read_for_sec">2</param>
1115 </hardware>
1116 <joint name="joint2">
1117 <command_interface name="velocity"/>
1118 <state_interface name="position"/>
1119 <state_interface name="velocity"/>
1120 <state_interface name="acceleration"/>
1121 <command_interface name="max_acceleration" />
1122 </joint>
1123 <joint name="joint3">
1124 <command_interface name="velocity"/>
1125 <state_interface name="position"/>
1126 <state_interface name="velocity"/>
1127 <state_interface name="acceleration"/>
1128 </joint>
1129 <gpio name="configuration">
1130 <command_interface name="max_tcp_jerk"/>
1131 <state_interface name="max_tcp_jerk"/>
1132 </gpio>
1133 </ros2_control>
1134)";
1135
1136const auto hardware_resources_actuator_initializaion_error =
1137 R"(
1138 <ros2_control name="TestActuatorHardware" type="actuator">
1139 <hardware>
1140 <plugin>test_actuator</plugin>
1141 </hardware>
1142 <joint name="joint1">
1143 <command_interface name="position"/>
1144 <state_interface name="position"/>
1145 <state_interface name="does_not_exist"/>
1146 </joint>
1147 </ros2_control>
1148 <ros2_control name="TestSensorHardware" type="sensor">
1149 <hardware>
1150 <plugin>test_sensor</plugin>
1151 <param name="example_param_write_for_sec">2</param>
1152 <param name="example_param_read_for_sec">2</param>
1153 </hardware>
1154 <sensor name="sensor1">
1155 <state_interface name="velocity"/>
1156 </sensor>
1157 </ros2_control>
1158 <ros2_control name="TestSystemHardware" type="system">
1159 <hardware>
1160 <plugin>test_system</plugin>
1161 <param name="example_param_write_for_sec">2</param>
1162 <param name="example_param_read_for_sec">2</param>
1163 </hardware>
1164 <joint name="joint2">
1165 <command_interface name="velocity"/>
1166 <state_interface name="position"/>
1167 <state_interface name="velocity"/>
1168 </joint>
1169 <joint name="joint3">
1170 <command_interface name="velocity"/>
1171 <state_interface name="position"/>
1172 <state_interface name="velocity"/>
1173 </joint>
1174 </ros2_control>
1175)";
1176
1177const auto hardware_resources_sensor_initializaion_error =
1178 R"(
1179 <ros2_control name="TestActuatorHardware" type="actuator">
1180 <hardware>
1181 <plugin>test_actuator</plugin>
1182 </hardware>
1183 <joint name="joint1">
1184 <command_interface name="position"/>
1185 <state_interface name="position"/>
1186 <state_interface name="velocity"/>
1187 </joint>
1188 </ros2_control>
1189 <ros2_control name="TestSensorHardware" type="sensor">
1190 <hardware>
1191 <plugin>test_sensor</plugin>
1192 <param name="example_param_write_for_sec">2</param>
1193 <param name="example_param_read_for_sec">2</param>
1194 </hardware>
1195 <sensor name="sensor1">
1196 <state_interface name="velocity"/>
1197 <state_interface name="does_not_exist"/>
1198 </sensor>
1199 </ros2_control>
1200 <ros2_control name="TestSystemHardware" type="system">
1201 <hardware>
1202 <plugin>test_system</plugin>
1203 <param name="example_param_write_for_sec">2</param>
1204 <param name="example_param_read_for_sec">2</param>
1205 </hardware>
1206 <joint name="joint2">
1207 <command_interface name="velocity"/>
1208 <state_interface name="position"/>
1209 <state_interface name="velocity"/>
1210 </joint>
1211 <joint name="joint3">
1212 <command_interface name="velocity"/>
1213 <state_interface name="position"/>
1214 <state_interface name="velocity"/>
1215 </joint>
1216 </ros2_control>
1217)";
1218
1219const auto hardware_resources_system_initializaion_error =
1220 R"(
1221 <ros2_control name="TestActuatorHardware" type="actuator">
1222 <hardware>
1223 <plugin>test_actuator</plugin>
1224 </hardware>
1225 <joint name="joint1">
1226 <command_interface name="position"/>
1227 <state_interface name="position"/>
1228 <state_interface name="velocity"/>
1229 </joint>
1230 </ros2_control>
1231 <ros2_control name="TestSensorHardware" type="sensor">
1232 <hardware>
1233 <plugin>test_sensor</plugin>
1234 <param name="example_param_write_for_sec">2</param>
1235 <param name="example_param_read_for_sec">2</param>
1236 </hardware>
1237 <sensor name="sensor1">
1238 <state_interface name="velocity"/>
1239 </sensor>
1240 </ros2_control>
1241 <ros2_control name="TestSystemHardware" type="system">
1242 <hardware>
1243 <plugin>test_system</plugin>
1244 <param name="example_param_write_for_sec">2</param>
1245 <param name="example_param_read_for_sec">2</param>
1246 </hardware>
1247 <joint name="joint2">
1248 <command_interface name="velocity"/>
1249 <state_interface name="position"/>
1250 <state_interface name="does_not_exist"/>
1251 </joint>
1252 <joint name="joint3">
1253 <command_interface name="velocity"/>
1254 <state_interface name="position"/>
1255 <state_interface name="does_not_exist"/>
1256 </joint>
1257 </ros2_control>
1258)";
1259
1260const auto hardware_resources_missing_state_keys =
1261 R"(
1262 <ros2_control name="TestActuatorHardware" type="actuator">
1263 <hardware>
1264 <plugin>test_actuator</plugin>
1265 </hardware>
1266 <joint name="joint1">
1267 <command_interface name="position"/>
1268 <state_interface name="position"/>
1269 <state_interface name="velocity"/>
1270 <state_interface name="does_not_exist"/>
1271 </joint>
1272 </ros2_control>
1273 <ros2_control name="TestSensorHardware" type="sensor">
1274 <hardware>
1275 <plugin>test_sensor</plugin>
1276 <param name="example_param_write_for_sec">2</param>
1277 <param name="example_param_read_for_sec">2</param>
1278 </hardware>
1279 <sensor name="sensor1">
1280 <state_interface name="velocity"/>
1281 <state_interface name="does_not_exist"/>
1282 <state_interface name="does_not_exist"/>
1283 </sensor>
1284 </ros2_control>
1285 <ros2_control name="TestSystemHardware" type="system">
1286 <hardware>
1287 <plugin>test_system</plugin>
1288 <param name="example_param_write_for_sec">2</param>
1289 <param name="example_param_read_for_sec">2</param>
1290 </hardware>
1291 <joint name="joint2">
1292 <command_interface name="velocity"/>
1293 <command_interface name="max_acceleration"/>
1294 <state_interface name="position"/>
1295 <state_interface name="velocity"/>
1296 </joint>
1297 <joint name="joint3">
1298 <command_interface name="velocity"/>
1299 <state_interface name="position"/>
1300 <state_interface name="velocity"/>
1301 <state_interface name="does_not_exist"/>
1302 </joint>
1303 </ros2_control>
1304)";
1305
1306const auto hardware_resources_missing_command_keys =
1307 R"(
1308 <ros2_control name="TestActuatorHardware" type="actuator">
1309 <hardware>
1310 <plugin>test_actuator</plugin>
1311 </hardware>
1312 <joint name="joint1">
1313 <command_interface name="position"/>
1314 <command_interface name="does_not_exist"/>
1315 <state_interface name="position"/>
1316 <state_interface name="velocity"/>
1317 </joint>
1318 </ros2_control>
1319 <ros2_control name="TestSensorHardware" type="sensor">
1320 <hardware>
1321 <plugin>test_sensor</plugin>
1322 <param name="example_param_write_for_sec">2</param>
1323 <param name="example_param_read_for_sec">2</param>
1324 </hardware>
1325 <sensor name="sensor1">
1326 <state_interface name="velocity"/>
1327 </sensor>
1328 </ros2_control>
1329 <ros2_control name="TestSystemHardware" type="system">
1330 <hardware>
1331 <plugin>test_system</plugin>
1332 <param name="example_param_write_for_sec">2</param>
1333 <param name="example_param_read_for_sec">2</param>
1334 </hardware>
1335 <joint name="joint2">
1336 <command_interface name="velocity"/>
1337 <command_interface name="max_acceleration"/>
1338 <state_interface name="position"/>
1339 <state_interface name="velocity"/>
1340 </joint>
1341 <joint name="joint3">
1342 <command_interface name="velocity"/>
1343 <command_interface name="does_not_exist"/>
1344 <state_interface name="position"/>
1345 <state_interface name="velocity"/>
1346 </joint>
1347 </ros2_control>
1348)";
1349
1350const auto hardware_resources_with_exclusive_interface =
1351 R"(
1352 <ros2_control name="TestActuatorHardware1" type="actuator">
1353 <hardware>
1354 <plugin>test_actuator_exclusive_interfaces</plugin>
1355 </hardware>
1356 <joint name="joint1">
1357 <command_interface name="position"/>
1358 <command_interface name="velocity"/>
1359 <command_interface name="effort"/>
1360 <state_interface name="position"/>
1361 <state_interface name="velocity"/>
1362 <state_interface name="effort"/>
1363 </joint>
1364 </ros2_control>
1365 <ros2_control name="TestActuatorHardware2" type="actuator">
1366 <hardware>
1367 <plugin>test_actuator_exclusive_interfaces</plugin>
1368 </hardware>
1369 <joint name="joint2">
1370 <command_interface name="position"/>
1371 <command_interface name="velocity"/>
1372 <command_interface name="effort"/>
1373 <state_interface name="position"/>
1374 <state_interface name="velocity"/>
1375 <state_interface name="effort"/>
1376 </joint>
1377 </ros2_control>
1378 <ros2_control name="TestActuatorHardware3" type="actuator">
1379 <hardware>
1380 <plugin>test_actuator_exclusive_interfaces</plugin>
1381 </hardware>
1382 <joint name="joint3">
1383 <command_interface name="position"/>
1384 <command_interface name="velocity"/>
1385 <command_interface name="effort"/>
1386 <state_interface name="position"/>
1387 <state_interface name="velocity"/>
1388 <state_interface name="effort"/>
1389 </joint>
1390 </ros2_control>
1391 <ros2_control name="TestSensorHardware" type="sensor">
1392 <hardware>
1393 <plugin>test_sensor</plugin>
1394 <param name="example_param_write_for_sec">2</param>
1395 <param name="example_param_read_for_sec">2</param>
1396 </hardware>
1397 <sensor name="sensor1">
1398 <state_interface name="velocity"/>
1399 </sensor>
1400 </ros2_control>
1401)";
1402
1403const auto diffbot_urdf =
1404 R"(
1405<?xml version="1.0" ?>
1406<robot name="robot">
1407 <!-- Space btw top of beam and the each joint -->
1408 <!-- Links: inertial,visual,collision -->
1409 <link name="base_link">
1410 <inertial>
1411 <!-- origin is relative -->
1412 <origin rpy="0 0 0" xyz="0 0 0"/>
1413 <mass value="5"/>
1414 <inertia ixx="5" ixy="0" ixz="0" iyy="5" iyz="0" izz="5"/>
1415 </inertial>
1416 <visual>
1417 <geometry>
1418 <box size="0.5 0.1 0.1"/>
1419 </geometry>
1420 </visual>
1421 <collision>
1422 <!-- origin is relative -->
1423 <origin xyz="0 0 0"/>
1424 <geometry>
1425 <box size="0.5 0.1 0.1"/>
1426 </geometry>
1427 </collision>
1428 </link>
1429 <link name="base_footprint">
1430 <visual>
1431 <geometry>
1432 <sphere radius="0.01"/>
1433 </geometry>
1434 </visual>
1435 <collision>
1436 <origin xyz="0 0 0"/>
1437 <geometry>
1438 <sphere radius="0.00000001"/>
1439 </geometry>
1440 </collision>
1441 </link>
1442 <joint name="base_footprint_joint" type="fixed">
1443 <origin rpy="0 0 0" xyz="0 0 0.11"/>
1444 <child link="base_link"/>
1445 <parent link="base_footprint"/>
1446 </joint>
1447 <link name="wheel_0_link">
1448 <inertial>
1449 <origin rpy="0 0 0" xyz="0 0 0"/>
1450 <mass value="1"/>
1451 <inertia ixx="0.2" ixy="0" ixz="0" iyy="0.2" iyz="0" izz="0.2"/>
1452 </inertial>
1453 <visual>
1454 <origin rpy="0 0 0" xyz="0 0 0"/>
1455 <geometry>
1456 <cylinder length="0.086" radius="0.11"/>
1457 </geometry>
1458 </visual>
1459 <collision>
1460 <origin rpy="0 0 0" xyz="0 0 0"/>
1461 <geometry>
1462 <cylinder length="0.086" radius="0.11"/>
1463 </geometry>
1464 </collision>
1465 </link>
1466 <joint name="wheel_left" type="continuous">
1467 <parent link="base_link"/>
1468 <child link="wheel_0_link"/>
1469 <origin rpy="-1.5707963267948966 0 0" xyz="0.3 0 0"/>
1470 <axis xyz="0 0 1"/>
1471 <limit effort="100" velocity="1.0"/>
1472 </joint>
1473 <!-- Transmission is important to link the joints and the controller -->
1474 <transmission name="wheel_left_trans" type="SimpleTransmission">
1475 <actuator name="wheel_left_motor"/>
1476 <joint name="wheel_left"/>
1477 <mechanicalReduction>1</mechanicalReduction>
1478 <motorTorqueConstant>1</motorTorqueConstant>
1479 </transmission>
1480 <gazebo reference="wheel_0_link">
1481 <material>Gazebo/Red</material>
1482 </gazebo>
1483 <link name="wheel_1_link">
1484 <inertial>
1485 <origin rpy="0 0 0" xyz="0 0 0"/>
1486 <mass value="1"/>
1487 <inertia ixx="0.2" ixy="0" ixz="0" iyy="0.2" iyz="0" izz="0.2"/>
1488 </inertial>
1489 <visual>
1490 <origin rpy="0 0 0" xyz="0 0 0"/>
1491 <geometry>
1492 <cylinder length="0.086" radius="0.11"/>
1493 </geometry>
1494 </visual>
1495 <collision>
1496 <origin rpy="0 0 0" xyz="0 0 0"/>
1497 <geometry>
1498 <cylinder length="0.086" radius="0.11"/>
1499 </geometry>
1500 </collision>
1501 </link>
1502 <joint name="wheel_right" type="continuous">
1503 <parent link="base_link"/>
1504 <child link="wheel_1_link"/>
1505 <origin rpy="-1.5707963267948966 0 0" xyz="-0.2 0 0"/>
1506 <axis xyz="0 0 1"/>
1507 <limit effort="100" velocity="1.0"/>
1508 </joint>
1509 <!-- Transmission is important to link the joints and the controller -->
1510 <transmission name="wheel_right_trans" type="SimpleTransmission">
1511 <actuator name="wheel_right_motor"/>
1512 <joint name="wheel_right"/>
1513 <mechanicalReduction>1</mechanicalReduction>
1514 <motorTorqueConstant>1</motorTorqueConstant>
1515 </transmission>
1516 <gazebo reference="wheel_1_link">
1517 <material>Gazebo/Red</material>
1518 </gazebo>
1519 <!-- Colour -->
1520 <gazebo reference="base_link">
1521 <material>Gazebo/Green</material>
1522 </gazebo>
1523 <gazebo reference="base_footprint">
1524 <material>Gazebo/Purple</material>
1525 </gazebo>
1526 <ros2_control name="TestActuatorHardwareLeft" type="actuator">
1527 <hardware>
1528 <plugin>test_actuator</plugin>
1529 </hardware>
1530 <joint name="wheel_left">
1531 <state_interface name="position"/>
1532 <command_interface name="velocity"/>
1533 <state_interface name="velocity"/>
1534 </joint>
1535 </ros2_control>
1536 <ros2_control name="TestActuatorHardwareRight" type="actuator">
1537 <hardware>
1538 <plugin>test_actuator</plugin>
1539 </hardware>
1540 <joint name="wheel_right">
1541 <state_interface name="position"/>
1542 <command_interface name="velocity"/>
1543 <state_interface name="velocity"/>
1544 </joint>
1545 </ros2_control>
1546 <ros2_control name="TestIMUSensorHardware" type="sensor">
1547 <hardware>
1548 <plugin>test_hardware_components/TestIMUSensor</plugin>
1549 </hardware>
1550 <sensor name="base_imu">
1551 <state_interface name="orientation.x"/>
1552 <state_interface name="orientation.y"/>
1553 <state_interface name="orientation.z"/>
1554 <state_interface name="orientation.w"/>
1555 <state_interface name="angular_velocity.x"/>
1556 <state_interface name="angular_velocity.y"/>
1557 <state_interface name="angular_velocity.z"/>
1558 <state_interface name="linear_acceleration.x"/>
1559 <state_interface name="linear_acceleration.y"/>
1560 <state_interface name="linear_acceleration.z"/>
1561 </sensor>
1562 </ros2_control>
1563</robot>
1564)";
1565
1566const auto gripper_urdf_head =
1567 R"(<?xml version="1.0" ?>
1568<robot name="gripper">
1569 <link name="world"/>
1570 <link name="base">
1571 <visual>
1572 <geometry>
1573 <box size="0.5 1 1"/>
1574 </geometry>
1575 <origin xyz="0 0 0.5"/>
1576 <material name="violet">
1577 <color rgba="0.4 0.18 0.57 1.0" />
1578 </material>
1579 </visual>
1580 <inertial>
1581 <mass value="50"/>
1582 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1583 </inertial>
1584 </link>
1585 <link name="finger_right">
1586 <visual>
1587 <geometry>
1588 <box size="0.4 0.1 1"/>
1589 </geometry>
1590 <origin xyz="0 0.05 0.5"/>
1591 <material name="grey">
1592 <color rgba="0.2 0.2 0.2 1"/>
1593 </material>
1594 </visual>
1595 <inertial>
1596 <mass value="5"/>
1597 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1598 </inertial>
1599 </link>
1600 <link name="finger_left">
1601 <visual>
1602 <geometry>
1603 <box size="0.4 0.1 1"/>
1604 </geometry>
1605 <origin xyz="0 0.05 0.5"/>
1606 <material name="grey">
1607 <color rgba="0.2 0.2 0.2 1"/>
1608 </material>
1609 </visual>
1610 <inertial>
1611 <mass value="5"/>
1612 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1613 </inertial>
1614 </link>
1615 <joint name="world_to_base" type="fixed">
1616 <origin rpy="0 0 0" xyz="0 0 0"/>
1617 <parent link="world"/>
1618 <child link="base"/>
1619 </joint>
1620 <joint name="right_finger_joint" type="prismatic">
1621 <axis xyz="0 1 0"/>
1622 <origin xyz="0.0 -0.48 1" rpy="0.0 0.0 0.0"/>
1623 <parent link="base"/>
1624 <child link="finger_right"/>
1625 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1626 </joint>
1627 <joint name="left_finger_joint" type="prismatic">
1628 <mimic joint="right_finger_joint" multiplier="2" offset="1"/>
1629 <axis xyz="0 1 0"/>
1630 <origin xyz="0.0 0.48 1" rpy="0.0 0.0 3.1415926535"/>
1631 <parent link="base"/>
1632 <child link="finger_left"/>
1633 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1634 </joint>
1635)";
1636
1637const auto gripper_urdf_head_no_mimic =
1638 R"(<?xml version="1.0" ?>
1639<robot name="gripper">
1640 <link name="world"/>
1641 <link name="base">
1642 <visual>
1643 <geometry>
1644 <box size="0.5 1 1"/>
1645 </geometry>
1646 <origin xyz="0 0 0.5"/>
1647 <material name="violet">
1648 <color rgba="0.4 0.18 0.57 1.0" />
1649 </material>
1650 </visual>
1651 <inertial>
1652 <mass value="50"/>
1653 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1654 </inertial>
1655 </link>
1656 <link name="finger_right">
1657 <visual>
1658 <geometry>
1659 <box size="0.4 0.1 1"/>
1660 </geometry>
1661 <origin xyz="0 0.05 0.5"/>
1662 <material name="grey">
1663 <color rgba="0.2 0.2 0.2 1"/>
1664 </material>
1665 </visual>
1666 <inertial>
1667 <mass value="5"/>
1668 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1669 </inertial>
1670 </link>
1671 <link name="finger_left">
1672 <visual>
1673 <geometry>
1674 <box size="0.4 0.1 1"/>
1675 </geometry>
1676 <origin xyz="0 0.05 0.5"/>
1677 <material name="grey">
1678 <color rgba="0.2 0.2 0.2 1"/>
1679 </material>
1680 </visual>
1681 <inertial>
1682 <mass value="5"/>
1683 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1684 </inertial>
1685 </link>
1686 <joint name="world_to_base" type="fixed">
1687 <origin rpy="0 0 0" xyz="0 0 0"/>
1688 <parent link="world"/>
1689 <child link="base"/>
1690 </joint>
1691 <joint name="right_finger_joint" type="prismatic">
1692 <axis xyz="0 1 0"/>
1693 <origin xyz="0.0 -0.48 1" rpy="0.0 0.0 0.0"/>
1694 <parent link="base"/>
1695 <child link="finger_right"/>
1696 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1697 </joint>
1698 <joint name="left_finger_joint" type="prismatic">
1699 <axis xyz="0 1 0"/>
1700 <origin xyz="0.0 0.48 1" rpy="0.0 0.0 3.1415926535"/>
1701 <parent link="base"/>
1702 <child link="finger_left"/>
1703 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1704 </joint>
1705)";
1706
1707const auto gripper_urdf_head_unknown_joint =
1708 R"(<?xml version="1.0" ?>
1709<robot name="gripper">
1710 <link name="world"/>
1711 <link name="base">
1712 <visual>
1713 <geometry>
1714 <box size="0.5 1 1"/>
1715 </geometry>
1716 <origin xyz="0 0 0.5"/>
1717 <material name="violet">
1718 <color rgba="0.4 0.18 0.57 1.0" />
1719 </material>
1720 </visual>
1721 <inertial>
1722 <mass value="50"/>
1723 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1724 </inertial>
1725 </link>
1726 <link name="finger_right">
1727 <visual>
1728 <geometry>
1729 <box size="0.4 0.1 1"/>
1730 </geometry>
1731 <origin xyz="0 0.05 0.5"/>
1732 <material name="grey">
1733 <color rgba="0.2 0.2 0.2 1"/>
1734 </material>
1735 </visual>
1736 <inertial>
1737 <mass value="5"/>
1738 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1739 </inertial>
1740 </link>
1741 <link name="finger_left">
1742 <visual>
1743 <geometry>
1744 <box size="0.4 0.1 1"/>
1745 </geometry>
1746 <origin xyz="0 0.05 0.5"/>
1747 <material name="grey">
1748 <color rgba="0.2 0.2 0.2 1"/>
1749 </material>
1750 </visual>
1751 <inertial>
1752 <mass value="5"/>
1753 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1754 </inertial>
1755 </link>
1756 <joint name="world_to_base" type="fixed">
1757 <origin rpy="0 0 0" xyz="0 0 0"/>
1758 <parent link="world"/>
1759 <child link="base"/>
1760 </joint>
1761 <joint name="right_finger_joint" type="prismatic">
1762 <axis xyz="0 1 0"/>
1763 <origin xyz="0.0 -0.48 1" rpy="0.0 0.0 0.0"/>
1764 <parent link="base"/>
1765 <child link="finger_right"/>
1766 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1767 </joint>
1768 <joint name="left_finger_joint" type="prismatic">
1769 <mimic joint="middle_finger_joint" multiplier="1" offset="0"/>
1770 <axis xyz="0 1 0"/>
1771 <origin xyz="0.0 0.48 1" rpy="0.0 0.0 3.1415926535"/>
1772 <parent link="base"/>
1773 <child link="finger_left"/>
1774 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1775 </joint>
1776)";
1777
1778const auto gripper_urdf_head_incomplete =
1779 R"(<?xml version="1.0" ?>
1780<robot name="gripper">
1781 <link name="world"/>
1782 <link name="base">
1783 <visual>
1784 <geometry>
1785 <box size="0.5 1 1"/>
1786 </geometry>
1787 <origin xyz="0 0 0.5"/>
1788 <material name="violet">
1789 <color rgba="0.4 0.18 0.57 1.0" />
1790 </material>
1791 </visual>
1792 <inertial>
1793 <mass value="50"/>
1794 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1795 </inertial>
1796 </link>
1797 <link name="finger_right">
1798 <visual>
1799 <geometry>
1800 <box size="0.4 0.1 1"/>
1801 </geometry>
1802 <origin xyz="0 0.05 0.5"/>
1803 <material name="grey">
1804 <color rgba="0.2 0.2 0.2 1"/>
1805 </material>
1806 </visual>
1807 <inertial>
1808 <mass value="5"/>
1809 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1810 </inertial>
1811 </link>
1812 <joint name="world_to_base" type="fixed">
1813 <origin rpy="0 0 0" xyz="0 0 0"/>
1814 <parent link="world"/>
1815 <child link="base"/>
1816 </joint>
1817 <joint name="right_finger_joint" type="prismatic">
1818 <axis xyz="0 1 0"/>
1819 <origin xyz="0.0 -0.48 1" rpy="0.0 0.0 0.0"/>
1820 <parent link="base"/>
1821 <child link="finger_right"/>
1822 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1823 </joint>
1824)";
1825
1826const auto gripper_urdf_head_invalid_two_root_links =
1827 R"(<?xml version="1.0" ?>
1828<robot name="gripper">
1829 <link name="world"/>
1830 <link name="base">
1831 <visual>
1832 <geometry>
1833 <box size="0.5 1 1"/>
1834 </geometry>
1835 <origin xyz="0 0 0.5"/>
1836 <material name="violet">
1837 <color rgba="0.4 0.18 0.57 1.0" />
1838 </material>
1839 </visual>
1840 <inertial>
1841 <mass value="50"/>
1842 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1843 </inertial>
1844 </link>
1845 <link name="finger_right">
1846 <visual>
1847 <geometry>
1848 <box size="0.4 0.1 1"/>
1849 </geometry>
1850 <origin xyz="0 0.05 0.5"/>
1851 <material name="grey">
1852 <color rgba="0.2 0.2 0.2 1"/>
1853 </material>
1854 </visual>
1855 <inertial>
1856 <mass value="5"/>
1857 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1858 </inertial>
1859 </link>
1860 <link name="finger_left">
1861 <visual>
1862 <geometry>
1863 <box size="0.4 0.1 1"/>
1864 </geometry>
1865 <origin xyz="0 0.05 0.5"/>
1866 <material name="grey">
1867 <color rgba="0.2 0.2 0.2 1"/>
1868 </material>
1869 </visual>
1870 <inertial>
1871 <mass value="5"/>
1872 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1873 </inertial>
1874 </link>
1875 <joint name="world_to_base" type="fixed">
1876 <origin rpy="0 0 0" xyz="0 0 0"/>
1877 <parent link="world"/>
1878 <child link="base"/>
1879 </joint>
1880 <joint name="right_finger_joint" type="prismatic">
1881 <axis xyz="0 1 0"/>
1882 <origin xyz="0.0 -0.48 1" rpy="0.0 0.0 0.0"/>
1883 <parent link="base"/>
1884 <child link="finger_right"/>
1885 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1886 </joint>
1887)";
1888
1889const auto gripper_hardware_resources_no_command_if =
1890 R"(
1891 <ros2_control name="TestGripper" type="system">
1892 <joint name="right_finger_joint">
1893 <command_interface name="effort"/>
1894 <state_interface name="position"/>
1895 <state_interface name="velocity"/>
1896 <state_interface name="effort"/>
1897 </joint>
1898 <joint name="left_finger_joint">
1899 <state_interface name="position"/>
1900 <state_interface name="velocity"/>
1901 </joint>
1902 </ros2_control>
1903 )";
1904
1905const auto gripper_hardware_resources_mimic_true_no_command_if =
1906 R"(
1907 <ros2_control name="TestGripper" type="system">
1908 <joint name="right_finger_joint">
1909 <command_interface name="effort"/>
1910 <state_interface name="position"/>
1911 <state_interface name="velocity"/>
1912 <state_interface name="effort"/>
1913 </joint>
1914 <joint name="left_finger_joint" mimic="true">
1915 <state_interface name="position"/>
1916 <state_interface name="velocity"/>
1917 </joint>
1918 </ros2_control>
1919 )";
1920
1921const auto gripper_hardware_resources_mimic_true_command_if =
1922 R"(
1923 <ros2_control name="TestGripper" type="system">
1924 <joint name="right_finger_joint">
1925 <command_interface name="effort"/>
1926 <state_interface name="position"/>
1927 <state_interface name="velocity"/>
1928 <state_interface name="effort"/>
1929 </joint>
1930 <joint name="left_finger_joint" mimic="true">
1931 <command_interface name="effort"/>
1932 <state_interface name="position"/>
1933 <state_interface name="velocity"/>
1934 </joint>
1935 </ros2_control>
1936 )";
1937
1938const auto gripper_hardware_resources_mimic_false_command_if =
1939 R"(
1940 <ros2_control name="TestGripper" type="system">
1941 <joint name="right_finger_joint">
1942 <command_interface name="effort"/>
1943 <state_interface name="position"/>
1944 <state_interface name="velocity"/>
1945 <state_interface name="effort"/>
1946 </joint>
1947 <joint name="left_finger_joint" mimic="false">
1948 <command_interface name="effort"/>
1949 <state_interface name="position"/>
1950 <state_interface name="velocity"/>
1951 </joint>
1952 </ros2_control>
1953 )";
1954
1955const auto diff_drive_robot_sdf =
1956 R"(
1957<?xml version="1.0" ?>
1958<sdf version="1.8">
1959 <model canonical_link="base_link" name="my_robot">
1960 <!-- BASE -->
1961 <link name="base_link">
1962 <must_be_base_link>true</must_be_base_link>
1963 </link>
1964 <!-- CHASSIS -->
1965 <joint name="chassis_joint" type="fixed">
1966 <parent>base_link</parent>
1967 <child>chassis_link</child>
1968 <pose relative_to="base_link">0 0 0.075 0 0 0</pose>
1969 </joint>
1970 <link name="chassis_link">
1971 <pose relative_to="chassis_joint"/>
1972 <visual name="chassis_link_visual">
1973 <geometry>
1974 <box>
1975 <size>
1976 0.3 0.3 0.15
1977 </size>
1978 </box>
1979 </geometry>
1980 <material>
1981 <ambient>1 1 1 1</ambient>
1982 <diffuse>1 1 1 1</diffuse>
1983 </material>
1984 </visual>
1985 <collision name="chassis_link_collision">
1986 <geometry>
1987 <box>
1988 <size>
1989 0.3 0.3 0.15
1990 </size>
1991 </box>
1992 </geometry>
1993 </collision>
1994 <inertial>
1995 <mass>0.5</mass>
1996 <inertia>
1997 <ixx>0.0046875</ixx>
1998 <ixy>0.0</ixy>
1999 <ixz>0.0</ixz>
2000 <iyy>0.0046875</iyy>
2001 <iyz>0.0</iyz>
2002 <izz>0.0075</izz>
2003 </inertia>
2004 </inertial>
2005 </link>
2006 <!-- lEFT WHEEL -->
2007 <joint name="left_wheel_joint" type="revolute">
2008 <parent>chassis_link</parent>
2009 <child>left_wheel_link</child>
2010 <pose relative_to="chassis_link">0.09 0.16999999999999998 -0.075 -1.5707963267948966 0 0</pose>
2011 <axis>
2012 <xyz>0 0 1</xyz>
2013 <limit>
2014 <lower>-inf</lower>
2015 <upper>inf</upper>
2016 </limit>
2017 </axis>
2018 </joint>
2019 <link name="left_wheel_link">
2020 <pose relative_to="left_wheel_joint"/>
2021 <visual name="left_wheel_link_visual">
2022 <geometry>
2023 <cylinder>
2024 <radius>0.05</radius>
2025 <length>0.04</length>
2026 </cylinder>
2027 </geometry>
2028 <material>
2029 <ambient>0 0 1</ambient>
2030 <diffuse>0 0 1</diffuse>
2031 </material>
2032 </visual>
2033 <collision name="left_wheel_link_collision">
2034 <geometry>
2035 <cylinder>
2036 <radius>0.05</radius>
2037 <length>0.04</length>
2038 </cylinder>
2039 </geometry>
2040 </collision>
2041 <inertial>
2042 <mass>0.1</mass>
2043 <inertia>
2044 <ixx>7.583333333333335e-05</ixx>
2045 <ixy>0.0</ixy>
2046 <ixz>0.0</ixz>
2047 <iyy>7.583333333333335e-05</iyy>
2048 <iyz>0.0</iyz>
2049 <izz>0.00012500000000000003</izz>
2050 </inertia>
2051 </inertial>
2052 </link>
2053 <!-- RIGHT WHEEL -->
2054 <joint name="right_wheel_joint" type="revolute">
2055 <parent>chassis_link</parent>
2056 <child>right_wheel_link</child>
2057 <pose relative_to="chassis_link">0.09 -0.16999999999999998 -0.075 -1.5707963267948966 0 0</pose>
2058 <axis>
2059 <xyz>0 0 1</xyz>
2060 <!-- limit would not be specified because if the type was continuous -->
2061 <limit>
2062 <lower>-inf</lower>
2063 <upper>inf</upper>
2064 </limit>
2065 </axis>
2066 </joint>
2067 <link name="right_wheel_link">
2068 <pose relative_to="right_wheel_joint"/>
2069 <visual name="right_wheel_link_visual">
2070 <geometry>
2071 <cylinder>
2072 <radius>0.05</radius>
2073 <length>0.04</length>
2074 </cylinder>
2075 </geometry>
2076 <material>
2077 <ambient>0 0 1</ambient>
2078 <diffuse>0 0 1</diffuse>
2079 </material>
2080 </visual>
2081 <collision name="right_wheel_link_collision">
2082 <geometry>
2083 <cylinder>
2084 <radius>0.05</radius>
2085 <length>0.04</length>
2086 </cylinder>
2087 </geometry>
2088 </collision>
2089 <inertial>
2090 <mass>0.1</mass>
2091 <inertia>
2092 <ixx>7.583333333333335e-05</ixx>
2093 <ixy>0.0</ixy>
2094 <ixz>0.0</ixz>
2095 <iyy>7.583333333333335e-05</iyy>
2096 <iyz>0.0</iyz>
2097 <izz>0.00012500000000000003</izz>
2098 </inertia>
2099 </inertial>
2100 </link>
2101 <!-- CASTER -->
2102 <joint name="caster_joint" type="revolute">
2103 <parent>chassis_link</parent>
2104 <child>caster_link</child>
2105 <pose relative_to="chassis_link">-0.09 0 -0.075 0 0 0</pose>
2106 <axis>
2107 <xyz>1 1 1</xyz>
2108 <limit>
2109 <lower>-inf</lower>
2110 <upper>inf</upper>
2111 </limit>
2112 </axis>
2113 </joint>
2114 <link name="caster_link">
2115 <pose relative_to="caster_joint"/>
2116 <visual name="caster_link_visual">
2117 <geometry>
2118 <sphere>
2119 <radius>0.05</radius>
2120 </sphere>
2121 </geometry>
2122 <material>
2123 <ambient>0 0 1</ambient>
2124 <diffuse>0 0 1</diffuse>
2125 </material>
2126 </visual>
2127 <collision name="caster_link_collision">
2128 <geometry>
2129 <sphere>
2130 <radius>0.05</radius>
2131 </sphere>
2132 </geometry>
2133 </collision>
2134 <inertial>
2135 <mass>0.1</mass>
2136 <inertia>
2137 <ixx>0.00010000000000000002</ixx>
2138 <ixy>0.0</ixy>
2139 <ixz>0.0</ixz>
2140 <iyy>0.00010000000000000002</iyy>
2141 <iyz>0.0</iyz>
2142 <izz>0.00010000000000000002</izz>
2143 </inertia>
2144 </inertial>
2145 </link>
2146 <ros2_control name="GazeboSimSystem" type="system">
2147 <hardware>
2148 <plugin>gz_ros2_control/GazeboSimSystem</plugin>
2149 </hardware>
2150 <joint name="left_wheel_joint">
2151 <command_interface name="velocity">
2152 <param name="min">-10</param>
2153 <param name="max">10</param>
2154 </command_interface>
2155 <state_interface name="velocity"/>
2156 <state_interface name="position"/>
2157 </joint>
2158 <joint name="right_wheel_joint">
2159 <command_interface name="velocity">
2160 <param name="min">-10</param>
2161 <param name="max">10</param>
2162 </command_interface>
2163 <state_interface name="velocity"/>
2164 <state_interface name="position"/>
2165 </joint>
2166 </ros2_control>
2167 <plugin filename="libgz_ros2_control-system.so" name="gz_ros2_control::GazeboSimROS2ControlPlugin">
2168 <parameters>/path/to/config.yml</parameters>
2169 </plugin>
2170 </model>
2171</sdf>
2172)";
2173
2174const auto minimal_robot_urdf =
2175 std::string(urdf_head) + std::string(hardware_resources) + std::string(urdf_tail);
2176const auto minimal_robot_urdf_no_limits = std::string(urdf_head_continuous_missing_limits) +
2177 std::string(hardware_resources) + std::string(urdf_tail);
2178const auto minimal_async_robot_urdf =
2179 std::string(urdf_head) + std::string(async_hardware_resources) + std::string(urdf_tail);
2180const auto minimal_robot_urdf_with_different_hw_rw_rate =
2181 std::string(urdf_head) + std::string(hardware_resources_with_different_rw_rates) +
2182 std::string(urdf_tail);
2183const auto minimal_uninitializable_robot_urdf =
2184 std::string(urdf_head) + std::string(uninitializable_hardware_resources) + std::string(urdf_tail);
2185
2186const auto minimal_robot_not_existing_actuator_plugin =
2187 std::string(urdf_head) + std::string(hardware_resources_not_existing_actuator_plugin) +
2188 std::string(urdf_tail);
2189const auto minimal_robot_not_existing_sensors_plugin =
2190 std::string(urdf_head) + std::string(hardware_resources_not_existing_sensor_plugin) +
2191 std::string(urdf_tail);
2192const auto minimal_robot_not_existing_system_plugin =
2193 std::string(urdf_head) + std::string(hardware_resources_not_existing_system_plugin) +
2194 std::string(urdf_tail);
2195
2196const auto minimal_robot_duplicated_component =
2197 std::string(urdf_head) + std::string(hardware_resources_duplicated_component) +
2198 std::string(urdf_tail);
2199
2200const auto minimal_robot_actuator_initialization_error =
2201 std::string(urdf_head) + std::string(hardware_resources_not_existing_actuator_plugin) +
2202 std::string(urdf_tail);
2203const auto minimal_robot_sensor_initialization_error =
2204 std::string(urdf_head) + std::string(hardware_resources_sensor_initializaion_error) +
2205 std::string(urdf_tail);
2206const auto minimal_robot_system_initialization_error =
2207 std::string(urdf_head) + std::string(hardware_resources_system_initializaion_error) +
2208 std::string(urdf_tail);
2209
2210const auto minimal_robot_missing_state_keys_urdf =
2211 std::string(urdf_head) + std::string(hardware_resources_missing_state_keys) +
2212 std::string(urdf_tail);
2213
2214const auto minimal_robot_missing_command_keys_urdf =
2215 std::string(urdf_head) + std::string(hardware_resources_missing_command_keys) +
2216 std::string(urdf_tail);
2217
2218[[maybe_unused]] const std::string TEST_ACTUATOR_HARDWARE_NAME = "TestActuatorHardware";
2219[[maybe_unused]] const std::string TEST_ACTUATOR_HARDWARE_TYPE = "actuator";
2220[[maybe_unused]] const std::string TEST_ACTUATOR_HARDWARE_PLUGIN_NAME = "test_actuator";
2221[[maybe_unused]] const std::vector<std::string> TEST_ACTUATOR_HARDWARE_COMMAND_INTERFACES = {
2222 "joint1/position", "joint1/max_velocity"};
2223[[maybe_unused]] const std::vector<std::string> TEST_ACTUATOR_HARDWARE_STATE_INTERFACES = {
2224 "joint1/position", "joint1/velocity", "joint1/some_unlisted_interface"};
2225
2226[[maybe_unused]] const std::string TEST_SENSOR_HARDWARE_NAME = "TestSensorHardware";
2227[[maybe_unused]] const std::string TEST_SENSOR_HARDWARE_TYPE = "sensor";
2228[[maybe_unused]] const std::string TEST_SENSOR_HARDWARE_PLUGIN_NAME = "test_sensor";
2229[[maybe_unused]] const std::vector<std::string> TEST_SENSOR_HARDWARE_COMMAND_INTERFACES = {""};
2230[[maybe_unused]] const std::vector<std::string> TEST_SENSOR_HARDWARE_STATE_INTERFACES = {
2231 "sensor1/velocity"};
2232
2233[[maybe_unused]] const std::string TEST_SYSTEM_HARDWARE_NAME = "TestSystemHardware";
2234[[maybe_unused]] const std::string TEST_SYSTEM_HARDWARE_TYPE = "system";
2235[[maybe_unused]] const std::string TEST_SYSTEM_HARDWARE_PLUGIN_NAME = "test_system";
2236[[maybe_unused]] const std::vector<std::string> TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES = {
2237 "joint2/velocity", "joint2/max_acceleration", "joint3/velocity", "configuration/max_tcp_jerk"};
2238[[maybe_unused]] const std::vector<std::string> TEST_SYSTEM_HARDWARE_STATE_INTERFACES = {
2239 "joint2/position", "joint2/velocity", "joint2/acceleration", "joint3/position",
2240 "joint3/velocity", "joint3/acceleration", "configuration/max_tcp_jerk"};
2241
2242} // namespace ros2_control_test_assets
2243
2244#endif // ROS2_CONTROL_TEST_ASSETS__DESCRIPTIONS_HPP_