# not realistic simulatoin

Hi,

I am trying to simulate robots using neural networks and genetic algorithms. here is the link to the video.

I don't know why when the two legs being in the air the cube link don't fall down like it should be in real life. even if I put its mass to 100. The gravity is set as default.

I know that the real time factor can affect, but what are other properties that I have to adjust ?

thank you very much !

here is the SDF file :

<?xml version='1.0'?>
<sdf version='1.4'>
<model name="fourlegs">

<static>false</static>

<!--**********************body************************************-->
<pose>0 0 .04 0 0 0</pose>

<inertial>
<mass>100</mass>
</inertial>

<collision name='collision'>
<geometry>
<box>
<size>.1 .1 .02</size>
</box>
</geometry>
</collision>

<visual name='visual'>
<geometry>
<box>
<size>.1 .1 .02</size>
</box>
</geometry>
</visual>
<!--*********************left leg *******************************-->
<pose> .06 .04 .01 0 0 0</pose>

<inertial>
<mass>10</mass>
</inertial>
<collision name='collision'>
<geometry>
<box>
<size>.02 .02 .06</size>
</box>
</geometry>
</collision>

<visual name='visual'>
<geometry>
<box>
<size>.02 .02 .06</size>
</box>
</geometry>
</visual>
<!--*********************right leg*******************************-->
<pose> -.06 .04 .01 0 0 0</pose>

<inertial>
<mass>10</mass>
</inertial>

<collision name='collision'>
<geometry>
<box>
<size>.02 .02 .06</size>
</box>
</geometry>
</collision>

<visual name='visual'>
<geometry>
<box>
<size>.02 .02 .06</size>
</box>
</geometry>
</visual>

<!--*************************************************************-->
<!--**********************JOINTS*********************************-->
<!--*************************************************************-->

<!--**********************joint left leg************************-->
<joint type="revolute" name="jointJambDG">

<pose> -.01 .0 .03 0 0 0</pose>

<child>jambeDG</child>
<parent>corps</parent>
<axis>
<xyz>1 0 0</xyz>
</axis>
</joint>
<!--**********************joint right leg************************-->
<joint type="revolute" name="jointJambDD">
<pose> .01 .0 .03 0 0 0</pose>
<child>jambeDD</child>
<parent>corps</parent>
<axis>
<xyz>1 0 0</xyz>
</axis>
</joint>
</model>
</sdf>

edit retag close merge delete

1

One thing that could help is setting the inertia matrix for each link. [This tutorial](http://gazebosim.org/tutorials?tut=inertia&cat=build_robot) should help.

( 2015-02-02 10:30:26 -0500 )edit

Sort by » oldest newest most voted

What you are seeing is the dynamics for the default moment inertia (I = identity matrix) when a more physically realistic one is not specified. My suggestion is to update the models with realistic MOI using equations from references such as this one based on object mass, size and density distribution.

more

Thanks for your answer. I set up the inertia properties like shown in the wiki page. But when I give joints a 0.1 force and 0.1 velocity the robot starts to jump and pounce with a fast way, not realistic at all, I don't know if it's the gravity or ground friction ?! I will try Ricardo Tellez's approach and see...

( 2015-03-07 03:23:14 -0500 )edit

The key to have realistic simulations is to provide a correct section <inertias> ... </inertias>

A proper section should look like this:

<inertia> <!-- interias are tricky to compute -->
<ixx>0.000033719</ixx>       <!-- for a box: ixx = 0.083 * mass * (y*y + z*z) -->
<ixy>0.0</ixy>         <!-- for a box: ixy = 0 -->
<ixz>0.0</ixz>         <!-- for a box: ixz = 0 -->
<iyy>0.001305175</iyy>       <!-- for a box: iyy = 0.083 * mass * (x*x + z*z) -->
<iyz>0.0</iyz>         <!-- for a box: iyz = 0 -->
<izz>0.001322294</izz>       <!-- for a box: izz = 0.083 * mass * (x*x + y*y) -->
</inertia>
</inertial>


Steps to follow:

0- Use Blender to automatically set the center of mass and arrange the axis of the object at that center (this will make later steps easier) 1- Use the tutorial chapulina has suggested to calculate the inertial parameters and set the model. Don't forget to set a correct mass value (the one you have now seems unrealistic) 2- Use Gazebo's option View->Center of mass/Inertia to observe if your inertias are correct (see figures attached for a wrong one an a correct one, for a spoon) 3- If they do not show correct, iterate

INCORRECT INERTIAS

CORRECT INERTIAS

more

( 2015-03-07 09:47:57 -0500 )edit

I do agree with you Hsu, you approach is closer to reality and may be required in some simulations. From my experience the bounding box approach and center-of-mass calculated as homogeneous body has been good enough for what I needed. Is up to the user to decide, though.

more