Skip to content

Commit 1e72a0b

Browse files
yconstclaude
andcommitted
Add robot links/joints to URDF files
robot_state_publisher requires a complete robot description with links and joints. Added minimal base_link with wheel links for both URDFs. This fixes the error: Error: No link elements found in urdf file Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent e1a4bcf commit 1e72a0b

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

urdf/my_robot.urdf.xacro

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
<?xml version="1.0"?>
22
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="my_robot">
33

4+
<!-- Minimal robot description for robot_state_publisher -->
5+
<link name="base_link"/>
6+
7+
<link name="wheel_1_link"/>
8+
<joint name="wheel_1" type="continuous">
9+
<parent link="base_link"/>
10+
<child link="wheel_1_link"/>
11+
<origin xyz="0 0.2 0" rpy="0 0 0"/>
12+
<axis xyz="0 0 1"/>
13+
</joint>
14+
15+
<link name="wheel_2_link"/>
16+
<joint name="wheel_2" type="continuous">
17+
<parent link="base_link"/>
18+
<child link="wheel_2_link"/>
19+
<origin xyz="0 -0.2 0" rpy="0 0 0"/>
20+
<axis xyz="0 0 1"/>
21+
</joint>
22+
423
<ros2_control name="tinymovr_system" type="system">
524
<hardware>
625
<plugin>tinymovr_ros/TinymovrSystem</plugin>

urdf/tinymovr_diffbot.urdf.xacro

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
<?xml version="1.0"?>
22
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="tinymovr_diffbot">
33

4+
<!-- Minimal robot description for robot_state_publisher -->
5+
<link name="base_link"/>
6+
7+
<link name="wheel_1_link"/>
8+
<joint name="wheel_1" type="continuous">
9+
<parent link="base_link"/>
10+
<child link="wheel_1_link"/>
11+
<origin xyz="0 0.2 0" rpy="0 0 0"/>
12+
<axis xyz="0 0 1"/>
13+
</joint>
14+
15+
<link name="wheel_2_link"/>
16+
<joint name="wheel_2" type="continuous">
17+
<parent link="base_link"/>
18+
<child link="wheel_2_link"/>
19+
<origin xyz="0 -0.2 0" rpy="0 0 0"/>
20+
<axis xyz="0 0 1"/>
21+
</joint>
22+
423
<ros2_control name="tinymovr_system" type="system">
524
<hardware>
625
<plugin>tinymovr_ros/TinymovrSystem</plugin>

0 commit comments

Comments
 (0)