Simulating limb movement

depy
Posts: 2
Joined: Wed Aug 18, 2010 9:20 pm

Simulating limb movement

Post by depy »

So here's the deal. I decided to do simple organism evolving project for my diploma and by some consideration I have chosen jBullet for physics engine.

The problem I've had so far:

I have simple life forms which are made of blocks. Blocks then represent limbs and those blocks are connected using Piont2PointContraint so each limb has 2 free axis. Now, If I wanted to limit angles of constraint can I do that? Or should I use other constraint if I wanna do that?

Another problem is properly representing limb movement. I tried by rotating a limb and using applyImpulse ( or applyCentralImpuse ) but it looks very unrealistic.

Some guy who had done the same thing as I'm doing but much better told me he was using some ODE physics engine (OPAL/ODE) which can add "servo" motors into joints to move the block that is connected to it. So the force on block is constant.

I need ideas to implement the limb movement. External forces and rotation looks dumb. It's just too obvios that theres some external forces moving them.

Thank you in advance!

Best regards,
dEPy
chrozz
Posts: 8
Joined: Fri Mar 12, 2010 10:21 pm

Re: Simulating limb movement

Post by chrozz »

depy
Posts: 2
Joined: Wed Aug 18, 2010 9:20 pm

Re: Simulating limb movement

Post by depy »

I tried using the Generic6DogConstraint with motors and it seems I can't figure out right how does this work. I'm getting result (1) instead of result (2). I want 2 free axis (4 directions like in human arm) so the limbs can't rotate.

Here's what I've been doing (it's Java but its the same):
g6dc1 is Generic6DofConstraint

Code: Select all

rlm = g6dc1.getRotationalLimitMotor(1);
rlm.enableMotor=true;
rlm.maxMotorForce=10000.0f;
float[] axisVec = {0.0f, 1.0f, 0.0f};
rlm.solveAngularLimits(10.0f, new Vector3f(axisVec), 1000.0f, fallRigidBodies.get(0), fallRigidBodies.get(1));
I don't unsterdant what are first and third parameter in solveAngularLimits? Am I defining axis vector correctly?

A simple example of usage of this motors would be very appreciated. :)


P.S.
Why doesn't jBullet have more documentation, articles, samples, books? :(
It's quite hard to learn it now.
wuallen
Posts: 5
Joined: Mon Jul 14, 2008 8:14 am

Re: Simulating limb movement

Post by wuallen »

Code: Select all

rlm = g6dc1.getRotationalLimitMotor(1);
rlm.enableMotor=true;
rlm.maxMotorForce=10000.0f;
float[] axisVec = {0.0f, 1.0f, 0.0f};
rlm.solveAngularLimits(10.0f, new Vector3f(axisVec), 1000.0f, fallRigidBodies.get(0), fallRigidBodies.get(1));
you need to set "getRotationalLimitMotor(0)->m_targetVelocity = 1".