Skip to content

Instantly share code, notes, and snippets.

@nmnmcc
Created September 15, 2025 09:11
Show Gist options
  • Select an option

  • Save nmnmcc/21dce2fb458059419b4e0a32377689b7 to your computer and use it in GitHub Desktop.

Select an option

Save nmnmcc/21dce2fb458059419b4e0a32377689b7 to your computer and use it in GitHub Desktop.
<?xml version="1.0" encoding="UTF-8"?>
<robot name="robot" xmlns:xacro="http://www.ros.org/wiki/xacro">
<link name="base_footprint"></link>
<link name="body">
<visual>
<geometry>
<box size="1 0.8 0.2" />
</geometry>
<material name="green">
<color rgba="0 255 0 1" />
</material>
<origin xyz="0 0 0" rpy="0 0 0" />
</visual>
</link>
<joint name="body_joint" type="fixed">
<parent link="base_footprint" />
<child link="body" />
<origin xyz="0 0 0.3" rpy="0 0 0" />
</joint>
<xacro:macro name="wheel" params="id">
<link name="wheel_${id}">
<visual>
<geometry>
<cylinder radius="0.1" length="0.2" />
</geometry>
<material name="blue">
<color rgba="0 0 255 1" />
</material>
<origin xyz="0 0 0" rpy="0.0 0.0 0.0" />
</visual>
<collision>
<geometry>
<cylinder radius="0.1" length="0.2" />
</geometry>
<origin xyz="0 0 0" rpy="0.0 0.0 0.0" />
</collision>
</link>
</xacro:macro>
<!-- FL: Front-Left... -->
<xacro:wheel id="FL" />
<xacro:wheel id="FR" />
<xacro:wheel id="BL" />
<xacro:wheel id="BR" />
<xacro:macro name="wheel_joint" params="id x y">
<joint name="wheel_joint_${id}" type="continuous">
<parent link="body" />
<child link="wheel_${id}" />
<origin xyz="${x} ${y} -0.2" rpy="1.57079 0 0" />
<axis xyz="0 1 0" />
</joint>
</xacro:macro>
<xacro:wheel_joint id="FL" x="-0.3" y="0.3" />
<xacro:wheel_joint id="FR" x="0.3" y="0.3" />
<xacro:wheel_joint id="BL" x="-0.3" y="-0.3" />
<xacro:wheel_joint id="BR" x="0.3" y="-0.3" />
<link name="laser_base">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<cylinder radius="0.05" length="0.4" />
</geometry>
<material name="yellow">
<color rgba="255 255 0 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<cylinder radius="0.05" length="0.4" />
</geometry>
</collision>
</link>
<joint name="laser_base_joint" type="fixed">
<parent link="body" />
<child link="laser_base" />
<origin xyz="0 0 0.3" rpy="0 0 0" />
<axis xyz="0 0 1" />
</joint>
<link name="laser">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="0.2 0.2 0.2" />
</geometry>
<material name="red">
<color rgba="255 0 0 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="0.05 0.05 0.05" />
</geometry>
</collision>
</link>
<joint name="laser_laser_base_joint" type="fixed">
<parent link="laser_base" />
<child link="laser" />
<origin xyz="0 0 0.3" rpy="0 0 0" />
<axis xyz="0 0 1" />
</joint>
<link name="deep_camera">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="0.2 0.4 0.2" />
</geometry>
<material name="purple">
<color rgba="128 0 128 1" />
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="0.1 0.1 0.1" />
</geometry>
</collision>
</link>
<joint name="deep_camera_joint" type="fixed">
<parent link="body" />
<child link="deep_camera" />
<origin xyz="0.4 0 0.2" rpy="0 0 0" />
</joint>
</robot>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment