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

My balls are in a perpetual motion in gazebo

asked 2019-10-01 08:55:01 -0500

Jérémy_Synergize gravatar image

Hi, I am trying to modelize a robot for testing in gazebo, but I get trouble whith him staying still.

The simplifiate version i use is compose of a square base (base_link), two balls (with 3 degrees of liberty, for stability), and two wheels (With motors, for movement). I changed a lot, but the main problem I encounter is that the balls move by herself (in some configuration they made the robot shake or move. In the current one they just roll-on herself (and maybe do crazy thinks when I try to turn ) ). I don't understand where that could come exactly and what to do to fix it. (The current model is not based on anything real, so I could have messed up the values of mass and inertia ) (I'm new on the forum and i don't know if I should past all my codes or not :/ ) There the xacro file I use :

<?xml version="1.0"?>

<robot <a="" href="http://xmlns:xacro="http://www.ros.org/wiki/xacro">xmlns:xacro="http://www.ros.org/wiki/..." name="dummy"></robot>

<xacro:property name="size_base" value="1.0" />
<xacro:property name="height_base" value="0.05" />
<xacro:property name="half_size_base" value="${size_base/2.0}" />
<xacro:property name="mass_base" value="1.0" />

<xacro:property name="boule_size" value="0.05" />
<xacro:property name="boule_mass" value="0.05" />

<material name="green">
    <color rgba="0 0.8 0 1"/>
</material>   
<material name="blue">
    <color rgba="0 0 1 1"/>
</material>
<gazebo>
  <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    <robotNamespace>/robot</robotNamespace>
  </plugin>
</gazebo>

<xacro:macro name="origin_base">
            <origin rpy="0.0 0.0 0.0" xyz="0 0 0"/> 
</xacro:macro>

<!-- WHEELS -->

    <xacro:property name="wheel_length" value="0.08"/>
    <xacro:property name="wheel_mass" value="0.03"/>
    <xacro:property name="wheel_radius" value="0.10"/>
<xacro:macro name="wheel" params="rpy xyz name">

    <xacro:macro name="origin_wheel">
        <origin rpy="${rpy}" xyz="${xyz}"/>
    </xacro:macro>

    <link name="wheel_${name}_link">
        <inertial>
            <xacro:origin_base />
            <mass value="${wheel_mass}" />
             <inertia ixx="1.1175580e-05" ixy="-4.2369783e-11" ixz="-5.9381719e-09" iyy="1.1192413e-05" iyz="-1.4400107e-11" izz="2.0712558e-05" />
        </inertial>

        <collision>
            <xacro:origin_base />
            <geometry>
                <cylinder radius="${wheel_radius}" length="${wheel_length}"/>
            </geometry>
        </collision>
          <visual>
              <xacro:origin_base />
              <geometry>
                    <cylinder radius="${wheel_radius}" length="${wheel_length}"/>
              </geometry>
              <material name="green"/>
          </visual>
      </link>

      <joint name="wheel_${name}_join" type="continuous">
          <parent link="base_link"/>
          <child link="wheel_${name}_link"/>
          <xacro:origin_wheel />
          <limit lower="-0.2" upper="0.2" effort="100" velocity="100"/>
          <axis xyz="0 0 1"/>
      </joint>


    <gazebo reference="wheel_${name}_link">
    <mu1>0.1</mu1>
    <mu2>0.1</mu2>
    <kp>500000.0</kp>
    <kd>10.0</kd>
    <minDepth>0.001</minDepth>
    <maxVel>0.1</maxVel>
    <fdir1>1 0 0</fdir1>
    <material>Gazebo/FlatBlack</material>
      </gazebo>
  </xacro:macro>

    <!-- BASE -->

    <link ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2019-10-10 04:12:44 -0500

Jérémy_Synergize gravatar image

I add <dynamics friction="0.06"/> to the joints, and that solve it.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-10-01 08:55:01 -0500

Seen: 187 times

Last updated: Oct 10 '19