zak wrote:Julio, is post correction applicable with exact solver or only with iterative one?
yes it is agnostic to the solver, but I have not implemented the post correction for all joints.
This is not that easy, basically to correct the error after the integration velocity integration and before the position integration the joint nee to calculate the expect velocity,
so that is does not violate geometry of the constraint this si impelmenet by function
void CustomJoint::ProjectError () const
calculating the partial derivatives is not that simple, because for each joint definition, chain rules have to be define to see how the velocity will chine when the joint axis rotate or translate.
Even with tool like Mathematica it becomes difficult. The reason is that many time what seem intuitive is in fact not.
what I do instead is that I do using forward derivatives.
save the joint axis before integration,
do the integration to get the velocity at t + dt,
and the cancel the error by projecting over the joint axis.
even that is no that simple, but yield a very good result.
In the near future, I will change the code a little, because the solver do not have provision for letting the application to apply the correction,
the solver integrate the velocity and position,
therefore I the correction need to remember the position of joints.
I will make the change so that the solve call the application in between the velocity integration and position integration.
the way the correction will be more correct, because only velocities need to be adjusted.
This should provide zero drift for all joints
so far I did the Hinge and the universal joint because those are the joints used by the Forklift demo.
the more degree of freedom a joint has the harder the code is.