Non-consistent joint behavior after URDF import

Report crashes, strange behaviour, or apparent bugs
Post Reply
Matthieu
Posts: 6
Joined: 24 Dec 2013, 14:31

Non-consistent joint behavior after URDF import

Post by Matthieu »

Hello,

We have put Poppy Humanoid into v-rep using the URDF import. The scene is available here.

But we have a very strange behavior on some joints which for unknown reason does not reach the desired positions as you can see in the following example:
Image

Here, the two arms should be raised but the right one cannot reach its final position ...

Normally you can experiment this bug quite quickly by installing the required python packages:

Code: Select all

pip install numpy pypot poppy-creature poppy-humanoid
Launch v-rep and run the following command:

Code: Select all

poppy-shell Humanoid --vrep
Then a ipython console appears and you can move the arms:

Code: Select all

poppy.l_shoulder_x.goal_position = 180
poppy.r_shoulder_x.goal_position = -180
Can you help us understand what is the problem with our model ?

Thanks

Matthieu

coppelia
Site Admin
Posts: 10558
Joined: 14 Dec 2012, 00:25

Re: Non-consistent joint behavior after URDF import

Post by coppelia »

Hello Matthieu,

try to run the same simulation with the Vortex engine and you will see that it will succeed.
This is due to some limitations of the physics engines. Make sure to carefully read this page, mainly design considerations 7 and 8.
If you double the inertia of object r_shoulder_motor_respondable, it will then also work with the Bullet engine.

Then I noticed that all your masses and inertias are very small. Are those the intended values? (i.e. the chest is 0.25 kg)
Remember also that the inertia values that you enter in V-REP are massless (i.e. inertia values divided by the mass of the object).

Finally, your CAD model is very heavy, mainly due to the many holes and details. Best would be to remove all holes (at least the hoiles for the screws), maybe even simplify the links as convex elements. Also: remove all the items located inside of the shapes (e.g. the whole electronics inside of the head).

Cheers

Matthieu
Posts: 6
Joined: 24 Dec 2013, 14:31

Re: Non-consistent joint behavior after URDF import

Post by Matthieu »

THanks for the quick answer
coppelia wrote: If you double the inertia of object r_shoulder_motor_respondable, it will then also work with the Bullet engine.
Maybe but I just checked the l_shoulder_motor_respondable and it is the same value as the r_shoulder_motor_respondable so it should not work either ?
coppelia wrote: Then I noticed that all your masses and inertias are very small. Are those the intended values? (i.e. the chest is 0.25 kg)
Poppy is a very lightweight robot and yes the chest is 0.25 kg. Is there a way to measure the whole mass of the robot ? (it should be around 3kg)
coppelia wrote: Finally, your CAD model is very heavy, mainly due to the many holes and details. Best would be to remove all holes (at least the hoiles for the screws), maybe even simplify the links as convex elements. Also: remove all the items located inside of the shapes (e.g. the whole electronics inside of the head).
This is planned but not yet done :)

coppelia
Site Admin
Posts: 10558
Joined: 14 Dec 2012, 00:25

Re: Non-consistent joint behavior after URDF import

Post by coppelia »

Well, a physics engine is not that predictable ;) If it works on one side, it doesn't mean it works on the other side. This is mainly due to how the equations are solved (often everything is packed into a large matrix that will be solved via various techniques.. if one side of the matrix contains a lot of large values, the other side a lot of small values, then you might end-up with not very precise resolution).

You can use the model Models/tools/Center of mass visualization tool.ttm to check the overall mass.

Cheers

JJEHL
Posts: 12
Joined: 02 Apr 2015, 10:35

Re: Non-consistent joint behavior after URDF import

Post by JJEHL »

Hello,

I continue this post because I have the same issue with poppy in V-REP. Changing inertia change very few the position, not really a solution on my computer. We have now a very simple scene (https://github.com/jjehl/poppy-humanoid ... manoid.ttt) with convex shape and the join is always at a wrong position.

Vortex works good. Can you inform me what is the price to use the VOrtex engine (for personal use, I'm not a compagny) ?

Choosing a very accurate simulation in place of an accurate one gives really better results with bullet. But there is ever a difference between the target position and the real position (about 5°).

When I change the PID from 0.1 / 0 / 0 to 0.1 / 0.01 / 0 I can reduce the gap to about 1°. But I always have a very big difference for the speed of the motor (when changing position) between the right and the left arm.

Do you have ideas to have a better simulation with bullet engine ?

Regards.

coppelia
Site Admin
Posts: 10558
Joined: 14 Dec 2012, 00:25

Re: Non-consistent joint behavior after URDF import

Post by coppelia »

Hello,

increase the mass and inertia of all your objects! Really, make sure to carefully read this page, which is very important! (design considerations 6, 7 and 8 mainly). Otherwise you won't be able to do anything reasonable with the Bullet/ODE engine. Vortex is much more tolerant. For details about the Vortex plugin, please contact Simwat.

You can change many parameters to make a dynamic simulation more stable. But first, and the most important, is to follow the design consideration rules 6-8. After that, you can start playing with the other parameters such as PID, simulation time step, etc.

Cheers

Matthieu
Posts: 6
Joined: 24 Dec 2013, 14:31

Re: Non-consistent joint behavior after URDF import

Post by Matthieu »

I thought the mass problem was a "relative-mass" problem e.g. having a heavy part with lightweight ones attached. Poppy is a lightweight robot, all parts are light...
You mean we have to raise the global mass of Poppy for ODE/Bullet ?

coppelia
Site Admin
Posts: 10558
Joined: 14 Dec 2012, 00:25

Re: Non-consistent joint behavior after URDF import

Post by coppelia »

Yes and no. If a mass is too small, it might not behave correctly as well.
But in the case of Poppy, try first to increase somewhat the inertias: that should increase the stability of the whole.
After that, try to balance the masses (but still keeping a same global mass).
There is really no simple receipe: you will have to try.

Cheers

JJEHL
Posts: 12
Joined: 02 Apr 2015, 10:35

Re: Non-consistent joint behavior after URDF import

Post by JJEHL »

Increasing inertia by 4 (inertia*4) for all shapes gives good results. But can we say that the simulate poppy will react like the real one ?

Thanks.

coppelia
Site Admin
Posts: 10558
Joined: 14 Dec 2012, 00:25

Re: Non-consistent joint behavior after URDF import

Post by coppelia »

That is a very good question. When using a physics engine, there are many approximations that are made, and you will never really know how realistic your simulation really is.

One of the secrets of having a good simulation is to test several configurations, by trying to keep the overall mass properties same, but more balanced (e.g. if you have an object with a very small mass attached to another object with a quite large mass, then try to keep the overall mass same, but make the small mass object heavier, and the large mass object lighter). A similar approach can be taken with the inertias (also remember that you specify mass-less inertias in V-REP! (the mass is added internally to the matrices)).

Also, always try to test what the Vortex engine gives you as results, since it is the better and more realistic physics engine available.

Cheers

Post Reply