How to set friction direction in gazebo [closed]

asked 2015-09-10 04:55:09 -0500

dmeltz gravatar image

updated 2015-09-10 04:56:02 -0500

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 ?

edit retag flag offensive reopen merge delete

Closed for the following reason Gazebo Question: The Gazebo community prefers to answer questions at: http://answers.gazebosim.org by gvdhoorn
close date 2015-09-10 05:20:18.255555

Comments

You should probably ask this question on answers.gazebosim.org, as this seems to be only about Gazebo, not ROS. I'll close this now. Let me know if you think this should be re-opened.

gvdhoorn gravatar image gvdhoorn  ( 2015-09-10 05:20:08 -0500 )edit