Difficulties with Gazebo differential drive plugin

asked 2022-07-17 13:52:11 -0500

Hi. I built my own URDF file and did the spawning with Gazebo. I am using Gazebo differential drive to control the front wheels. However when trying to turn the robot right or left, it takes edges to it is very slow. Not sure where is the issue...

<link name="front_right_wheel"> <visual> <geometry> <cylinder radius="0.1" length="0.05"/> </geometry> <material name="blue"/> </visual> <collision> <geometry> <cylinder radius="0.1" length="0.05"/> </geometry> </collision> <inertial> <mass value="2"/> <inertia ixx="0.005416667" ixy="0" ixz="0" iyy="0.005416667" iyz="0" izz="0.01"/> </inertial> </link> <gazebo reference="front_right_wheel"> <material>Gazebo/Green</material> <turngravityoff>false</turngravityoff> </gazebo> <joint name="front_right_wheel_joint" type="continuous"> <origin rpy="0 1.5707 1.5707" xyz="0.4 0.35 0"/> <parent link="chassis"/> <child link="front_right_wheel"/> <axis xyz="0 0 1"/> <limit effort="10000" velocity="1000"/> <joint_properties damping="1.0" friction="0.1"/> </joint>

<!-- Front LEFT WHEEL -->
<link name="front_left_wheel">
    <visual>
        <geometry>
            <cylinder radius="0.1" length="0.05"/>
        </geometry>
        <material name="blue"/>
    </visual>
    <collision>
        <geometry>
            <cylinder radius="0.1" length="0.05"/>
        </geometry>
    </collision>
    <inertial>
        <mass value="2"/>
        <inertia ixx="0.005416667" ixy="0" ixz="0" iyy="0.005416667" iyz="0" izz="0.01" />
    </inertial>
</link>
<gazebo reference="front_left_wheel">
<material>Gazebo/Green</material>
<turnGravityOff>false</turnGravityOff>
<!--<kp>100000.0</kp>
<kd>100000.0</kd>
<mu1>0.02</mu1>
<mu2>0.02</mu2>-->
</gazebo>
<joint name="front_left_wheel_joint" type="continuous">
    <origin rpy="0 1.5707 1.5707" xyz="0.4 -0.35 0"/>
    <parent link="chassis"/>
    <child link="front_left_wheel"/>
    <axis xyz="0 0 1"/>
    <limit effort="10000" velocity="1000"/>
    <joint_properties damping="1.0" friction="0.1"/>
</joint>

<gazebo> <plugin filename="libgazebo_ros_diff_drive.so" name="differential_drive_controller">

<!-- Number of wheel pairs -->
        <!--<num_wheel_pairs>2</num_wheel_pairs>-->

        <left_joint>front_left_wheel_joint</left_joint>
        <right_joint>front_right_wheel_joint</right_joint>

        <!--<left_joint>back_left_wheel_joint</left_joint>
        <right_joint>back_right_wheel_joint</right_joint>-->


        <wheel_separation>0.7</wheel_separation>
        <wheel_diameter>0.2</wheel_diameter>


        <max_wheel_torque>20</max_wheel_torque>
        <max_wheel_acceleration>2.0</max_wheel_acceleration>


        <odometry_frame>odom</odometry_frame>
        <robot_base_frame>base_link</robot_base_frame>

        <publish_odom>true</publish_odom>
        <publish_odom_tf>true</publish_odom_tf>
        <update_rate>100.0</update_rate>

    </plugin>
</gazebo>
edit retag flag offensive close merge delete