[ODE] hexapod walking example

Adam Rotaru adam_rotaru at yahoo.com
Sat Dec 29 15:24:01 2001


--- Russ Smith <russ@q12.org> wrote:
> instead of applying a force, try using a motor: set
> the dParamVel and
> dParamFMax parameters on the joint to set the
> desired speed and 
> maximum force. as a rule, set dParamFMax to 2-3 time
> the "just 
> enough" force you need. this should save you some
> headaches. 

  A follow-up on this (esp. for Russ and Nate):
I revisited joint motors, and they work fine for me.
Updated movie hexapod3.mpg on
http://www.geocities.com/adam_rotaru/tmp/ode/

First I used a constant FMax setting, and modulated
the desired
speed.  Both of these values seem to important.  For
the
FMax I used a value of 0.0012 (I know these depend on
the size/mass
of the bodies, but just an idea), and for speed gain
10.0
(which is quite high, product can be as high as 5.0).
I suppose most of the time the desired speed is very
high, and
the FMax is the limiting. 

The only thing I did not like is that when the body is
in
an 'OK' state (each joint is in the acceptable range,
no reflex
is triggered) forces are still applied, and the joints
are very stiff.
So I followed Russ' advice and started to modulate
FMax too, and
set it to a low value in this case.  It results in a
much more
flexible body.
So I compute the deviation of the joint angle from the
desired (z),
cap it between -0.5 ... 0.5 (rads), and then set both
the velocity and FMax like this:
    float velCoeff = 10.0;
    float forCoeff = 0.007;
    dJointSetHingeParam(joint1, dParamVel,
velCoeff*z);
    dJointSetHingeParam(joint1, dParamFMax,
forCoeff*fabs(z));
So effectively I compute my max force, and use the
joint motor
to produce that force.

My simulation is very stable now!
Thanks for the advice.
cheers,
  Adam



__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com