Adding position constraint with slack
ahundt opened this issue · comments
I'm planning to add a position based constraint with a configurable amount of slack permitted.
Is something similar to this covered by objects like MotionConstr? The docs are a bit sparse in that file.
Additionally, is there any relevant advice or limitations I should know before I create the changes?
Depending on what you want to do, there might be some way to do it already:
- If you want to add a position constraint, using a
ContactConstr
is actually probably the way to go, it doesn't matter if this contact can produce contact forces or not. By using aDofContact
and possibly aPositionTask
, you can have a moving contact, blocked in some DoF, and moving in others. However, you cannot be strict on the range allowed. - If you want to be able to strictly move in some workspace, then I would recommend to implement a new
BodyInPlaneConstr
, based onComIncPlaneConstr
. This constraint allows to constraint the CoM to a convex region defined by its hyperplanes (i.e. inequalities), you would basically need to replace CoM position bybodyPosW[i]
andCoMJacobian
by a regualrJacobian
. - If you really want to add a
PositionConstr
with some slack allowed, we would need to modify the underlying structure of the solver to allow for easy adding/removal of variables. It is possible for now, but definitely not practical.
Cheers,