Why is my robot wheel not colliding with the floor in Gazebo?
Hey guys,
I have a differential drive robot in Gazebo where the drive wheels aren't colliding with the floor for some reason:
I have a "collision" tag in the link, but it doesn't seem to be working. I'm using gazebo 9 with ros kinetic.
Below is my xacro:
<?xml version="1.0"?>
<robot name="ssr" xmlns:xacro="http://www.ros.org/wiki/xacro">
<material name="orange">
<color rgba="1.0 0.5 0.2 1" />
</material>
<material name="black">
<color rgba="0.2 0.2 0.2 1" />
</material>
<material name="body_color">
<color rgba="0.3 0.8 0.4 1" />
</material>
<link name="base_link" />
<link name="base_footprint">
<origin xyz="0 0 0" />
</link>
<joint name="base_footprint_joint" type="fixed">
<parent link="base_link" />
<child link="base_footprint" />
<origin rpy="0 0 0" xyz="0 0 0" />
</joint>
<xacro:property name="body_width" value="0.5" />
<xacro:property name="body_length" value="0.7" />
<xacro:property name="body_height" value="0.15" />
<xacro:property name="floor_gap" value="0.15" />
<xacro:property name="body_mass" value="10" />
<xacro:property name="laser_dist_x" value="0.25" />
<xacro:property name="laser_dist_z" value="0.2" />
<xacro:property name="caster_radius" value="0.04" />
<xacro:property name="caster_mass" value="0.5" />
<xacro:property name="drive_wheel_length" value="0.05" />
<xacro:property name="drive_wheel_radius" value="0.15" />
<xacro:property name="drive_wheel_mass" value="2" />
<xacro:property name="drive_wheel_separation" value="0.4" />
<xacro:macro name="ssr_caster_link" params="prefix offset_x offset_y">
<link name="${prefix}_caster_link">
<visual>
<origin xyz="0 0 0" />
<geometry>
<sphere radius="${caster_radius}" />
</geometry>
<material name="black" />
</visual>
<collision>
<origin xyz="0 0 0" />
<geometry>
<sphere radius="${caster_radius}" />
</geometry>
</collision>
<inertial>
<mass value="${caster_mass}" />
<origin xyz="0 0 0" />
<inertia ixx="${2 / 3 * caster_mass * caster_radius * caster_radius}"
ixy="0"
ixz="0"
iyy="${2 / 3 * caster_mass * caster_radius * caster_radius}"
iyz="0"
izz="${2 / 3 * caster_mass * caster_radius * caster_radius}" />
</inertial>
<surface>
<friction>
<ode>
<mu>0</mu>
<mu2>0</mu2>
<slip1>1</slip1>
<slip2>1</slip2>
<maxVel>0.01</maxVel>
<minDepth>0.001</minDepth>
</ode>
</friction>
</surface>
</link>
<gazebo reference="${prefix}_caster_link">
<mu>0</mu>
<mu2>0</mu2>
<slip1>1</slip1>
<slip2>1</slip2>
<maxVel>0.001</maxVel>
<minDepth>0.001</minDepth>
</gazebo>
<joint name="${prefix}_caster_joint" type="fixed">
<parent link="base_link" />
<child link="${prefix}_caster_link" />
<origin rpy="0 0 0" xyz="${offset_x} ${offset_y} ${caster_radius + 0.03}" />
</joint>
</xacro:macro>
<xacro:macro name="ssr_drive_wheel" params="prefix offset_y">
<link name="${prefix}_drive_wheel_link">
<visual>
<origin xyz="0 0 0" />
<geometry>
<cylinder length="${drive_wheel_length}" radius="${drive_wheel_radius}" />
</geometry>
<material name="black" />
</visual>
<collision>
<origin xyz="0 0 0" />
<geometry>
<cylinder length="${drive_wheel_length}" radius="${drive_wheel_radius}" />
</geometry>
</collision>
<inertial>
<mass value="${drive_wheel_mass}" />
<origin xyz="0 0 0" />
<inertia ixx="${1 / 12 * drive_wheel_mass * (3 * drive_wheel_radius * drive_wheel_radius + drive_wheel_length * drive_wheel_length)}"
ixy="0"
ixz="0"
iyy="${1 / 12 * drive_wheel_mass * (3 * drive_wheel_radius * drive_wheel_radius + drive_wheel_length * drive_wheel_length)}"
iyz="0"
izz="${1 / 2 * drive_wheel_mass * drive_wheel_radius * drive_wheel_radius}" />
</inertial>
</link>
<joint name="${prefix}_drive_wheel_joint" type="continuous">
<parent link="base_link" />
<child link="${prefix}_drive_wheel_link" />
<origin rpy="1.5707 0 0" xyz="0 ${offset_y} ${drive_wheel_radius}" />
<axis rpy="0 0 0" xyz="0 0 -1" />
<limit effort="50" velocity ...