Home | Tutorials | Wiki | Issues
Ask Your Question
0

A box stops moving suddenly

asked 2017-04-26 03:38:01 -0500

tatsS gravatar image

Hi everyone,

I’m trying to move an object on the ground without any friction in GAZEBO.

I created the default box model on the ground, and set both of mu and mu2 to zero. I left the default values in the other model parameters.

I set the gravity to (-0.1, 0, -9.8), and started the simulation. Although there was no friction force between the box and ground and no deceleration of the box, the box stopped moving suddenly in about 1 second in simulation time.

I implemented the ft_sensor on the model, it showed zero force and torque after the stop. It seemed that any calculation about the force was not conducted.

What happened? Can anyone help me fix this problem?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2017-04-26 10:04:10 -0500

chapulina gravatar image

updated 2017-04-27 10:54:27 -0500

The final friction is a result of the friction parameters for both bodies in contact. In your case, you should also change the friction for the ground plane.

Also, note that bodies moving very slowly are "automatically disabled" on ODE. You can turn off that behavior setting the <allow_auto_disable> flag to false. Or you can use a different physics engine, such as Bullet.

Try this world for example:

<?xml version="1.0" ?>
<sdf version="1.5">
  <world name="default">
    <physics type="ode">
      <gravity>-0.1 0 -9.8</gravity>
    </physics>
    <!-- A global light source -->
    <include>
      <uri>model://sun</uri>
    </include>
    <!-- A ground plane -->
    <model name="ground_plane">
      <static>true</static>
      <link name="link">
        <collision name="collision">
          <geometry>
            <plane>
              <normal>0 0 1</normal>
              <size>100 100</size>
            </plane>
          </geometry>
          <surface>
            <friction>
              <ode>
                <mu>0</mu>
                <mu2>0</mu2>
              </ode>
            </friction>
          </surface>
        </collision>
        <visual name="visual">
          <geometry>
            <plane>
              <normal>0 0 1</normal>
              <size>100 100</size>
            </plane>
          </geometry>
        </visual>
      </link>
    </model>
    <!-- box -->
    <model name="box">
      <allow_auto_disable>false</allow_auto_disable>
      <pose>0 0 0.5 0 0 0</pose>
      <link name="link">
        <collision name="collision">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
          <surface>
            <friction>
              <ode>
                <mu>0</mu>
                <mu2>0</mu2>
              </ode>
            </friction>
          </surface>
        </collision>
        <visual name="visual">
          <geometry>
            <box>
              <size>1 1 1</size>
            </box>
          </geometry>
        </visual>
      </link>
    </model>
  </world>
</sdf>
edit flag offensive delete link more

Comments

@chapulina Thank you for your reply! I tried your code, and the box did not stop. However, it still stopped when I changed gravity to (-0.1, 0, -9.8). What is the difference? Gazebo can not solve the slow movement accurately?

tatsS gravatar imagetatsS ( 2017-04-26 20:49:54 -0500 )edit

Why the gravity is set to (-1,0,-9.8) instead of (0,0,-9.8)?

winston gravatar imagewinston ( 2017-04-27 02:04:55 -0500 )edit

@winston It is because I apply a force in the x-direction to the box. Adding initial small velocity in the x-direction to the box instead of gravity=(-1, 0, -9.8) may also give the same results.

tatsS gravatar imagetatsS ( 2017-04-27 07:17:47 -0500 )edit

Ah ok, I got what's happening. The box is moving very slowly, so ODE auto-disables it. See the updated answer.

chapulina gravatar imagechapulina ( 2017-04-27 10:55:39 -0500 )edit

@chapulina Your updated answer completely solves my problem! I didn't know the ODE auto-disable feature. Thank you so much!

tatsS gravatar imagetatsS ( 2017-04-27 20:18:30 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-04-26 03:38:01 -0500

Seen: 445 times

Last updated: Apr 27 '17