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 <transmission name="ros2_control_transmission1">
662 <plugin>transmission_interface/SimpleTransmission</plugin>
663 <joint name="joint1" role="joint1">
664 <mechanical_reduction>325.949</mechanical_reduction>
665 </joint>
666 </transmission>
667 </ros2_control>
668 <ros2_control name="TestSensorHardware" type="sensor">
669 <hardware>
670 <plugin>test_sensor</plugin>
671 <param name="example_param_write_for_sec">2</param>
672 <param name="example_param_read_for_sec">2</param>
673 </hardware>
674 <sensor name="sensor1">
675 <state_interface name="velocity"/>
676 </sensor>
677 </ros2_control>
678 <ros2_control name="TestSystemHardware" type="system">
679 <hardware>
680 <plugin>test_system</plugin>
681 <param name="example_param_write_for_sec">2</param>
682 <param name="example_param_read_for_sec">2</param>
683 </hardware>
684 <joint name="joint2">
685 <command_interface name="velocity"/>
686 <state_interface name="position"/>
687 <state_interface name="velocity"/>
688 <state_interface name="acceleration"/>
689 <command_interface name="max_acceleration" />
690 </joint>
691 <joint name="joint3">
692 <command_interface name="velocity"/>
693 <state_interface name="position"/>
694 <state_interface name="velocity"/>
695 <state_interface name="acceleration"/>
696 </joint>
697 <gpio name="configuration">
698 <command_interface name="max_tcp_jerk"/>
699 <state_interface name="max_tcp_jerk"/>
700 </gpio>
701 <transmission name="differential_transmission">
702 <plugin>transmission_interface/DifferentialTransmission</plugin>
703 <actuator name="joint2_motor" role="actuator1">
704 <mechanical_reduction>50</mechanical_reduction>
705 </actuator>
706 <actuator name="joint3_motor" role="actuator2">
707 <mechanical_reduction>-50</mechanical_reduction>
708 </actuator>
709 <joint name="joint2" role="joint1">
710 <offset>0.5</offset>
711 <mechanical_reduction>2.0</mechanical_reduction>
712 </joint>
713 <joint name="joint3" role="joint2">
714 <offset>-0.5</offset>
715 <mechanical_reduction>-2.0</mechanical_reduction>
716 </joint>
717 </transmission>
718 <transmission name="four_bar_transmission">
719 <plugin>transmission_interface/FourBarLinkageTransmission</plugin>
720 <actuator name="joint2_motor" role="actuator1">
721 <mechanical_reduction>50</mechanical_reduction>
722 </actuator>
723 <actuator name="joint3_motor" role="actuator2">
724 <mechanical_reduction>-50</mechanical_reduction>
725 </actuator>
726 <joint name="joint2" role="joint1">
727 <offset>0.5</offset>
728 <mechanical_reduction>2.0</mechanical_reduction>
729 </joint>
730 <joint name="joint3" role="joint2">
731 <offset>-0.5</offset>
732 <mechanical_reduction>-2.0</mechanical_reduction>
733 </joint>
734 </transmission>
735 </ros2_control>
736)";
737
738const auto minimal_robot_transmissions =
739 R"(
740 <transmission name="minimal_transmission1">
741 <type>transmission_interface/SimpleTransmission</type>
742 <joint name="joint1">
743 <hardwareInterface>PositionJointInterface</hardwareInterface>
744 </joint>
745 <actuator name="minimal_motor1">
746 <mechanicalReduction>1</mechanicalReduction>
747 <hardwareInterface>PositionJointInterface</hardwareInterface>
748 </actuator>
749 </transmission>
750 <transmission name="minimal_transmission2">
751 <type>transmission_interface/SimpleTransmission</type>
752 <joint name="joint2">
753 <hardwareInterface>VelocityJointInterface</hardwareInterface>
754 </joint>
755 <actuator name="minimal_motor2">
756 <mechanicalReduction>60</mechanicalReduction>
757 <hardwareInterface>VelocityJointInterface</hardwareInterface>
758 </actuator>
759 </transmission>
760)";
761
762const auto hardware_resources_with_disabled_limits =
763 R"(
764 <ros2_control name="TestActuatorHardware" type="actuator">
765 <hardware>
766 <plugin>test_actuator</plugin>
767 </hardware>
768 <joint name="joint1">
769 <limits enable="false"/>
770 <command_interface name="position"/>
771 <command_interface name="velocity"/>
772 <command_interface name="effort"/>
773 <state_interface name="position"/>
774 <state_interface name="velocity"/>
775 <command_interface name="max_velocity" />
776 </joint>
777 </ros2_control>
778 <ros2_control name="TestSensorHardware" type="sensor">
779 <hardware>
780 <plugin>test_sensor</plugin>
781 <param name="example_param_write_for_sec">2</param>
782 <param name="example_param_read_for_sec">2</param>
783 </hardware>
784 <sensor name="sensor1">
785 <state_interface name="velocity"/>
786 </sensor>
787 </ros2_control>
788 <ros2_control name="TestSystemHardware" type="system">
789 <hardware>
790 <plugin>test_system</plugin>
791 <param name="example_param_write_for_sec">2</param>
792 <param name="example_param_read_for_sec">2</param>
793 </hardware>
794 <joint name="joint2">
795 <limits enable="false"/>
796 <command_interface name="velocity"/>
797 <state_interface name="position"/>
798 <state_interface name="velocity"/>
799 <state_interface name="acceleration"/>
800 <command_interface name="max_acceleration" />
801 </joint>
802 <joint name="joint3">
803 <command_interface name="position">
804 <limits enable="false"/>
805 </command_interface>
806 <command_interface name="velocity"/>
807 <state_interface name="position"/>
808 <state_interface name="velocity"/>
809 <state_interface name="acceleration"/>
810 </joint>
811 <gpio name="configuration">
812 <command_interface name="max_tcp_jerk"/>
813 <state_interface name="max_tcp_jerk"/>
814 </gpio>
815 </ros2_control>
816)";
817
818const auto async_hardware_resources =
819 R"(
820 <ros2_control name="TestActuatorHardware" type="actuator" is_async="true" thread_priority="30">
821 <properties>
822 <async affinity="[2, 4,6]" scheduling_policy="detached" print_warnings="false"/>
823 </properties>
824 <hardware>
825 <plugin>test_actuator</plugin>
826 </hardware>
827 <joint name="joint1">
828 <command_interface name="position"/>
829 <state_interface name="position"/>
830 <state_interface name="velocity"/>
831 <command_interface name="max_velocity" />
832 </joint>
833 </ros2_control>
834 <ros2_control name="TestSensorHardware" type="sensor" is_async="true">
835 <hardware>
836 <plugin>test_sensor</plugin>
837 <param name="example_param_write_for_sec">2</param>
838 <param name="example_param_read_for_sec">2</param>
839 </hardware>
840 <sensor name="sensor1">
841 <state_interface name="velocity"/>
842 </sensor>
843 </ros2_control>
844 <ros2_control name="TestSystemHardware" type="system" is_async="true">
845 <properties>
846 <async thread_priority="70" affinity="[1]" scheduling_policy="synchronized"/>
847 </properties>
848 <hardware>
849 <plugin>test_system</plugin>
850 <param name="example_param_write_for_sec">2</param>
851 <param name="example_param_read_for_sec">2</param>
852 </hardware>
853 <joint name="joint2">
854 <command_interface name="velocity"/>
855 <state_interface name="position"/>
856 <state_interface name="velocity"/>
857 <state_interface name="acceleration"/>
858 <command_interface name="max_acceleration" />
859 </joint>
860 <joint name="joint3">
861 <command_interface name="velocity"/>
862 <state_interface name="position"/>
863 <state_interface name="velocity"/>
864 <state_interface name="acceleration"/>
865 </joint>
866 <gpio name="configuration">
867 <command_interface name="max_tcp_jerk"/>
868 <state_interface name="max_tcp_jerk"/>
869 </gpio>
870 </ros2_control>
871)";
872
873const auto hardware_resources_with_different_rw_rates =
874 R"(
875 <ros2_control name="TestActuatorHardware" type="actuator" rw_rate="50">
876 <hardware>
877 <plugin>test_actuator</plugin>
878 </hardware>
879 <joint name="joint1">
880 <command_interface name="position"/>
881 <state_interface name="position"/>
882 <state_interface name="velocity"/>
883 <command_interface name="max_velocity" />
884 </joint>
885 </ros2_control>
886 <ros2_control name="TestSensorHardware" type="sensor" rw_rate="20">
887 <hardware>
888 <plugin>test_sensor</plugin>
889 <param name="example_param_write_for_sec">2</param>
890 <param name="example_param_read_for_sec">2</param>
891 </hardware>
892 <sensor name="sensor1">
893 <state_interface name="velocity"/>
894 </sensor>
895 </ros2_control>
896 <ros2_control name="TestSystemHardware" type="system" rw_rate="25">
897 <hardware>
898 <plugin>test_system</plugin>
899 <param name="example_param_write_for_sec">2</param>
900 <param name="example_param_read_for_sec">2</param>
901 </hardware>
902 <joint name="joint2">
903 <command_interface name="velocity"/>
904 <state_interface name="position"/>
905 <state_interface name="velocity"/>
906 <state_interface name="acceleration"/>
907 <command_interface name="max_acceleration" />
908 </joint>
909 <joint name="joint3">
910 <command_interface name="velocity"/>
911 <state_interface name="position"/>
912 <state_interface name="velocity"/>
913 <state_interface name="acceleration"/>
914 </joint>
915 <gpio name="configuration">
916 <command_interface name="max_tcp_jerk"/>
917 <state_interface name="max_tcp_jerk"/>
918 </gpio>
919 </ros2_control>
920)";
921
922const auto hardware_resources_with_different_rw_rates_with_async =
923 R"(
924 <ros2_control name="TestActuatorHardware" type="actuator" rw_rate="50" is_async="true">
925 <hardware>
926 <plugin>test_actuator</plugin>
927 </hardware>
928 <joint name="joint1">
929 <command_interface name="position"/>
930 <state_interface name="position"/>
931 <state_interface name="velocity"/>
932 <command_interface name="max_velocity" />
933 </joint>
934 </ros2_control>
935 <ros2_control name="TestSensorHardware" type="sensor" rw_rate="20" is_async="true">
936 <hardware>
937 <plugin>test_sensor</plugin>
938 <param name="example_param_write_for_sec">2</param>
939 <param name="example_param_read_for_sec">2</param>
940 </hardware>
941 <sensor name="sensor1">
942 <state_interface name="velocity"/>
943 </sensor>
944 </ros2_control>
945 <ros2_control name="TestSystemHardware" type="system" rw_rate="25" is_async="true">
946 <hardware>
947 <plugin>test_system</plugin>
948 <param name="example_param_write_for_sec">2</param>
949 <param name="example_param_read_for_sec">2</param>
950 </hardware>
951 <joint name="joint2">
952 <command_interface name="velocity"/>
953 <state_interface name="position"/>
954 <state_interface name="velocity"/>
955 <state_interface name="acceleration"/>
956 <command_interface name="max_acceleration" />
957 </joint>
958 <joint name="joint3">
959 <command_interface name="velocity"/>
960 <state_interface name="position"/>
961 <state_interface name="velocity"/>
962 <state_interface name="acceleration"/>
963 </joint>
964 <gpio name="configuration">
965 <command_interface name="max_tcp_jerk"/>
966 <state_interface name="max_tcp_jerk"/>
967 </gpio>
968 </ros2_control>
969)";
970
971const auto hardware_resources_with_negative_rw_rates =
972 R"(
973 <ros2_control name="TestActuatorHardware" type="actuator" rw_rate="-50">
974 <hardware>
975 <plugin>test_actuator</plugin>
976 </hardware>
977 <joint name="right_finger_joint">
978 <command_interface name="position"/>
979 <state_interface name="position"/>
980 <state_interface name="velocity"/>
981 <command_interface name="max_velocity" />
982 </joint>
983 </ros2_control>
984)";
985
986const auto hardware_resources_invalid_with_text_in_rw_rates =
987 R"(
988 <ros2_control name="TestActuatorHardware" type="actuator" rw_rate="d 50">
989 <hardware>
990 <plugin>test_actuator</plugin>
991 </hardware>
992 <joint name="right_finger_joint">
993 <command_interface name="position"/>
994 <state_interface name="position"/>
995 <state_interface name="velocity"/>
996 <command_interface name="max_velocity" />
997 </joint>
998 </ros2_control>
999)";
1000
1001const auto hardware_resources_invalid_out_of_range_in_rw_rates =
1002 R"(
1003 <ros2_control name="TestActuatorHardware" type="actuator" rw_rate="12345678901">
1004 <hardware>
1005 <plugin>test_actuator</plugin>
1006 </hardware>
1007 <joint name="right_finger_joint">
1008 <command_interface name="position"/>
1009 <state_interface name="position"/>
1010 <state_interface name="velocity"/>
1011 <command_interface name="max_velocity" />
1012 </joint>
1013 </ros2_control>
1014)";
1015
1016const auto uninitializable_hardware_resources =
1017 R"(
1018 <ros2_control name="TestUninitializableActuatorHardware" type="actuator">
1019 <hardware>
1020 <plugin>test_uninitializable_actuator</plugin>
1021 </hardware>
1022 <joint name="joint1">
1023 <command_interface name="position"/>
1024 <state_interface name="position"/>
1025 <state_interface name="velocity"/>
1026 <command_interface name="max_velocity" />
1027 </joint>
1028 </ros2_control>
1029 <ros2_control name="TestUninitializableSensorHardware" type="sensor">
1030 <hardware>
1031 <plugin>test_uninitializable_sensor</plugin>
1032 <param name="example_param_write_for_sec">2</param>
1033 <param name="example_param_read_for_sec">2</param>
1034 </hardware>
1035 <sensor name="sensor1">
1036 <state_interface name="velocity"/>
1037 </sensor>
1038 </ros2_control>
1039 <ros2_control name="TestUninitializableSystemHardware" type="system">
1040 <hardware>
1041 <plugin>test_uninitializable_system</plugin>
1042 <param name="example_param_write_for_sec">2</param>
1043 <param name="example_param_read_for_sec">2</param>
1044 </hardware>
1045 <joint name="joint2">
1046 <command_interface name="velocity"/>
1047 <state_interface name="position"/>
1048 <state_interface name="velocity"/>
1049 <state_interface name="acceleration"/>
1050 <command_interface name="max_acceleration" />
1051 </joint>
1052 <joint name="joint3">
1053 <command_interface name="velocity"/>
1054 <state_interface name="position"/>
1055 <state_interface name="velocity"/>
1056 <state_interface name="acceleration"/>
1057 </joint>
1058 </ros2_control>
1059)";
1060
1061const auto hardware_resources_not_existing_actuator_plugin =
1062 R"(
1063 <ros2_control name="TestActuatorHardware" type="actuator">
1064 <hardware>
1065 <plugin>test_actuator23</plugin>
1066 </hardware>
1067 <joint name="joint1">
1068 <command_interface name="position"/>
1069 <state_interface name="position"/>
1070 <state_interface name="velocity"/>
1071 <command_interface name="max_velocity" />
1072 </joint>
1073 </ros2_control>
1074 <ros2_control name="TestSensorHardware" type="sensor">
1075 <hardware>
1076 <plugin>test_sensor</plugin>
1077 <param name="example_param_write_for_sec">2</param>
1078 <param name="example_param_read_for_sec">2</param>
1079 </hardware>
1080 <sensor name="sensor1">
1081 <state_interface name="velocity"/>
1082 </sensor>
1083 </ros2_control>
1084 <ros2_control name="TestSystemHardware" type="system">
1085 <hardware>
1086 <plugin>test_system</plugin>
1087 <param name="example_param_write_for_sec">2</param>
1088 <param name="example_param_read_for_sec">2</param>
1089 </hardware>
1090 <joint name="joint2">
1091 <command_interface name="velocity"/>
1092 <state_interface name="position"/>
1093 <state_interface name="velocity"/>
1094 <state_interface name="acceleration"/>
1095 <command_interface name="max_acceleration" />
1096 </joint>
1097 <joint name="joint3">
1098 <command_interface name="velocity"/>
1099 <state_interface name="position"/>
1100 <state_interface name="velocity"/>
1101 <state_interface name="acceleration"/>
1102 </joint>
1103 <gpio name="configuration">
1104 <command_interface name="max_tcp_jerk"/>
1105 <state_interface name="max_tcp_jerk"/>
1106 </gpio>
1107 </ros2_control>
1108)";
1109
1110const auto hardware_resources_not_existing_sensor_plugin =
1111 R"(
1112 <ros2_control name="TestActuatorHardware" type="actuator">
1113 <hardware>
1114 <plugin>test_actuator</plugin>
1115 </hardware>
1116 <joint name="joint1">
1117 <command_interface name="position"/>
1118 <state_interface name="position"/>
1119 <state_interface name="velocity"/>
1120 <command_interface name="max_velocity" />
1121 </joint>
1122 </ros2_control>
1123 <ros2_control name="TestSensorHardware" type="sensor">
1124 <hardware>
1125 <plugin>test_sensor23</plugin>
1126 <param name="example_param_write_for_sec">2</param>
1127 <param name="example_param_read_for_sec">2</param>
1128 </hardware>
1129 <sensor name="sensor1">
1130 <state_interface name="velocity"/>
1131 </sensor>
1132 </ros2_control>
1133 <ros2_control name="TestSystemHardware" type="system">
1134 <hardware>
1135 <plugin>test_system</plugin>
1136 <param name="example_param_write_for_sec">2</param>
1137 <param name="example_param_read_for_sec">2</param>
1138 </hardware>
1139 <joint name="joint2">
1140 <command_interface name="velocity"/>
1141 <state_interface name="position"/>
1142 <state_interface name="velocity"/>
1143 <state_interface name="acceleration"/>
1144 <command_interface name="max_acceleration" />
1145 </joint>
1146 <joint name="joint3">
1147 <command_interface name="velocity"/>
1148 <state_interface name="position"/>
1149 <state_interface name="velocity"/>
1150 <state_interface name="acceleration"/>
1151 </joint>
1152 <gpio name="configuration">
1153 <command_interface name="max_tcp_jerk"/>
1154 <state_interface name="max_tcp_jerk"/>
1155 </gpio>
1156 </ros2_control>
1157)";
1158const auto hardware_resources_not_existing_system_plugin =
1159 R"(
1160 <ros2_control name="TestActuatorHardware" type="actuator">
1161 <hardware>
1162 <plugin>test_actuator</plugin>
1163 </hardware>
1164 <joint name="joint1">
1165 <command_interface name="position"/>
1166 <state_interface name="position"/>
1167 <state_interface name="velocity"/>
1168 <command_interface name="max_velocity" />
1169 </joint>
1170 </ros2_control>
1171 <ros2_control name="TestSensorHardware" type="sensor">
1172 <hardware>
1173 <plugin>test_sensor</plugin>
1174 <param name="example_param_write_for_sec">2</param>
1175 <param name="example_param_read_for_sec">2</param>
1176 </hardware>
1177 <sensor name="sensor1">
1178 <state_interface name="velocity"/>
1179 </sensor>
1180 </ros2_control>
1181 <ros2_control name="TestSystemHardware" type="system">
1182 <hardware>
1183 <plugin>test_system23</plugin>
1184 <param name="example_param_write_for_sec">2</param>
1185 <param name="example_param_read_for_sec">2</param>
1186 </hardware>
1187 <joint name="joint2">
1188 <command_interface name="velocity"/>
1189 <state_interface name="position"/>
1190 <state_interface name="velocity"/>
1191 <state_interface name="acceleration"/>
1192 <command_interface name="max_acceleration" />
1193 </joint>
1194 <joint name="joint3">
1195 <command_interface name="velocity"/>
1196 <state_interface name="position"/>
1197 <state_interface name="velocity"/>
1198 <state_interface name="acceleration"/>
1199 </joint>
1200 <gpio name="configuration">
1201 <command_interface name="max_tcp_jerk"/>
1202 <state_interface name="max_tcp_jerk"/>
1203 </gpio>
1204 </ros2_control>
1205)";
1206
1207const auto hardware_resources_duplicated_component =
1208 R"(
1209 <ros2_control name="TestActuatorHardware" type="actuator">
1210 <hardware>
1211 <plugin>test_actuator</plugin>
1212 </hardware>
1213 <joint name="joint1">
1214 <command_interface name="position"/>
1215 <state_interface name="position"/>
1216 <state_interface name="velocity"/>
1217 <command_interface name="max_velocity" />
1218 </joint>
1219 </ros2_control>
1220 <ros2_control name="TestActuatorHardware" type="sensor">
1221 <hardware>
1222 <plugin>test_sensor</plugin>
1223 <param name="example_param_write_for_sec">2</param>
1224 <param name="example_param_read_for_sec">2</param>
1225 </hardware>
1226 <sensor name="sensor1">
1227 <state_interface name="velocity"/>
1228 </sensor>
1229 </ros2_control>
1230 <ros2_control name="TestSystemHardware" type="system">
1231 <hardware>
1232 <plugin>test_system</plugin>
1233 <param name="example_param_write_for_sec">2</param>
1234 <param name="example_param_read_for_sec">2</param>
1235 </hardware>
1236 <joint name="joint2">
1237 <command_interface name="velocity"/>
1238 <state_interface name="position"/>
1239 <state_interface name="velocity"/>
1240 <state_interface name="acceleration"/>
1241 <command_interface name="max_acceleration" />
1242 </joint>
1243 <joint name="joint3">
1244 <command_interface name="velocity"/>
1245 <state_interface name="position"/>
1246 <state_interface name="velocity"/>
1247 <state_interface name="acceleration"/>
1248 </joint>
1249 <gpio name="configuration">
1250 <command_interface name="max_tcp_jerk"/>
1251 <state_interface name="max_tcp_jerk"/>
1252 </gpio>
1253 </ros2_control>
1254)";
1255
1256const auto hardware_resources_actuator_initializaion_error =
1257 R"(
1258 <ros2_control name="TestActuatorHardware" type="actuator">
1259 <hardware>
1260 <plugin>test_actuator</plugin>
1261 </hardware>
1262 <joint name="joint1">
1263 <command_interface name="position"/>
1264 <state_interface name="position"/>
1265 <state_interface name="does_not_exist"/>
1266 </joint>
1267 </ros2_control>
1268 <ros2_control name="TestSensorHardware" type="sensor">
1269 <hardware>
1270 <plugin>test_sensor</plugin>
1271 <param name="example_param_write_for_sec">2</param>
1272 <param name="example_param_read_for_sec">2</param>
1273 </hardware>
1274 <sensor name="sensor1">
1275 <state_interface name="velocity"/>
1276 </sensor>
1277 </ros2_control>
1278 <ros2_control name="TestSystemHardware" type="system">
1279 <hardware>
1280 <plugin>test_system</plugin>
1281 <param name="example_param_write_for_sec">2</param>
1282 <param name="example_param_read_for_sec">2</param>
1283 </hardware>
1284 <joint name="joint2">
1285 <command_interface name="velocity"/>
1286 <state_interface name="position"/>
1287 <state_interface name="velocity"/>
1288 </joint>
1289 <joint name="joint3">
1290 <command_interface name="velocity"/>
1291 <state_interface name="position"/>
1292 <state_interface name="velocity"/>
1293 </joint>
1294 </ros2_control>
1295)";
1296
1297const auto hardware_resources_sensor_initializaion_error =
1298 R"(
1299 <ros2_control name="TestActuatorHardware" type="actuator">
1300 <hardware>
1301 <plugin>test_actuator</plugin>
1302 </hardware>
1303 <joint name="joint1">
1304 <command_interface name="position"/>
1305 <state_interface name="position"/>
1306 <state_interface name="velocity"/>
1307 </joint>
1308 </ros2_control>
1309 <ros2_control name="TestSensorHardware" type="sensor">
1310 <hardware>
1311 <plugin>test_sensor</plugin>
1312 <param name="example_param_write_for_sec">2</param>
1313 <param name="example_param_read_for_sec">2</param>
1314 </hardware>
1315 <sensor name="sensor1">
1316 <state_interface name="velocity"/>
1317 <state_interface name="does_not_exist"/>
1318 </sensor>
1319 </ros2_control>
1320 <ros2_control name="TestSystemHardware" type="system">
1321 <hardware>
1322 <plugin>test_system</plugin>
1323 <param name="example_param_write_for_sec">2</param>
1324 <param name="example_param_read_for_sec">2</param>
1325 </hardware>
1326 <joint name="joint2">
1327 <command_interface name="velocity"/>
1328 <state_interface name="position"/>
1329 <state_interface name="velocity"/>
1330 </joint>
1331 <joint name="joint3">
1332 <command_interface name="velocity"/>
1333 <state_interface name="position"/>
1334 <state_interface name="velocity"/>
1335 </joint>
1336 </ros2_control>
1337)";
1338
1339const auto hardware_resources_system_initializaion_error =
1340 R"(
1341 <ros2_control name="TestActuatorHardware" type="actuator">
1342 <hardware>
1343 <plugin>test_actuator</plugin>
1344 </hardware>
1345 <joint name="joint1">
1346 <command_interface name="position"/>
1347 <state_interface name="position"/>
1348 <state_interface name="velocity"/>
1349 </joint>
1350 </ros2_control>
1351 <ros2_control name="TestSensorHardware" type="sensor">
1352 <hardware>
1353 <plugin>test_sensor</plugin>
1354 <param name="example_param_write_for_sec">2</param>
1355 <param name="example_param_read_for_sec">2</param>
1356 </hardware>
1357 <sensor name="sensor1">
1358 <state_interface name="velocity"/>
1359 </sensor>
1360 </ros2_control>
1361 <ros2_control name="TestSystemHardware" type="system">
1362 <hardware>
1363 <plugin>test_system</plugin>
1364 <param name="example_param_write_for_sec">2</param>
1365 <param name="example_param_read_for_sec">2</param>
1366 </hardware>
1367 <joint name="joint2">
1368 <command_interface name="velocity"/>
1369 <state_interface name="position"/>
1370 <state_interface name="does_not_exist"/>
1371 </joint>
1372 <joint name="joint3">
1373 <command_interface name="velocity"/>
1374 <state_interface name="position"/>
1375 <state_interface name="does_not_exist"/>
1376 </joint>
1377 </ros2_control>
1378)";
1379
1380const auto hardware_resources_missing_state_keys =
1381 R"(
1382 <ros2_control name="TestActuatorHardware" type="actuator">
1383 <hardware>
1384 <plugin>test_actuator</plugin>
1385 </hardware>
1386 <joint name="joint1">
1387 <command_interface name="position"/>
1388 <state_interface name="position"/>
1389 <state_interface name="velocity"/>
1390 <state_interface name="does_not_exist"/>
1391 </joint>
1392 </ros2_control>
1393 <ros2_control name="TestSensorHardware" type="sensor">
1394 <hardware>
1395 <plugin>test_sensor</plugin>
1396 <param name="example_param_write_for_sec">2</param>
1397 <param name="example_param_read_for_sec">2</param>
1398 </hardware>
1399 <sensor name="sensor1">
1400 <state_interface name="velocity"/>
1401 <state_interface name="does_not_exist"/>
1402 <state_interface name="does_not_exist"/>
1403 </sensor>
1404 </ros2_control>
1405 <ros2_control name="TestSystemHardware" type="system">
1406 <hardware>
1407 <plugin>test_system</plugin>
1408 <param name="example_param_write_for_sec">2</param>
1409 <param name="example_param_read_for_sec">2</param>
1410 </hardware>
1411 <joint name="joint2">
1412 <command_interface name="velocity"/>
1413 <command_interface name="max_acceleration"/>
1414 <state_interface name="position"/>
1415 <state_interface name="velocity"/>
1416 </joint>
1417 <joint name="joint3">
1418 <command_interface name="velocity"/>
1419 <state_interface name="position"/>
1420 <state_interface name="velocity"/>
1421 <state_interface name="does_not_exist"/>
1422 </joint>
1423 </ros2_control>
1424)";
1425
1426const auto hardware_resources_missing_command_keys =
1427 R"(
1428 <ros2_control name="TestActuatorHardware" type="actuator">
1429 <hardware>
1430 <plugin>test_actuator</plugin>
1431 </hardware>
1432 <joint name="joint1">
1433 <command_interface name="position"/>
1434 <command_interface name="does_not_exist"/>
1435 <state_interface name="position"/>
1436 <state_interface name="velocity"/>
1437 </joint>
1438 </ros2_control>
1439 <ros2_control name="TestSensorHardware" type="sensor">
1440 <hardware>
1441 <plugin>test_sensor</plugin>
1442 <param name="example_param_write_for_sec">2</param>
1443 <param name="example_param_read_for_sec">2</param>
1444 </hardware>
1445 <sensor name="sensor1">
1446 <state_interface name="velocity"/>
1447 </sensor>
1448 </ros2_control>
1449 <ros2_control name="TestSystemHardware" type="system">
1450 <hardware>
1451 <plugin>test_system</plugin>
1452 <param name="example_param_write_for_sec">2</param>
1453 <param name="example_param_read_for_sec">2</param>
1454 </hardware>
1455 <joint name="joint2">
1456 <command_interface name="velocity"/>
1457 <command_interface name="max_acceleration"/>
1458 <state_interface name="position"/>
1459 <state_interface name="velocity"/>
1460 </joint>
1461 <joint name="joint3">
1462 <command_interface name="velocity"/>
1463 <command_interface name="does_not_exist"/>
1464 <state_interface name="position"/>
1465 <state_interface name="velocity"/>
1466 </joint>
1467 </ros2_control>
1468)";
1469
1470const auto hardware_resources_missing_gpio_state_keys =
1471 R"(
1472 <ros2_control name="TestSystemHardware" type="system">
1473 <hardware>
1474 <plugin>test_system</plugin>
1475 </hardware>
1476 <joint name="joint2">
1477 <command_interface name="velocity"/>
1478 <command_interface name="max_acceleration"/>
1479 <state_interface name="position"/>
1480 <state_interface name="velocity"/>
1481 </joint>
1482 <gpio name="configuration">
1483 <command_interface name="max_tcp_jerk"/>
1484 <state_interface name="max_tcp_jerk"/>
1485 <state_interface name="does_not_exist"/>
1486 </gpio>
1487 </ros2_control>
1488)";
1489
1490const auto hardware_resources_missing_gpio_command_keys =
1491 R"(
1492 <ros2_control name="TestSystemHardware" type="system">
1493 <hardware>
1494 <plugin>test_system</plugin>
1495 </hardware>
1496 <joint name="joint2">
1497 <command_interface name="velocity"/>
1498 <command_interface name="max_acceleration"/>
1499 <state_interface name="position"/>
1500 <state_interface name="velocity"/>
1501 </joint>
1502 <gpio name="configuration">
1503 <command_interface name="max_tcp_jerk"/>
1504 <command_interface name="does_not_exist"/>
1505 <state_interface name="max_tcp_jerk"/>
1506 </gpio>
1507 </ros2_control>
1508)";
1509
1510const auto hardware_resources_with_exclusive_interface =
1511 R"(
1512 <ros2_control name="TestActuatorHardware1" type="actuator">
1513 <hardware>
1514 <plugin>test_actuator_exclusive_interfaces</plugin>
1515 </hardware>
1516 <joint name="joint1">
1517 <command_interface name="position"/>
1518 <command_interface name="velocity"/>
1519 <command_interface name="effort"/>
1520 <state_interface name="position"/>
1521 <state_interface name="velocity"/>
1522 <state_interface name="effort"/>
1523 </joint>
1524 </ros2_control>
1525 <ros2_control name="TestActuatorHardware2" type="actuator">
1526 <hardware>
1527 <plugin>test_actuator_exclusive_interfaces</plugin>
1528 </hardware>
1529 <joint name="joint2">
1530 <command_interface name="position"/>
1531 <command_interface name="velocity"/>
1532 <command_interface name="effort"/>
1533 <state_interface name="position"/>
1534 <state_interface name="velocity"/>
1535 <state_interface name="effort"/>
1536 </joint>
1537 </ros2_control>
1538 <ros2_control name="TestActuatorHardware3" type="actuator">
1539 <hardware>
1540 <plugin>test_actuator_exclusive_interfaces</plugin>
1541 </hardware>
1542 <joint name="joint3">
1543 <command_interface name="position"/>
1544 <command_interface name="velocity"/>
1545 <command_interface name="effort"/>
1546 <state_interface name="position"/>
1547 <state_interface name="velocity"/>
1548 <state_interface name="effort"/>
1549 </joint>
1550 </ros2_control>
1551 <ros2_control name="TestSensorHardware" type="sensor">
1552 <hardware>
1553 <plugin>test_sensor</plugin>
1554 <param name="example_param_write_for_sec">2</param>
1555 <param name="example_param_read_for_sec">2</param>
1556 </hardware>
1557 <sensor name="sensor1">
1558 <state_interface name="velocity"/>
1559 </sensor>
1560 </ros2_control>
1561)";
1562
1563const auto diffbot_urdf =
1564 R"(
1565<?xml version="1.0" ?>
1566<robot name="robot">
1567 <!-- Space btw top of beam and the each joint -->
1568 <!-- Links: inertial,visual,collision -->
1569 <link name="base_link">
1570 <inertial>
1571 <!-- origin is relative -->
1572 <origin rpy="0 0 0" xyz="0 0 0"/>
1573 <mass value="5"/>
1574 <inertia ixx="5" ixy="0" ixz="0" iyy="5" iyz="0" izz="5"/>
1575 </inertial>
1576 <visual>
1577 <geometry>
1578 <box size="0.5 0.1 0.1"/>
1579 </geometry>
1580 </visual>
1581 <collision>
1582 <!-- origin is relative -->
1583 <origin xyz="0 0 0"/>
1584 <geometry>
1585 <box size="0.5 0.1 0.1"/>
1586 </geometry>
1587 </collision>
1588 </link>
1589 <link name="base_footprint">
1590 <visual>
1591 <geometry>
1592 <sphere radius="0.01"/>
1593 </geometry>
1594 </visual>
1595 <collision>
1596 <origin xyz="0 0 0"/>
1597 <geometry>
1598 <sphere radius="0.00000001"/>
1599 </geometry>
1600 </collision>
1601 </link>
1602 <joint name="base_footprint_joint" type="fixed">
1603 <origin rpy="0 0 0" xyz="0 0 0.11"/>
1604 <child link="base_link"/>
1605 <parent link="base_footprint"/>
1606 </joint>
1607 <link name="wheel_0_link">
1608 <inertial>
1609 <origin rpy="0 0 0" xyz="0 0 0"/>
1610 <mass value="1"/>
1611 <inertia ixx="0.2" ixy="0" ixz="0" iyy="0.2" iyz="0" izz="0.2"/>
1612 </inertial>
1613 <visual>
1614 <origin rpy="0 0 0" xyz="0 0 0"/>
1615 <geometry>
1616 <cylinder length="0.086" radius="0.11"/>
1617 </geometry>
1618 </visual>
1619 <collision>
1620 <origin rpy="0 0 0" xyz="0 0 0"/>
1621 <geometry>
1622 <cylinder length="0.086" radius="0.11"/>
1623 </geometry>
1624 </collision>
1625 </link>
1626 <joint name="wheel_left" type="continuous">
1627 <parent link="base_link"/>
1628 <child link="wheel_0_link"/>
1629 <origin rpy="-1.5707963267948966 0 0" xyz="0.3 0 0"/>
1630 <axis xyz="0 0 1"/>
1631 <limit effort="100" velocity="1.0"/>
1632 </joint>
1633 <!-- Transmission is important to link the joints and the controller -->
1634 <transmission name="wheel_left_trans" type="SimpleTransmission">
1635 <actuator name="wheel_left_motor"/>
1636 <joint name="wheel_left"/>
1637 <mechanicalReduction>1</mechanicalReduction>
1638 <motorTorqueConstant>1</motorTorqueConstant>
1639 </transmission>
1640 <gazebo reference="wheel_0_link">
1641 <material>Gazebo/Red</material>
1642 </gazebo>
1643 <link name="wheel_1_link">
1644 <inertial>
1645 <origin rpy="0 0 0" xyz="0 0 0"/>
1646 <mass value="1"/>
1647 <inertia ixx="0.2" ixy="0" ixz="0" iyy="0.2" iyz="0" izz="0.2"/>
1648 </inertial>
1649 <visual>
1650 <origin rpy="0 0 0" xyz="0 0 0"/>
1651 <geometry>
1652 <cylinder length="0.086" radius="0.11"/>
1653 </geometry>
1654 </visual>
1655 <collision>
1656 <origin rpy="0 0 0" xyz="0 0 0"/>
1657 <geometry>
1658 <cylinder length="0.086" radius="0.11"/>
1659 </geometry>
1660 </collision>
1661 </link>
1662 <joint name="wheel_right" type="continuous">
1663 <parent link="base_link"/>
1664 <child link="wheel_1_link"/>
1665 <origin rpy="-1.5707963267948966 0 0" xyz="-0.2 0 0"/>
1666 <axis xyz="0 0 1"/>
1667 <limit effort="100" velocity="1.0"/>
1668 </joint>
1669 <!-- Transmission is important to link the joints and the controller -->
1670 <transmission name="wheel_right_trans" type="SimpleTransmission">
1671 <actuator name="wheel_right_motor"/>
1672 <joint name="wheel_right"/>
1673 <mechanicalReduction>1</mechanicalReduction>
1674 <motorTorqueConstant>1</motorTorqueConstant>
1675 </transmission>
1676 <gazebo reference="wheel_1_link">
1677 <material>Gazebo/Red</material>
1678 </gazebo>
1679 <!-- Colour -->
1680 <gazebo reference="base_link">
1681 <material>Gazebo/Green</material>
1682 </gazebo>
1683 <gazebo reference="base_footprint">
1684 <material>Gazebo/Purple</material>
1685 </gazebo>
1686 <ros2_control name="TestActuatorHardwareLeft" type="actuator">
1687 <hardware>
1688 <plugin>test_actuator</plugin>
1689 </hardware>
1690 <joint name="wheel_left">
1691 <state_interface name="position"/>
1692 <command_interface name="velocity"/>
1693 <state_interface name="velocity"/>
1694 </joint>
1695 </ros2_control>
1696 <ros2_control name="TestActuatorHardwareRight" type="actuator">
1697 <hardware>
1698 <plugin>test_actuator</plugin>
1699 </hardware>
1700 <joint name="wheel_right">
1701 <state_interface name="position"/>
1702 <command_interface name="velocity"/>
1703 <state_interface name="velocity"/>
1704 </joint>
1705 </ros2_control>
1706 <ros2_control name="TestIMUSensorHardware" type="sensor">
1707 <hardware>
1708 <plugin>test_hardware_components/TestIMUSensor</plugin>
1709 </hardware>
1710 <sensor name="base_imu">
1711 <state_interface name="orientation.x"/>
1712 <state_interface name="orientation.y"/>
1713 <state_interface name="orientation.z"/>
1714 <state_interface name="orientation.w"/>
1715 <state_interface name="angular_velocity.x"/>
1716 <state_interface name="angular_velocity.y"/>
1717 <state_interface name="angular_velocity.z"/>
1718 <state_interface name="linear_acceleration.x"/>
1719 <state_interface name="linear_acceleration.y"/>
1720 <state_interface name="linear_acceleration.z"/>
1721 </sensor>
1722 </ros2_control>
1723</robot>
1724)";
1725
1726const auto gripper_urdf_head =
1727 R"(<?xml version="1.0" ?>
1728<robot name="gripper">
1729 <link name="world"/>
1730 <link name="base">
1731 <visual>
1732 <geometry>
1733 <box size="0.5 1 1"/>
1734 </geometry>
1735 <origin xyz="0 0 0.5"/>
1736 <material name="violet">
1737 <color rgba="0.4 0.18 0.57 1.0" />
1738 </material>
1739 </visual>
1740 <inertial>
1741 <mass value="50"/>
1742 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1743 </inertial>
1744 </link>
1745 <link name="finger_right">
1746 <visual>
1747 <geometry>
1748 <box size="0.4 0.1 1"/>
1749 </geometry>
1750 <origin xyz="0 0.05 0.5"/>
1751 <material name="grey">
1752 <color rgba="0.2 0.2 0.2 1"/>
1753 </material>
1754 </visual>
1755 <inertial>
1756 <mass value="5"/>
1757 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1758 </inertial>
1759 </link>
1760 <link name="finger_left">
1761 <visual>
1762 <geometry>
1763 <box size="0.4 0.1 1"/>
1764 </geometry>
1765 <origin xyz="0 0.05 0.5"/>
1766 <material name="grey">
1767 <color rgba="0.2 0.2 0.2 1"/>
1768 </material>
1769 </visual>
1770 <inertial>
1771 <mass value="5"/>
1772 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1773 </inertial>
1774 </link>
1775 <joint name="world_to_base" type="fixed">
1776 <origin rpy="0 0 0" xyz="0 0 0"/>
1777 <parent link="world"/>
1778 <child link="base"/>
1779 </joint>
1780 <joint name="right_finger_joint" type="prismatic">
1781 <axis xyz="0 1 0"/>
1782 <origin xyz="0.0 -0.48 1" rpy="0.0 0.0 0.0"/>
1783 <parent link="base"/>
1784 <child link="finger_right"/>
1785 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1786 </joint>
1787 <joint name="left_finger_joint" type="prismatic">
1788 <mimic joint="right_finger_joint" multiplier="2" offset="1"/>
1789 <axis xyz="0 1 0"/>
1790 <origin xyz="0.0 0.48 1" rpy="0.0 0.0 3.1415926535"/>
1791 <parent link="base"/>
1792 <child link="finger_left"/>
1793 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1794 </joint>
1795)";
1796
1797const auto gripper_urdf_head_no_mimic =
1798 R"(<?xml version="1.0" ?>
1799<robot name="gripper">
1800 <link name="world"/>
1801 <link name="base">
1802 <visual>
1803 <geometry>
1804 <box size="0.5 1 1"/>
1805 </geometry>
1806 <origin xyz="0 0 0.5"/>
1807 <material name="violet">
1808 <color rgba="0.4 0.18 0.57 1.0" />
1809 </material>
1810 </visual>
1811 <inertial>
1812 <mass value="50"/>
1813 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1814 </inertial>
1815 </link>
1816 <link name="finger_right">
1817 <visual>
1818 <geometry>
1819 <box size="0.4 0.1 1"/>
1820 </geometry>
1821 <origin xyz="0 0.05 0.5"/>
1822 <material name="grey">
1823 <color rgba="0.2 0.2 0.2 1"/>
1824 </material>
1825 </visual>
1826 <inertial>
1827 <mass value="5"/>
1828 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1829 </inertial>
1830 </link>
1831 <link name="finger_left">
1832 <visual>
1833 <geometry>
1834 <box size="0.4 0.1 1"/>
1835 </geometry>
1836 <origin xyz="0 0.05 0.5"/>
1837 <material name="grey">
1838 <color rgba="0.2 0.2 0.2 1"/>
1839 </material>
1840 </visual>
1841 <inertial>
1842 <mass value="5"/>
1843 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1844 </inertial>
1845 </link>
1846 <joint name="world_to_base" type="fixed">
1847 <origin rpy="0 0 0" xyz="0 0 0"/>
1848 <parent link="world"/>
1849 <child link="base"/>
1850 </joint>
1851 <joint name="right_finger_joint" type="prismatic">
1852 <axis xyz="0 1 0"/>
1853 <origin xyz="0.0 -0.48 1" rpy="0.0 0.0 0.0"/>
1854 <parent link="base"/>
1855 <child link="finger_right"/>
1856 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1857 </joint>
1858 <joint name="left_finger_joint" type="prismatic">
1859 <axis xyz="0 1 0"/>
1860 <origin xyz="0.0 0.48 1" rpy="0.0 0.0 3.1415926535"/>
1861 <parent link="base"/>
1862 <child link="finger_left"/>
1863 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1864 </joint>
1865)";
1866
1867const auto gripper_urdf_head_unknown_joint =
1868 R"(<?xml version="1.0" ?>
1869<robot name="gripper">
1870 <link name="world"/>
1871 <link name="base">
1872 <visual>
1873 <geometry>
1874 <box size="0.5 1 1"/>
1875 </geometry>
1876 <origin xyz="0 0 0.5"/>
1877 <material name="violet">
1878 <color rgba="0.4 0.18 0.57 1.0" />
1879 </material>
1880 </visual>
1881 <inertial>
1882 <mass value="50"/>
1883 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1884 </inertial>
1885 </link>
1886 <link name="finger_right">
1887 <visual>
1888 <geometry>
1889 <box size="0.4 0.1 1"/>
1890 </geometry>
1891 <origin xyz="0 0.05 0.5"/>
1892 <material name="grey">
1893 <color rgba="0.2 0.2 0.2 1"/>
1894 </material>
1895 </visual>
1896 <inertial>
1897 <mass value="5"/>
1898 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1899 </inertial>
1900 </link>
1901 <link name="finger_left">
1902 <visual>
1903 <geometry>
1904 <box size="0.4 0.1 1"/>
1905 </geometry>
1906 <origin xyz="0 0.05 0.5"/>
1907 <material name="grey">
1908 <color rgba="0.2 0.2 0.2 1"/>
1909 </material>
1910 </visual>
1911 <inertial>
1912 <mass value="5"/>
1913 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1914 </inertial>
1915 </link>
1916 <joint name="world_to_base" type="fixed">
1917 <origin rpy="0 0 0" xyz="0 0 0"/>
1918 <parent link="world"/>
1919 <child link="base"/>
1920 </joint>
1921 <joint name="right_finger_joint" type="prismatic">
1922 <axis xyz="0 1 0"/>
1923 <origin xyz="0.0 -0.48 1" rpy="0.0 0.0 0.0"/>
1924 <parent link="base"/>
1925 <child link="finger_right"/>
1926 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1927 </joint>
1928 <joint name="left_finger_joint" type="prismatic">
1929 <mimic joint="middle_finger_joint" multiplier="1" offset="0"/>
1930 <axis xyz="0 1 0"/>
1931 <origin xyz="0.0 0.48 1" rpy="0.0 0.0 3.1415926535"/>
1932 <parent link="base"/>
1933 <child link="finger_left"/>
1934 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1935 </joint>
1936)";
1937
1938const auto gripper_urdf_head_incomplete =
1939 R"(<?xml version="1.0" ?>
1940<robot name="gripper">
1941 <link name="world"/>
1942 <link name="base">
1943 <visual>
1944 <geometry>
1945 <box size="0.5 1 1"/>
1946 </geometry>
1947 <origin xyz="0 0 0.5"/>
1948 <material name="violet">
1949 <color rgba="0.4 0.18 0.57 1.0" />
1950 </material>
1951 </visual>
1952 <inertial>
1953 <mass value="50"/>
1954 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1955 </inertial>
1956 </link>
1957 <link name="finger_right">
1958 <visual>
1959 <geometry>
1960 <box size="0.4 0.1 1"/>
1961 </geometry>
1962 <origin xyz="0 0.05 0.5"/>
1963 <material name="grey">
1964 <color rgba="0.2 0.2 0.2 1"/>
1965 </material>
1966 </visual>
1967 <inertial>
1968 <mass value="5"/>
1969 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
1970 </inertial>
1971 </link>
1972 <joint name="world_to_base" type="fixed">
1973 <origin rpy="0 0 0" xyz="0 0 0"/>
1974 <parent link="world"/>
1975 <child link="base"/>
1976 </joint>
1977 <joint name="right_finger_joint" type="prismatic">
1978 <axis xyz="0 1 0"/>
1979 <origin xyz="0.0 -0.48 1" rpy="0.0 0.0 0.0"/>
1980 <parent link="base"/>
1981 <child link="finger_right"/>
1982 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
1983 </joint>
1984)";
1985
1986const auto gripper_urdf_head_invalid_two_root_links =
1987 R"(<?xml version="1.0" ?>
1988<robot name="gripper">
1989 <link name="world"/>
1990 <link name="base">
1991 <visual>
1992 <geometry>
1993 <box size="0.5 1 1"/>
1994 </geometry>
1995 <origin xyz="0 0 0.5"/>
1996 <material name="violet">
1997 <color rgba="0.4 0.18 0.57 1.0" />
1998 </material>
1999 </visual>
2000 <inertial>
2001 <mass value="50"/>
2002 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
2003 </inertial>
2004 </link>
2005 <link name="finger_right">
2006 <visual>
2007 <geometry>
2008 <box size="0.4 0.1 1"/>
2009 </geometry>
2010 <origin xyz="0 0.05 0.5"/>
2011 <material name="grey">
2012 <color rgba="0.2 0.2 0.2 1"/>
2013 </material>
2014 </visual>
2015 <inertial>
2016 <mass value="5"/>
2017 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
2018 </inertial>
2019 </link>
2020 <link name="finger_left">
2021 <visual>
2022 <geometry>
2023 <box size="0.4 0.1 1"/>
2024 </geometry>
2025 <origin xyz="0 0.05 0.5"/>
2026 <material name="grey">
2027 <color rgba="0.2 0.2 0.2 1"/>
2028 </material>
2029 </visual>
2030 <inertial>
2031 <mass value="5"/>
2032 <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
2033 </inertial>
2034 </link>
2035 <joint name="world_to_base" type="fixed">
2036 <origin rpy="0 0 0" xyz="0 0 0"/>
2037 <parent link="world"/>
2038 <child link="base"/>
2039 </joint>
2040 <joint name="right_finger_joint" type="prismatic">
2041 <axis xyz="0 1 0"/>
2042 <origin xyz="0.0 -0.48 1" rpy="0.0 0.0 0.0"/>
2043 <parent link="base"/>
2044 <child link="finger_right"/>
2045 <limit effort="1000.0" lower="0" upper="0.38" velocity="10"/>
2046 </joint>
2047)";
2048
2049const auto gripper_hardware_resources_no_command_if =
2050 R"(
2051 <ros2_control name="TestGripper" type="system">
2052 <joint name="right_finger_joint">
2053 <command_interface name="effort"/>
2054 <state_interface name="position"/>
2055 <state_interface name="velocity"/>
2056 <state_interface name="effort"/>
2057 </joint>
2058 <joint name="left_finger_joint">
2059 <state_interface name="position"/>
2060 <state_interface name="velocity"/>
2061 </joint>
2062 </ros2_control>
2063 )";
2064
2065const auto gripper_hardware_resources_mimic_true_no_command_if =
2066 R"(
2067 <ros2_control name="TestGripper" type="system">
2068 <joint name="right_finger_joint">
2069 <command_interface name="effort"/>
2070 <state_interface name="position"/>
2071 <state_interface name="velocity"/>
2072 <state_interface name="effort"/>
2073 </joint>
2074 <joint name="left_finger_joint" mimic="true">
2075 <state_interface name="position"/>
2076 <state_interface name="velocity"/>
2077 </joint>
2078 </ros2_control>
2079 )";
2080
2081const auto gripper_hardware_resources_mimic_true_command_if =
2082 R"(
2083 <ros2_control name="TestGripper" type="system">
2084 <joint name="right_finger_joint">
2085 <command_interface name="effort"/>
2086 <state_interface name="position"/>
2087 <state_interface name="velocity"/>
2088 <state_interface name="effort"/>
2089 </joint>
2090 <joint name="left_finger_joint" mimic="true">
2091 <command_interface name="effort"/>
2092 <state_interface name="position"/>
2093 <state_interface name="velocity"/>
2094 </joint>
2095 </ros2_control>
2096 )";
2097
2098const auto gripper_hardware_resources_mimic_false_command_if =
2099 R"(
2100 <ros2_control name="TestGripper" type="system">
2101 <joint name="right_finger_joint">
2102 <command_interface name="effort"/>
2103 <state_interface name="position"/>
2104 <state_interface name="velocity"/>
2105 <state_interface name="effort"/>
2106 </joint>
2107 <joint name="left_finger_joint" mimic="false">
2108 <command_interface name="effort"/>
2109 <state_interface name="position"/>
2110 <state_interface name="velocity"/>
2111 </joint>
2112 </ros2_control>
2113 )";
2114
2115const auto diff_drive_robot_sdf =
2116 R"(
2117<?xml version="1.0" ?>
2118<sdf version="1.8">
2119 <model canonical_link="base_link" name="my_robot">
2120 <!-- BASE -->
2121 <link name="base_link">
2122 <must_be_base_link>true</must_be_base_link>
2123 </link>
2124 <!-- CHASSIS -->
2125 <joint name="chassis_joint" type="fixed">
2126 <parent>base_link</parent>
2127 <child>chassis_link</child>
2128 <pose relative_to="base_link">0 0 0.075 0 0 0</pose>
2129 </joint>
2130 <link name="chassis_link">
2131 <pose relative_to="chassis_joint"/>
2132 <visual name="chassis_link_visual">
2133 <geometry>
2134 <box>
2135 <size>
2136 0.3 0.3 0.15
2137 </size>
2138 </box>
2139 </geometry>
2140 <material>
2141 <ambient>1 1 1 1</ambient>
2142 <diffuse>1 1 1 1</diffuse>
2143 </material>
2144 </visual>
2145 <collision name="chassis_link_collision">
2146 <geometry>
2147 <box>
2148 <size>
2149 0.3 0.3 0.15
2150 </size>
2151 </box>
2152 </geometry>
2153 </collision>
2154 <inertial>
2155 <mass>0.5</mass>
2156 <inertia>
2157 <ixx>0.0046875</ixx>
2158 <ixy>0.0</ixy>
2159 <ixz>0.0</ixz>
2160 <iyy>0.0046875</iyy>
2161 <iyz>0.0</iyz>
2162 <izz>0.0075</izz>
2163 </inertia>
2164 </inertial>
2165 </link>
2166 <!-- lEFT WHEEL -->
2167 <joint name="left_wheel_joint" type="revolute">
2168 <parent>chassis_link</parent>
2169 <child>left_wheel_link</child>
2170 <pose relative_to="chassis_link">0.09 0.16999999999999998 -0.075 -1.5707963267948966 0 0</pose>
2171 <axis>
2172 <xyz>0 0 1</xyz>
2173 <limit>
2174 <lower>-inf</lower>
2175 <upper>inf</upper>
2176 </limit>
2177 </axis>
2178 </joint>
2179 <link name="left_wheel_link">
2180 <pose relative_to="left_wheel_joint"/>
2181 <visual name="left_wheel_link_visual">
2182 <geometry>
2183 <cylinder>
2184 <radius>0.05</radius>
2185 <length>0.04</length>
2186 </cylinder>
2187 </geometry>
2188 <material>
2189 <ambient>0 0 1</ambient>
2190 <diffuse>0 0 1</diffuse>
2191 </material>
2192 </visual>
2193 <collision name="left_wheel_link_collision">
2194 <geometry>
2195 <cylinder>
2196 <radius>0.05</radius>
2197 <length>0.04</length>
2198 </cylinder>
2199 </geometry>
2200 </collision>
2201 <inertial>
2202 <mass>0.1</mass>
2203 <inertia>
2204 <ixx>7.583333333333335e-05</ixx>
2205 <ixy>0.0</ixy>
2206 <ixz>0.0</ixz>
2207 <iyy>7.583333333333335e-05</iyy>
2208 <iyz>0.0</iyz>
2209 <izz>0.00012500000000000003</izz>
2210 </inertia>
2211 </inertial>
2212 </link>
2213 <!-- RIGHT WHEEL -->
2214 <joint name="right_wheel_joint" type="revolute">
2215 <parent>chassis_link</parent>
2216 <child>right_wheel_link</child>
2217 <pose relative_to="chassis_link">0.09 -0.16999999999999998 -0.075 -1.5707963267948966 0 0</pose>
2218 <axis>
2219 <xyz>0 0 1</xyz>
2220 <!-- limit would not be specified because if the type was continuous -->
2221 <limit>
2222 <lower>-inf</lower>
2223 <upper>inf</upper>
2224 </limit>
2225 </axis>
2226 </joint>
2227 <link name="right_wheel_link">
2228 <pose relative_to="right_wheel_joint"/>
2229 <visual name="right_wheel_link_visual">
2230 <geometry>
2231 <cylinder>
2232 <radius>0.05</radius>
2233 <length>0.04</length>
2234 </cylinder>
2235 </geometry>
2236 <material>
2237 <ambient>0 0 1</ambient>
2238 <diffuse>0 0 1</diffuse>
2239 </material>
2240 </visual>
2241 <collision name="right_wheel_link_collision">
2242 <geometry>
2243 <cylinder>
2244 <radius>0.05</radius>
2245 <length>0.04</length>
2246 </cylinder>
2247 </geometry>
2248 </collision>
2249 <inertial>
2250 <mass>0.1</mass>
2251 <inertia>
2252 <ixx>7.583333333333335e-05</ixx>
2253 <ixy>0.0</ixy>
2254 <ixz>0.0</ixz>
2255 <iyy>7.583333333333335e-05</iyy>
2256 <iyz>0.0</iyz>
2257 <izz>0.00012500000000000003</izz>
2258 </inertia>
2259 </inertial>
2260 </link>
2261 <!-- CASTER -->
2262 <joint name="caster_joint" type="revolute">
2263 <parent>chassis_link</parent>
2264 <child>caster_link</child>
2265 <pose relative_to="chassis_link">-0.09 0 -0.075 0 0 0</pose>
2266 <axis>
2267 <xyz>1 1 1</xyz>
2268 <limit>
2269 <lower>-inf</lower>
2270 <upper>inf</upper>
2271 </limit>
2272 </axis>
2273 </joint>
2274 <link name="caster_link">
2275 <pose relative_to="caster_joint"/>
2276 <visual name="caster_link_visual">
2277 <geometry>
2278 <sphere>
2279 <radius>0.05</radius>
2280 </sphere>
2281 </geometry>
2282 <material>
2283 <ambient>0 0 1</ambient>
2284 <diffuse>0 0 1</diffuse>
2285 </material>
2286 </visual>
2287 <collision name="caster_link_collision">
2288 <geometry>
2289 <sphere>
2290 <radius>0.05</radius>
2291 </sphere>
2292 </geometry>
2293 </collision>
2294 <inertial>
2295 <mass>0.1</mass>
2296 <inertia>
2297 <ixx>0.00010000000000000002</ixx>
2298 <ixy>0.0</ixy>
2299 <ixz>0.0</ixz>
2300 <iyy>0.00010000000000000002</iyy>
2301 <iyz>0.0</iyz>
2302 <izz>0.00010000000000000002</izz>
2303 </inertia>
2304 </inertial>
2305 </link>
2306 <ros2_control name="GazeboSimSystem" type="system">
2307 <hardware>
2308 <plugin>gz_ros2_control/GazeboSimSystem</plugin>
2309 </hardware>
2310 <joint name="left_wheel_joint">
2311 <command_interface name="velocity">
2312 <param name="min">-10</param>
2313 <param name="max">10</param>
2314 </command_interface>
2315 <state_interface name="velocity"/>
2316 <state_interface name="position"/>
2317 </joint>
2318 <joint name="right_wheel_joint">
2319 <command_interface name="velocity">
2320 <param name="min">-10</param>
2321 <param name="max">10</param>
2322 </command_interface>
2323 <state_interface name="velocity"/>
2324 <state_interface name="position"/>
2325 </joint>
2326 </ros2_control>
2327 <plugin filename="libgz_ros2_control-system.so" name="gz_ros2_control::GazeboSimROS2ControlPlugin">
2328 <parameters>/path/to/config.yml</parameters>
2329 </plugin>
2330 </model>
2331</sdf>
2332)";
2333
2334const auto invalid_urdf_without_hardware_plugin =
2335 R"(
2336 <robot name="minimal_robot">
2337 <link name="base_link"/>
2338 <joint name="joint1" type="revolute">
2339 <parent link="base_link"/>
2340 <child link="link1"/>
2341 <origin xyz="0 0 0"/>
2342 <axis xyz="0 0 1"/>
2343 <limit effort="10" lower="-1.57" upper="1.57" velocity="1.0"/>
2344 </joint>
2345 <link name="link1"/>
2346 <ros2_control name="default" type="system">
2347 </ros2_control>
2348 </robot>
2349)";
2350
2351const auto invalid_urdf_with_nonexistent_plugin =
2352 R"(
2353 <robot name="minimal_robot">
2354 <link name="base_link"/>
2355 <joint name="joint1" type="revolute">
2356 <parent link="base_link"/>
2357 <child link="link1"/>
2358 <origin xyz="0 0 0"/>
2359 <axis xyz="0 0 1"/>
2360 <limit effort="10" lower="-1.57" upper="1.57" velocity="1.0"/>
2361 </joint>
2362 <link name="link1"/>
2363 <ros2_control name="default" type="system">
2364 <hardware>
2365 <plugin>mock_components/NonExistentSystem</plugin>
2366 </hardware>
2367 </ros2_control>
2368 </robot>
2369)";
2370
2371const auto invalid_urdf_no_geometry =
2372 R"(
2373 <robot name="minimal_robot">
2374 <ros2_control name="default" type="system">
2375 <hardware>
2376 <plugin>mock_components/GenericSystem</plugin>
2377 </hardware>
2378 </ros2_control>
2379 </robot>
2380)";
2381
2382const auto minimal_robot_urdf = std::string(urdf_head) + std::string(hardware_resources) +
2383 std::string(minimal_robot_transmissions) + std::string(urdf_tail);
2384const auto minimal_robot_urdf_no_limits = std::string(urdf_head_continuous_missing_limits) +
2385 std::string(hardware_resources) + std::string(urdf_tail);
2386const auto minimal_async_robot_urdf =
2387 std::string(urdf_head) + std::string(async_hardware_resources) + std::string(urdf_tail);
2388const auto minimal_robot_urdf_with_different_hw_rw_rate =
2389 std::string(urdf_head) + std::string(hardware_resources_with_different_rw_rates) +
2390 std::string(urdf_tail);
2391const auto minimal_uninitializable_robot_urdf =
2392 std::string(urdf_head) + std::string(uninitializable_hardware_resources) + std::string(urdf_tail);
2393
2394const auto minimal_robot_not_existing_actuator_plugin =
2395 std::string(urdf_head) + std::string(hardware_resources_not_existing_actuator_plugin) +
2396 std::string(urdf_tail);
2397const auto minimal_robot_not_existing_sensors_plugin =
2398 std::string(urdf_head) + std::string(hardware_resources_not_existing_sensor_plugin) +
2399 std::string(urdf_tail);
2400const auto minimal_robot_not_existing_system_plugin =
2401 std::string(urdf_head) + std::string(hardware_resources_not_existing_system_plugin) +
2402 std::string(urdf_tail);
2403
2404const auto minimal_robot_duplicated_component =
2405 std::string(urdf_head) + std::string(hardware_resources_duplicated_component) +
2406 std::string(urdf_tail);
2407
2408const auto minimal_robot_actuator_initialization_error =
2409 std::string(urdf_head) + std::string(hardware_resources_not_existing_actuator_plugin) +
2410 std::string(urdf_tail);
2411const auto minimal_robot_sensor_initialization_error =
2412 std::string(urdf_head) + std::string(hardware_resources_sensor_initializaion_error) +
2413 std::string(urdf_tail);
2414const auto minimal_robot_system_initialization_error =
2415 std::string(urdf_head) + std::string(hardware_resources_system_initializaion_error) +
2416 std::string(urdf_tail);
2417
2418const auto minimal_robot_missing_state_keys_urdf =
2419 std::string(urdf_head) + std::string(hardware_resources_missing_state_keys) +
2420 std::string(urdf_tail);
2421
2422const auto minimal_robot_missing_command_keys_urdf =
2423 std::string(urdf_head) + std::string(hardware_resources_missing_command_keys) +
2424 std::string(urdf_tail);
2425
2426const auto minimal_robot_missing_gpio_state_keys_urdf =
2427 std::string(urdf_head) + std::string(hardware_resources_missing_gpio_state_keys) +
2428 std::string(urdf_tail);
2429
2430const auto minimal_robot_missing_gpio_command_keys_urdf =
2431 std::string(urdf_head) + std::string(hardware_resources_missing_gpio_command_keys) +
2432 std::string(urdf_tail);
2433
2434[[maybe_unused]] const std::string TEST_ACTUATOR_HARDWARE_NAME = "TestActuatorHardware";
2435[[maybe_unused]] const std::string TEST_ACTUATOR_HARDWARE_TYPE = "actuator";
2436[[maybe_unused]] const std::string TEST_ACTUATOR_HARDWARE_PLUGIN_NAME = "test_actuator";
2437[[maybe_unused]] const std::vector<std::string> TEST_ACTUATOR_HARDWARE_COMMAND_INTERFACES = {
2438 "joint1/position", "joint1/max_velocity"};
2439[[maybe_unused]] const std::vector<std::string> TEST_ACTUATOR_HARDWARE_STATE_INTERFACES = {
2440 "joint1/position", "joint1/velocity", "joint1/some_unlisted_interface"};
2441
2442[[maybe_unused]] const std::string TEST_SENSOR_HARDWARE_NAME = "TestSensorHardware";
2443[[maybe_unused]] const std::string TEST_SENSOR_HARDWARE_TYPE = "sensor";
2444[[maybe_unused]] const std::string TEST_SENSOR_HARDWARE_PLUGIN_NAME = "test_sensor";
2445[[maybe_unused]] const std::vector<std::string> TEST_SENSOR_HARDWARE_COMMAND_INTERFACES = {""};
2446[[maybe_unused]] const std::vector<std::string> TEST_SENSOR_HARDWARE_STATE_INTERFACES = {
2447 "sensor1/velocity"};
2448
2449[[maybe_unused]] const std::string TEST_SYSTEM_HARDWARE_NAME = "TestSystemHardware";
2450[[maybe_unused]] const std::string TEST_SYSTEM_HARDWARE_TYPE = "system";
2451[[maybe_unused]] const std::string TEST_SYSTEM_HARDWARE_PLUGIN_NAME = "test_system";
2452[[maybe_unused]] const std::vector<std::string> TEST_SYSTEM_HARDWARE_COMMAND_INTERFACES = {
2453 "joint2/velocity", "joint2/max_acceleration", "joint3/velocity", "configuration/max_tcp_jerk"};
2454[[maybe_unused]] const std::vector<std::string> TEST_SYSTEM_HARDWARE_STATE_INTERFACES = {
2455 "joint2/position", "joint2/velocity", "joint2/acceleration", "joint3/position",
2456 "joint3/velocity", "joint3/acceleration", "configuration/max_tcp_jerk"};
2457
2458} // namespace ros2_control_test_assets
2459
2460#endif // ROS2_CONTROL_TEST_ASSETS__DESCRIPTIONS_HPP_