Setting Hard Constraints?

Official Python bindings with a focus on reinforcement learning and robotics.
Post Reply
seanjwang
Posts: 2
Joined: Wed Jun 10, 2020 2:13 pm

Setting Hard Constraints?

Post 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?
seanjwang
Posts: 2
Joined: Wed Jun 10, 2020 2:13 pm

Re: Setting Hard Constraints?

Post by seanjwang »

I was able to solve my issue by raising numSolverIterations. Code runs slower now, but doesn't violate the constraint as much.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Setting Hard Constraints?

Post 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
Post Reply