I've been trying to get a hang on Bullet/jBullet for a few weeks now. My project works almost the way I'd like it to work except for one thing - a special form of a Generic6DofConstraint. Because C is not possible in this project, I have to use jBullet (the most recent version).
In my project robots are simulated which have the ability to set a desired angle for a certain constraint between themself and another BoxShape. The same idea is described here: http://bulletphysics.org/Bullet/phpBB3/ ... f=9&t=4857.
All translational axes are locked (lolimit is -SIMD_EPSILON, hilimit is +SIMD_EPSILON for each translational axis). All but one rotational axes are locked to epsilon, too. The last axis may be changed by the robot (using the RotationalLimitMotor for this axis), which means that it is locked to angle-epsilon/angle+epsilon. This works perfectly nice for the x- and z-axis. No problems, no jitter, nice and smooth.
As soon as I try using this for the y-axis there seems to be a wrong impulse/torque which makes the whole construct jump and jitter like crazy. The code is EXACTLY the same for all three axes, no differences there. That's why I tried looking at the Generic6DofConstraint.java file. There I found the following part:
Code: Select all
// in euler angle mode we do not actually constrain the angular velocity
// along the axes axis[0] and axis[2] (although we do use axis[1]) :
//
// to get constrain w2-w1 along ...not
// ------ --------------------- ------
// d(angle[0])/dt = 0 ax[1] x ax[2] ax[0]
// d(angle[1])/dt = 0 ax[1]
// d(angle[2])/dt = 0 ax[0] x ax[1] ax[2]
//
// constraining w2-w1 along an axis 'a' means that a'*(w2-w1)=0.
// to prove the result for angle[0], write the expression for angle[0] from
// GetInfo1 then take the derivative. to prove this for angle[2] it is
// easier to take the euler rate expression for d(angle[2])/dt with respect
// to the components of w and set that to 0.
I've already changed the parameters mentioned in the above thread. Also, I tried adjusting the RotationalLimitMotor parameters - no luck there either. As I said, the problem ONLY occurs with y-axis. Of course all angles are inside -90 and +90 degrees (tried -45 to 45, too).
Does anybody have an idea for a solution? Is it a bug? Has this been fixed in newer bullet versions or is it still an issue?
Thank you all in advance