Gazebo | Ignition | Community
Ask Your Question
0

Differential drive robot wheels not attached to body, spawn at 0 0 0

asked 2020-12-22 09:28:25 -0500

updated 2020-12-27 07:46:58 -0500

I have created a differential drive robot to learn line following with a camera attached to it. My URDF was working correctly when changeing the innertiavalues of my body parts the wheels seem to spawn at 0 0 0 under the robot. The robot will not move, was moving when the wheels were attached but innertia was wrong. I can't seem to figure out what I am doing wrong . I have tried to change different values to no end. Image from Gazebo image description

The robot model is correct in Rviz image description

Here is my Urdf, I know this is not the most efficient way to do it, but I am hoping i don't need to rewrite using xacro to fix this `

<robot name="differential_robot_cam">

<material name="red">
    <color rgba="0.8 0 0 1"/>
</material>

<material name="blue">
    <color rgba="0 0 0.8 1"/>
</material>

<material name="black">
    <color rgba="0 0 0 1"/>
</material>

<material name="white">
    <color rgba="1 1 1 1"/>
</material>

<link name="base_link">
    <visual>
        <geometry>
            <cylinder length="0.023" radius="0.0825"/>
        </geometry>
        <material name="red"/>
    </visual>
    <collision>
        <geometry>
            <cylinder length="0.023" radius="0.0825"/>
        </geometry>
    </collision>
    <inertial>
        <mass value="0.1"/>
        <inertia ixx="0.0007" ixy="0.0" ixz="0.0" iyy="0.0007" iyz="0.0" izz="0.0007"/>
    </inertial>
</link>

<link name="base_footprint">
</link>

<joint name="footprint_to_base" type="fixed">
    <parent link="base_footprint"/>
    <child link="base_link"/>
    <origin xyz="0 0 0.06"/>
</joint>

<link name="odom">
</link>

<joint name="footprint_to_odom" type="fixed">
    <parent link="base_footprint"/>
    <child link="odom"/>
    <origin xyz="0 0 0"/>
</joint>

<link name="left_wheel">
    <visual>
        <origin rpy="1.57075 0 0" xyz="0 0 0"/>
        <geometry>
            <cylinder length="0.008" radius="0.035"/>
        </geometry>
        <material name="black"/>
    </visual>
    <collision>
    <avix xyz="0 -1 0" />
    <origin rpy="1.57075 0 0" xyz="-1 0 0"/>
        <geometry>
            <cylinder length="0.008" radius="0.035"/>
        </geometry>
    </collision>
    <inertial>
        <mass value="0.015"/>
        <inertia ixx="0.00002" ixy="0.0" ixz="0.0" iyy="0.00002" iyz="0.0" izz="0.00002"/>
    </inertial>
</link>

<joint name="base_to_left_wheel" type="continuous">
    <axis xyz="0 1 0" />
    <parent link="base_link"/>
    <child link="left_wheel"/>
    <origin xyz="0 0.0825 0"/>
</joint>

<transmission name="left_wheel_trans">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="base_to_left_wheel">
        <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
    </joint>
    <actuator name="left_wheel_motor">
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission> 


<gazebo reference="left_wheel">
    <mu1 value="100000.0"/>
    <mu2 value="3000000.0"/>
    <kp value="10000000.0" />
    <kd value="100000.0" />
    <material>Gazebo/Grey</material>
</gazebo>


<link name="right_wheel">
    <visual>
        <origin rpy="1.57075 0 0" xyz="0 0 0"/>
        <geometry>
            <cylinder length="0.008" radius="0.035"/>
        </geometry>
        <material name="black"/>
    </visual>
    <collision>
    <avix xyz="0 -1 0" />
        <origin rpy="1.57075 0 0" xyz="0 0 0"/>
        <geometry>
            <cylinder length="0.008" radius="0.035"/>
        </geometry>
    </collision>
    <inertial>
        <mass value="0.015"/>
        <inertia ixx="0.00002" ixy="0.0" ixz="0.0" iyy="0.00002" iyz="0.0" izz="0.00002"/>
    </inertial>
</link>

<joint name="base_to_right_wheel" type="continuous">
    <axis xyz="0 1 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-01-05 06:17:08 -0500

Update: Seems to be an issue with intertia, as the inertia for the wheel can't be set below 0.5kg*m^2, but i need my wheel mass to be 0.015kg, setting the inertia values to what they are supposed to be using calculations from here . Makes wheels spawn at 0 0 0 and the robot to not function properly also error [param.cc:451] stated to appear when trying to fix. Still looking for solution and or suggestions from here.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-12-22 09:28:25 -0500

Seen: 24 times

Last updated: Jan 05