Page 1 of 1

Setting Hard Constraints?

Posted: Wed Jun 10, 2020 2:20 pm
by seanjwang
I'm trying to build a robot with closed chain kinematics. I used an open chain SDF model and the "createConstraint" function to close the kinematic chain. The problem I'm having is that the constraints seem to be soft constraints and can be violated if they experience enough force. Is there a way to set the constraints to be hard constraints?

Re: Setting Hard Constraints?

Posted: Wed Jun 10, 2020 9:58 pm
by seanjwang
I was able to solve my issue by raising numSolverIterations. Code runs slower now, but doesn't violate the constraint as much.

Re: Setting Hard Constraints?

Posted: Tue Jun 16, 2020 5:49 pm
by Erwin Coumans
Increasing the number of solver iterations, or using a smaller time step, or increase the number of substeps.
You can also improve convergence by making the masses more similar, if possible (PGS solver converges slower when large mass differences are present, such as 100 kg and 0.1 kg etc)

Another option is using a direct solver, but it may have its own issues. See https://github.com/bulletphysics/bullet ... tSolver.py