ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Why is my robot wheel not colliding with the floor in Gazebo?

asked 2018-08-29 09:52:40 -0500

femtogram gravatar image

Hey guys,

I have a differential drive robot in Gazebo where the drive wheels aren't colliding with the floor for some reason: image description

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 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-08-29 10:02:37 -0500

femtogram gravatar image

I got rid of

<gazebo reference="${prefix}_drive_wheel_link">
<mu1 value="100.0" />
<mu2 value="100.0" />
<kp value="10000.0" />
<kd value="1.0" />
<!-- <fdir1 value="1 0 0" /> -->
<material>Gazebo/Grey</material>
<!-- <minDepth>0.001</minDepth> -->
</gazebo>

and it worked!

edit flag offensive delete link more

Comments

If you found the answer, please mark your question as answered

stevemacenski gravatar image stevemacenski  ( 2018-08-29 13:21:03 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-08-29 09:52:40 -0500

Seen: 961 times

Last updated: Aug 29 '18