Diff_drive Plugin Simulation Problem

asked 2016-07-19 21:48:47 -0500

Lunescense gravatar image

updated 2016-07-20 12:22:10 -0500

Hi, I have written a urdf file for a 2 wheeled robot, but I can't seem to get it to drive properly using the diff_drive_controller gazebo plugin. Instead of driving normally, the robot somersaults in the direction that I want it to move in. Is there anything I'm doing wrong when I'm setting the conditions of the plugin? I'm new to ROS.

<?xml version="1.0"?>

  <robot name="crobot">

<link name="base_link">
    <visual>
        <geometry>
            <box size="0.100 0.110 0.131"/>
        </geometry>     
        <origin xyz="0 0 0.0805"/>
    </visual>
    <collision>
        <geometry>
            <box size="0.100 0.110 0.131"/>
        </geometry> 
    </collision>
    <inertial>
        <mass value="1"/>
        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
    </inertial>
</link>

<link name="basecenter1">
    <visual>
        <geometry>
            <box size="0.10 0.34 0.131"/>
        </geometry>
        <origin xyz="0 0 0.0805"/>
    </visual>
    <collision>
        <geometry>
            <box size="0.10 0.34 0.131"/>
        </geometry> 
    </collision>
    <inertial>
        <mass value="0.1"/>
        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
    </inertial>
</link>

<link name="basecenter2">
    <visual>
        <geometry>
            <box size="0.330 0.110 0.131"/>
        </geometry>
        <origin xyz="0 0 0.0805"/>
    </visual>
    <collision>
        <geometry>
            <box size="0.330 0.110 0.131"/>
        </geometry> 
    </collision>
    <inertial>
        <mass value="0.1"/>
        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
    </inertial>
</link>

<link name="blcorner">
    <visual>
        <geometry>
            <cylinder length="0.131" radius=".12"/>
        </geometry>
        <origin xyz="0 0 0.0805"/>
    </visual>
    <collision>
        <geometry>
            <cylinder length="0.131" radius=".12"/>
        </geometry> 
    </collision>
    <inertial>
        <mass value="1"/>
        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
    </inertial>
</link>

<link name="brcorner">
    <visual>
        <geometry>
            <cylinder length="0.131" radius=".12"/>
        </geometry>
        <origin xyz="0 0 0.0805"/>
    </visual>
    <collision>
        <geometry>
            <cylinder length="0.131" radius=".12"/>
        </geometry> 
    </collision>
    <inertial>
        <mass value="1"/>
        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
    </inertial>
</link>

<link name="flcorner">
    <visual>
        <geometry>
            <cylinder length="0.131" radius=".11"/>
        </geometry>
        <origin xyz="0 0 0.0805"/>
    </visual>
    <collision>
        <geometry>
            <cylinder length="0.131" radius=".11"/>
        </geometry> 
    </collision>
    <inertial>
        <mass value="1"/>
        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
    </inertial>
</link>

<link name="frcorner">
    <visual>
        <geometry>
            <cylinder length="0.131" radius=".11"/>
        </geometry>
        <origin xyz="0 0 0.0805"/>
    </visual>
    <collision>
        <geometry>
            <cylinder length="0.131" radius=".11"/>
        </geometry> 
    </collision>
    <inertial>
        <mass value="1"/>
        <inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
    </inertial>
</link>

<link name="lwheel">
    <visual>
        <geometry>
            <cylinder length="0.018" radius="0.0325"/>
        </geometry>
        <origin rpy="0 1.570796 0" xyz="0 0 0"/>
        <material name="blue">
            <color rgba="0 0 .8 1"/>
        </material>
    </visual>
    <collision ...
(more)
edit retag flag offensive close merge delete

Comments

Check your inertia values, collision shapes, and joints. Also try reducing (or otherwise alternating) wheel torque.

nkoenig gravatar imagenkoenig ( 2016-07-20 13:14:24 -0500 )edit