object rotate itself after I put it in the gazebo

asked 2019-10-03 21:36:56 -0500

TouchDeeper gravatar image

updated 2019-10-10 03:46:13 -0500

Hello,

This question is a continuation of a question past. I modified the inertial to solve the rotation problem in the past, but this will cause a wrong action of banana.

I tried to modify the surface parameters, but can't find suitable parameters. After I choose the View -> Transparent and View -> Contacts, the banana rotate as the gif show. As you can see from the gif, the contact point of the banana flicker all the time. Is this normal? The gif seems can't play online, it needs to be download. The inertial box of the banana is as the video shows.

The xml format model file is below:

<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- |    This document was autogenerated by xacro from Banana.xacro                   | -->
<!-- |    EDITING THIS FILE BY HAND IS NOT RECOMMENDED                                 | -->
<!-- =================================================================================== -->
<robot name="Banana" xmlns:xacro="http://ros.org/wiki/xacro">
  <material name="yellow">
    <color rgba="1 0.4 0 1"/>
  </material>
  <link name="base">
    <inertial>
      <origin rpy="0.0 0.0 0.0" xyz="0.0014177 4.15280000000162E-06 0.026526"/>
      <mass value="0.11082"/>
      <inertia ixx="2.48347659000621E-05" ixy="1.68484882757417E-06" ixz="-1.05360215654521E-06" iyy="0.000186690109925898" iyz="-1.13501975389491E-08" izz="0.000175609996584435"/>
    </inertial>
    <visual>
      <origin rpy="1.5707963267949 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://object_description/meshes/Banana.STL"/>
      </geometry>
      <material name="yellow"/>
    </visual>
    <collision>
      <origin rpy="1.5707963267949 0 0" xyz="0 0 0"/>
      <geometry>
        <mesh filename="package://object_description/meshes/Banana.STL"/>
      </geometry>
      <max_contacts>
         10
      </max_contacts>
      <surface>
        <friction>
          <ode>
            <mu>10</mu>
            <mu2>10</mu2>
          </ode>
        </friction>
        <contact>
          <ode>
            <min_depth>0.001</min_depth>
<!--            <kp>1e9</kp>-->
            <soft_cfm>0.2</soft_cfm>
            <soft_erp>0.4</soft_erp>
          </ode>
        </contact>
      </surface>
    </collision>
  </link>
  <gazebo reference="base">
    <material>Gazebo/Yellow</material>
    <turnGravityOff>false</turnGravityOff>
  </gazebo>
</robot>
edit retag flag offensive close merge delete

Comments

Can you try to set max_contacts to allow for more contacts?

Eisenhorn gravatar imageEisenhorn ( 2019-10-04 08:15:23 -0500 )edit

@Eisenhorn, the default max_contact value is 10, I think it is enough for the banana object. the number of contact points we can see from the gif is three. Anyway, I add the max_contact tag in the xml above. But it seems like make no difference.

TouchDeeper gravatar imageTouchDeeper ( 2019-10-05 02:00:26 -0500 )edit

Could you visualize the inertia box in gazebo? Does it fit the banana? Also try to increase min_depth.

Eisenhorn gravatar imageEisenhorn ( 2019-10-07 02:48:44 -0500 )edit

@Eisenhorn I'm sorry for my late reply. I have modified the min_depth from 0.001 to 100, but it also makes no difference. I have uploaded the inertial box in my dropbox and add it to the question description.

TouchDeeper gravatar imageTouchDeeper ( 2019-10-10 03:44:31 -0500 )edit