[Opensim-dev] Springs, Torques, joints , friction, questions and Vehicles oh my

Michael Cortez mcortez at gmail.com
Thu Apr 16 12:22:08 UTC 2009


Teravus Ovares wrote:
> Looking at the LSL Vehicle API, it seems clear that there is at least
> an angular motor and a linear motor involved.   There may be two
> angular motors, one for the angular movement and one for the vertical
> attractor(which may just be a jacobian constraint).  In ODE, angular
> motors are implemented as springs.    Sometimes this can cause
> instability and vibration.     The truth is, using ODE's angular motor
> may or may not be the best solution.   
I had attempted to implement the vertical attractor, and was only partly 
successful.

My attempt which is now a little stale can be found here:

http://code.google.com/p/flotsam/downloads/detail?name=vehicle.3.patch

Some of the things that I found:

* dAMotorEuler is not appropriate.  I could not find a any set of 
parameters for the aMotor that would even begin to remotely approximate 
the behavior for a vertical attractor, I had to instead turn to using 
dAMotorUser.  dAMotorUser requires that at each step, you specify at 
what angle(s) the joint is at, rather then having the ODE attempt to 
calculate it automatically.  I also ran into gimbal lock issues with 
aMotorEuler, since the vertical attractor needs to work with 2 or 3 
axises with a full 360 deg range of motion.

* The closest approximation I could get was to essentially set the stops 
at near 0 degs of movement, and then adjust CFM, StopCFM and ERP values 
to control how much the aMotor would attempt to correct the angles 
beyond the stops.

* FudgeFactor and Bounce had little to no visible effect during my 
experiments

* FMax appeared not to affect CFM/ERP behavior, and only seemed to be 
used when you use Vel


The best results I could get adjusting CFM/ERP values had the following 
results:

+ If you manually rotated a physical object out of vertical using the 
editor and then "let go" -- it would more or less smoothly return to 
vertical, although sometimes it would move past vertical and then 
oscillate back and forth, usually taking minutes to come to a rest, 
sometimes never coming to a rest.

+ If I set an object to float (either via buoyancy or the HoverHeight 
PID) and I "bumped" the object with my avatar to impart rotation, it 
would nearly always wildly oscillate, usually obtain vertical on one or 
two axis, and then rarely coming to a rest on the third.  Occasionally 
it would rotate violently, launching my avatar either 1000's of meters 
vertically, under ground, or out of the region.

I was tempted to push what I had to the main SVN, but was unhappy with 
the results so I never got around to it -- then got distracted by Sun, 
Wind, Groups, etc...

--
Michael Cortez



More information about the Opensim-dev mailing list