Using Blender for robotics: how to model some physics constraints and sensors

Hi everyone,

I’ve got a bunch of questions related to modeling robotic components with Blender and Bullet.
I’m trying to convert an ODE based model to Blender with physics from Bullet, because ODE seems to start lagging behind quite a bit and if I model everything in Blender directly, conversion to e.g. SolidWorks is easier.
I’m working with Blender 2.56.

So my first question is how to model a flexible constraint?
I simply need to connect two parts of a robot through a joint which has a fixed angle/position, but allows for some movement depending on the applied force/torque (i.e. I’m modeling a spring between 2 components).
I know bullet can do exactly this with a 6DofSpringConstraint, but I have no idea how to set these properties in the Blender Game engine.
From the Bullet source:
btGeneric6DofSpringConstraint.cpp

btScalar delta = currPos - m_equilibriumPoint[i];
// spring force is (delta * m_stiffness) according to Hooke’s Law
btScalar force = delta * m_springStiffness[i];
btScalar velFactor = info->fps * m_springDamping[i] / btScalar(info->m_numIterations);
m_linearLimits.m_targetVelocity[i] = velFactor * force;
m_linearLimits.m_maxMotorForce[i] = btFabs(force) / info->fps;

This looks a lot like the suspension stiffness for the vehicle constraint, so I guess this should be easy?

Second question: how do I add a torque or force sensor to measure the currently applied torque or force on a constraint (joint)? Can the same be used to measure for example the applied pressure when one of the robot’s feet touch the ground?

A more practical question: up till now, my python code was used as an ‘always’ controller by the game engine, so it runs every time the game engine is started. What is the best way to add a supervisor that starts, stops and restarts the game engine and that can access the game data. Basically I need to run the simulation a couple of times with different parameters and the python code should readout some simulation data (e.g. positions)?

Another practical question: can I force the simulation to run slower? While debugging, it would be nice if the simulation could be run slower to verify if all joints are moving correctly etc.

A last question: does Bullet already support ODE’s solver type (Dantzig). I found a ticket on Bullet’s bug tracker, but I don’t know if it has been implemented already (or if it’s included in the Blender distribution)?

Thanks!