bot_mini_description/urdf/diffbot_description.urdf.xacro

225 lines
7.9 KiB
Plaintext
Raw Normal View History

2023-06-12 07:52:34 +00:00
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:macro name="diffbot" params="prefix">
2023-11-20 11:29:13 +00:00
<xacro:include filename="inertial_macros.xacro"/>
2023-06-12 07:52:34 +00:00
2023-06-13 08:02:56 +00:00
<!-- Constants for robot dimensions -->
<xacro:property name="PI" value="3.1415926535897931"/>
2023-11-20 11:29:13 +00:00
<!-- new properties -->
<xacro:property name="chassis_length" value="0.34"/>
<xacro:property name="chassis_width" value="0.26"/>
<xacro:property name="chassis_height" value="0.123"/>
<xacro:property name="chassis_mass" value="3.0"/>
<xacro:property name="wheel_radius" value="0.0625"/>
<xacro:property name="wheel_thickness" value="0.020"/>
<xacro:property name="wheel_mass" value="0.02"/>
<xacro:property name="wheel_offset_x" value="0.285748"/>
<xacro:property name="wheel_offset_y" value="0.33675"/>
<xacro:property name="wheel_offset_z" value="-0.035"/>
<xacro:property name="caster_wheel_radius" value="0.04"/>
<xacro:property name="caster_wheel_mass" value="0.01"/>
<xacro:property name="caster_wheel_offset_x" value="0.075"/>
<xacro:property name="caster_wheel_offset_z" value="${wheel_offset_z - wheel_radius + caster_wheel_radius}"/>
2023-11-20 11:40:22 +00:00
<xacro:property name="chassis_offset" value="0.065"/>
2023-11-20 11:11:08 +00:00
2023-06-13 08:02:56 +00:00
<!-- Base Link -->
<link name="${prefix}base_link">
</link>
2023-06-13 07:25:34 +00:00
2023-06-12 09:14:49 +00:00
<!-- Adding base_footprint for mapping (Needed by slam toolbox) -->
<joint name="${prefix}base_footprint_joint" type="fixed">
<parent link="${prefix}base_link" />
<child link="${prefix}base_footprint" />
2023-11-20 11:29:13 +00:00
<origin xyz="0 0 0" rpy="0 0 0" />
2023-06-12 09:14:49 +00:00
</joint>
2023-11-20 11:29:13 +00:00
<link name="${prefix}base_footprint">
</link>
<!-- CHASSIS LINK -->
<joint name="${prefix}chassis_joint" type="fixed">
<parent link="${prefix}base_link"/>
<child link="${prefix}chassis"/>
2023-11-20 16:46:35 +00:00
<origin xyz="${-chassis_length/2 + chassis_offset} 0 ${wheel_radius - wheel_offset_z}"/>
2023-11-20 11:29:13 +00:00
</joint>
<link name="${prefix}chassis">
<visual>
<origin xyz="0 0 0"/>
<geometry>
<box size="${chassis_length} ${chassis_width} ${chassis_height}"/>
</geometry>
<material name="orange"/>
</visual>
<collision>
<origin xyz="0 0 0"/>
<geometry>
<box size="${chassis_length} ${chassis_width} ${chassis_height}"/>
</geometry>
</collision>
<xacro:inertial_box mass="0.5" x="${chassis_length}" y="${chassis_width}" z="${chassis_height}">
<origin xyz="0 0 0" rpy="0 0 0"/>
</xacro:inertial_box>
</link>
<gazebo reference="chassis">
<material>Gazebo/Orange</material>
</gazebo>
<!-- RIGHT WHEEL -->
2023-06-13 08:02:56 +00:00
<joint name="${prefix}right_wheel_joint" type="continuous">
2023-11-20 11:29:13 +00:00
<parent link="${prefix}chassis"/>
<child link="${prefix}right_wheel"/>
<origin xyz="${chassis_length/2 - 0.075} -${wheel_offset_y/2 + wheel_thickness/2 + 0.01} ${wheel_offset_z}" rpy="${pi/2} 0 0" />
<axis xyz="0 0 -1"/>
<limit effort="1" velocity="20" />
<joint_properties friction="0.0"/>
2023-06-13 08:02:56 +00:00
</joint>
2023-06-12 07:52:34 +00:00
2023-06-13 08:02:56 +00:00
<link name="${prefix}right_wheel">
2023-11-20 11:29:13 +00:00
<visual>
<geometry>
<cylinder radius="${wheel_radius}" length="${wheel_thickness}"/>
</geometry>
<material name="blue"/>
</visual>
<collision>
<geometry>
<sphere radius="${wheel_radius}"/>
</geometry>
</collision>
<xacro:inertial_cylinder mass="${wheel_mass}" length="${wheel_thickness}" radius="${wheel_radius}">
<origin xyz="0 0 0" rpy="0 0 0"/>
</xacro:inertial_cylinder>
2023-06-13 08:02:56 +00:00
</link>
2023-06-13 07:25:34 +00:00
2023-11-20 11:29:13 +00:00
<gazebo reference="right_wheel">
<material>Gazebo/Blue</material>
</gazebo>
<!-- LEFT WHEEL -->
2023-06-13 08:02:56 +00:00
<joint name="${prefix}left_wheel_joint" type="continuous">
2023-11-20 11:29:13 +00:00
<parent link="${prefix}chassis"/>
<child link="${prefix}left_wheel"/>
<origin xyz="${chassis_length/2 - 0.075} ${wheel_offset_y/2 + wheel_thickness/2 + 0.01} ${wheel_offset_z}" rpy="-${pi/2} 0 0" />
<axis xyz="0 0 1"/>
2023-06-13 07:25:34 +00:00
</joint>
2023-06-13 08:02:56 +00:00
<link name="${prefix}left_wheel">
2023-11-20 11:29:13 +00:00
<visual>
<geometry>
<cylinder radius="${wheel_radius}" length="${wheel_thickness}"/>
</geometry>
<material name="blue"/>
</visual>
<collision>
<geometry>
<sphere radius="${wheel_radius}"/>
</geometry>
</collision>
<xacro:inertial_cylinder mass="${wheel_mass}" length="${wheel_thickness}" radius="${wheel_radius}">
<origin xyz="0 0 0" rpy="0 0 0"/>
</xacro:inertial_cylinder>
2023-06-13 08:02:56 +00:00
</link>
2023-11-20 11:29:13 +00:00
<gazebo reference="left_wheel">
<material>Gazebo/Blue</material>
</gazebo>
<!-- CASTER WHEEL -->
2023-06-13 08:02:56 +00:00
<joint name="${prefix}caster_wheel_joint" type="fixed">
2023-11-20 11:29:13 +00:00
<parent link="${prefix}chassis"/>
<child link="${prefix}caster_wheel"/>
<origin xyz="-${caster_wheel_offset_x*2} 0 ${caster_wheel_offset_z}"/>
2023-06-13 08:02:56 +00:00
</joint>
2023-06-12 07:52:34 +00:00
2023-06-13 08:02:56 +00:00
<link name="${prefix}caster_wheel">
2023-11-20 11:29:13 +00:00
<visual>
<geometry>
<sphere radius="${caster_wheel_radius}"/>
</geometry>
<material name="white"/>
</visual>
<collision>
<geometry>
<sphere radius="${caster_wheel_radius}"/>
</geometry>
</collision>
<xacro:inertial_sphere mass="${caster_wheel_mass}" radius="${caster_wheel_radius}">
<origin xyz="0 0 0" rpy="0 0 0"/>
</xacro:inertial_sphere>
2023-06-13 08:02:56 +00:00
</link>
2023-06-12 07:52:34 +00:00
2023-11-20 11:29:13 +00:00
<gazebo reference="caster_wheel">
<material>Gazebo/White</material>
<mu1 value="0.001"/>
<mu2 value="0.001"/>
</gazebo>
2023-06-12 08:12:38 +00:00
2023-11-20 11:29:13 +00:00
<!-- LASER -->
2023-06-13 08:02:56 +00:00
<joint name="${prefix}laser_joint" type="fixed">
2023-11-20 11:29:13 +00:00
<parent link="${prefix}chassis"/>
<child link="${prefix}laser_frame"/>
2023-11-20 16:50:49 +00:00
<origin xyz="-0.07 0 0.10" rpy="0 0 ${pi}"/>
2023-06-13 08:02:56 +00:00
</joint>
2023-11-20 11:29:13 +00:00
<link name="${prefix}laser_frame">
<visual>
<geometry>
<cylinder radius="0.04" length="0.05"/>
</geometry>
<material name="black"/>
</visual>
<collision>
<geometry>
<sphere radius="${caster_wheel_radius}"/>
</geometry>
</collision>
<xacro:inertial_sphere mass="${caster_wheel_mass}" radius="${caster_wheel_radius}">
<origin xyz="0 0 0" rpy="0 0 0"/>
</xacro:inertial_sphere>
</link>
<gazebo reference="laser_frame">
<material>Gazebo/White</material>
</gazebo>
2023-06-13 08:02:56 +00:00
<!-- camera_link -->
<link name="${prefix}camera_link">
2023-06-12 08:57:49 +00:00
<visual>
2023-06-13 08:02:56 +00:00
<origin xyz="0 0 0" rpy="0 -0 0" />
2023-06-12 08:57:49 +00:00
<geometry>
2023-11-20 09:06:40 +00:00
<mesh filename="package://cps_loki_description/mesh/camera_link_visual.stl"/>
2023-06-12 08:57:49 +00:00
</geometry>
2023-06-13 08:02:56 +00:00
<material name="camera_link_material">
<color rgba="0.26274509803921569651 0.28235294117647058432 0.30196078431372547213 1.0"/>
</material>
2023-06-12 08:57:49 +00:00
</visual>
2023-06-13 08:02:56 +00:00
<collision>
<origin xyz="0 0 0" rpy="0 -0 0" />
<geometry>
2023-11-20 09:06:40 +00:00
<mesh filename="package://cps_loki_description/mesh/camera_link_collision.stl"/>
2023-06-13 08:02:56 +00:00
</geometry>
</collision>
2023-06-12 08:57:49 +00:00
<inertial>
2023-06-13 08:02:56 +00:00
<origin xyz="5.3378961738576549005e-07 0.0016484827975361887251 -0.020840554768345870285" rpy="0 0 0"/>
<mass value="0.064008494238512375629" />
<inertia ixx="1.7394518695567356026e-05" ixy="-4.87317899857206066e-10" ixz="-1.7982620680900958214e-11" iyy="3.2074360900148983727e-05" iyz="2.0892555595878115295e-06" izz="2.8321439372619354409e-05" />
</inertial>
</link>
2023-06-12 08:12:38 +00:00
2023-06-13 08:02:56 +00:00
<!-- Camera Joint -->
<joint name="${prefix}camera_joint" type="fixed">
2023-11-20 11:40:22 +00:00
<origin xyz="${chassis_length / 2 - chassis_offset} 0 0" rpy="0 0 ${PI}" />
2023-06-13 08:02:56 +00:00
<parent link="${prefix}base_link" />
<child link="${prefix}camera_link" />
<axis xyz="0 0 1"/>
<limit effort="1" velocity="20" />
<joint_properties friction="0.0"/>
</joint>
2023-06-01 08:30:59 +00:00
2023-06-01 09:08:40 +00:00
</xacro:macro>
2023-06-13 08:02:56 +00:00
</robot>