2D Simulation

Typically: "How do I... ", "How can I... " questions
Post Reply
luisf.rossi
Posts: 3
Joined: 05 Apr 2015, 20:02

2D Simulation

Post by luisf.rossi »

This question has been done in a previous post (viewtopic.php?f=9&t=1027) but i did not want to dig it up.

I am developing biped gait control routines in MATLAB and would like to take a try on V-REP for simulation. The problem is that i would need just sagittal forces on the 3d model.

Choreonoid is the simulator that i am Currently using, and it is possible to perform 2d simulations using 3d models. It just ignores the Coronal plane forces. Would that be possible in V-REP?

Any help on that?

Regards

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

Re: 2D Simulation

Post by coppelia »

Hello,

in V-REP, you will always run simulations in 3D, but you can look at them in 2D, and also make them behave close to 2D with some tricks.

In your case, if you are only interested what happens in the Sagital plane, then you will have to constrain the body of your humanoid to stay in the same sagital plane. For that, you can simply add two prismatic joints that constrain the torso (or hips) for instance: the first will allow the torso to move forward/backward, the second will allow the torso to move up/down.
Something like:

Code: Select all

torso --> prismatic1 --> mass --> prismatic2 --> dummy1

staticObject --> dummy2
The two dummies need to be linked via an overlap constraint. Make sure to read this section. The two dummies will basically introduce a loop closure.

More simple, without loop closure, would be something like that:

Code: Select all

staticObject --> prismatic1 --> mass --> primatic2 --> torso
The two prismatic joints will basically allow the torso to have only 2 degrees of freedom, locking the other 4. If you want your torso to also be able to rotate in the sagital plane, simply add another joint, but revolute this time:

Code: Select all

staticObject --> prismatic1 --> mass --> primatic2 --> mass --> revolute --> torso
Cheers

luisf.rossi
Posts: 3
Joined: 05 Apr 2015, 20:02

Re: 2D Simulation

Post by luisf.rossi »

Thank you for your reply.

I tried that, and just for a test i used the NAO to see if the system is constrained even considering that the Nao is trying to move in 3D motion. The result is that for ODE and Bullet everything gets broken. It works for Vortex, but i got no license, so it is a no go.

The scene can be downloaded in the following link:

https://www.dropbox.com/s/gaew4tq8noxid ... n.ttt?dl=0

Any help is appreciated

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

Re: 2D Simulation

Post by coppelia »

The auxiliary masses you are using are extremely small. This doesn't work well with Bullet/Ode. Have a look at this page (and mainly design considerations 6-8).

So if you set the boxes's mass to 0.1 it already works better. Another problem: try to keep all auxiliary masses close to the NAO body, or following the NAO body.

Cheers

luisf.rossi
Posts: 3
Joined: 05 Apr 2015, 20:02

Re: 2D Simulation

Post by luisf.rossi »

Hmm.. even with that solution I am not really able to get something reasonable with ODE or Bullet... at Vortex the trunk is strictly tied to sagital plane.. with ODE and Bullet it always moves... Any advice on how to get a proper 2d simulation?

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

Re: 2D Simulation

Post by coppelia »

you need to tune your masses and inertias. Then it should work fine.

Cheers

Post Reply