Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to set friction direction in gazebo

Hello,

I am trying to set different friction coefficients in the different x-y link direction. For that i am using the <mu> , <mu2> and <fdir1> tags provided especially for that purpose. But for some reason the friction coefficients are applied by GAZEBO in the world frame and not the link frame.

In order to test the issue I placed same box, with different <mu> and <mu2> on the ground plane in two orientation (perpendicular to each other) and applied increasing gravity in x direction.

here is the sdf of the ground plane (i use same friction in both directions) :

<?xml version="1.0" ?>
<sdf version="1.5">
  <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>100</mu>
              <mu2>100</mu2>
          <fdir1>1 0 0</fdir1>
            </ode>
          </friction>
        </surface>
      </collision>
      <visual name="visual">
        <cast_shadows>false</cast_shadows>
        <geometry>
          <plane>
            <normal>0 0 1</normal>
            <size>100 100</size>
          </plane>
        </geometry>
        <material>
          <script>
            <uri>file://media/materials/scripts/gazebo.material</uri>
            <name>Gazebo/Grey</name>
          </script>
        </material>
      </visual>
    </link>
  </model>

</sdf>

Here is the sdf of a box that i use for tests (i set high friction in x direction, and low friction in y direction) :

<?xml version="1.0"?>
<sdf version="1.4">
  <model name="cube1">
    <static>false</static>
    <link name="link">
       <pose>0 0 0.5 0 0 0</pose>
       <collision name="collision">
        <geometry>
            <box>
              <size>2 1 1</size>
            </box>
        </geometry>
        <surface>
          <friction>
            <ode>
              <mu>0.3</mu>
              <mu2>100</mu2>
          <fdir1>1 0 0</fdir1>
            </ode>
          </friction>
         </surface>
    </collision>

      <inertial>
        <pose>0 0 -0.4 0 -0 0</pose>
        <mass>50</mass>
        <inertia>
          <ixx>1</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>1</iyy>
          <iyz>0</iyz>
          <izz>1</izz>
        </inertia>
      </inertial>

      <visual name="visual">
         <geometry>
            <box>
              <size>2 1 1</size>
            </box>
        </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Grey</name>
            </script>
          </material>
      </visual>

    </link>
  </model>
</sdf>

As i increase the gravity in x (world) direction both boxes start to slide simultaneously and with the same speed. if i increase the gravity in y (world) direction the boxes do not move.

image description

What am i doing wrong here ?

How to set friction direction in gazebo

Hello,

I am trying to set different friction coefficients in the different x-y link direction. For that i am using the <mu> , <mu2> and <fdir1> tags provided especially for that purpose. But for some reason the friction coefficients are applied by GAZEBO in the world frame and not the link frame.

In order to test the issue I placed same box, with different <mu> and <mu2> on the ground plane in two orientation (perpendicular to each other) and applied increasing gravity in x direction.

here Here is the sdf of the ground plane (i use same friction in both directions) :

<?xml version="1.0" ?>

<sdf version="1.5"> <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>100</mu> <mu2>100</mu2> <fdir1>1 0 0</fdir1> </ode> </friction> </surface> </collision> <visual name="visual"> <cast_shadows>false</cast_shadows> <geometry> <plane> <normal>0 0 1</normal> <size>100 100</size> </plane> </geometry> <material> <script> <uri>file://media/materials/scripts/gazebo.material</uri> <name>Gazebo/Grey</name> </script> </material> </visual> </link> </model>

</sdf>

Here is the sdf of a box that i use for tests (i set high friction in x direction, and low friction in y direction) :

<?xml version="1.0"?>
<sdf version="1.4">
  <model name="cube1">
    <static>false</static>
    <link name="link">
       <pose>0 0 0.5 0 0 0</pose>
       <collision name="collision">
        <geometry>
            <box>
              <size>2 1 1</size>
            </box>
        </geometry>
        <surface>
          <friction>
            <ode>
              <mu>0.3</mu>
              <mu2>100</mu2>
          <fdir1>1 0 0</fdir1>
            </ode>
          </friction>
         </surface>
    </collision>

      <inertial>
        <pose>0 0 -0.4 0 -0 0</pose>
        <mass>50</mass>
        <inertia>
          <ixx>1</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>1</iyy>
          <iyz>0</iyz>
          <izz>1</izz>
        </inertia>
      </inertial>

      <visual name="visual">
         <geometry>
            <box>
              <size>2 1 1</size>
            </box>
        </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Grey</name>
            </script>
          </material>
      </visual>

    </link>
  </model>
</sdf>

As i increase the gravity in x (world) direction both boxes start to slide simultaneously and with the same speed. if i increase the gravity in y (world) direction the boxes do not move.

image description

What am i doing wrong here ?

How to set friction direction in gazebo

Hello,

I am trying to set different friction coefficients in the different x-y link direction. For that i am using the <mu> , <mu2> and <fdir1> tags provided especially for that purpose. But for some reason the friction coefficients are applied by GAZEBO in the world frame and not the link frame.

In order to test the issue I placed same box, with different <mu> and <mu2> on the ground plane in two orientation (perpendicular to each other) and applied increasing gravity in x direction.

Here is the sdf of the ground plane (i use same friction in both directions) :

<?xml version="1.0" ?>
<sdf version="1.5">
      <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>100</mu>
                  <mu2>100</mu2>
              <fdir1>1 0 0</fdir1>
                </ode>
              </friction>
            </surface>
          </collision>
          <visual name="visual">
            <cast_shadows>false</cast_shadows>
            <geometry>
              <plane>
                <normal>0 0 1</normal>
                <size>100 100</size>
              </plane>
            </geometry>
            <material>
              <script>
                <uri>file://media/materials/scripts/gazebo.material</uri>
                <name>Gazebo/Grey</name>
              </script>
            </material>
          </visual>
            </link>
          </model>
    </sdf>

</sdf>

Here is the sdf of a box that i use for tests (i set high friction in x direction, and low friction in y direction) :

<?xml version="1.0"?>
<sdf version="1.4">
  <model name="cube1">
    <static>false</static>
    <link name="link">
       <pose>0 0 0.5 0 0 0</pose>
       <collision name="collision">
        <geometry>
            <box>
              <size>2 1 1</size>
            </box>
        </geometry>
        <surface>
          <friction>
            <ode>
              <mu>0.3</mu>
              <mu2>100</mu2>
          <fdir1>1 0 0</fdir1>
            </ode>
          </friction>
         </surface>
    </collision>

      <inertial>
        <pose>0 0 -0.4 0 -0 0</pose>
        <mass>50</mass>
        <inertia>
          <ixx>1</ixx>
          <ixy>0</ixy>
          <ixz>0</ixz>
          <iyy>1</iyy>
          <iyz>0</iyz>
          <izz>1</izz>
        </inertia>
      </inertial>

      <visual name="visual">
         <geometry>
            <box>
              <size>2 1 1</size>
            </box>
        </geometry>
          <material>
            <script>
              <uri>file://media/materials/scripts/gazebo.material</uri>
              <name>Gazebo/Grey</name>
            </script>
          </material>
      </visual>

    </link>
  </model>
</sdf>

As i increase the gravity in x (world) direction both boxes start to slide simultaneously and with the same speed. if i increase the gravity in y (world) direction the boxes do not move.

image description

What am i doing wrong here ?