klampt.plan.contactcspace module
Classes:
|
A cspace with contacts that impose closed-chain constraints between a robot and zero or more objects. |
|
A configuration space for a transition between stances. |
|
A cspace with contacts that impose closed-chain constraints between a robot and zero or more objects. |
- class klampt.plan.contactcspace.StanceCSpace(robot, holds, collider=None, world=None, checkTorqueLimits=False)[source]
Bases:
ClosedLoopRobotCSpace
A cspace with contacts that impose closed-chain constraints between a robot and zero or more objects. Stability of the robot is also enforced.
Collisions are not checked between the world and fixed robot links, or contacting links that are initially already colliding with the world.
- robot, collider, solver, tol, maxIters
inherited from
ClosedLoopRobotCSpace
- gravity
the gravity vector (default [0,0,-9.8] – currently cannot accept anything else)
- holds
a list of Holds associated with the contacts.
- Type:
list of
Hold
- sp
the support polygon planes resulting from
contact.supportPolygon(holds)
- Type:
list
- equilibriumMargin
Can enforce that the COM needs to be within the support polygon shrunk by some safety margin. default value is 0.
- Type:
float
Methods:
Returns True if the robot's COM is in the support polygon at configuration q.
- class klampt.plan.contactcspace.TransitionCSpace(space1, space2)[source]
Bases:
ClosedLoopRobotCSpace
A configuration space for a transition between stances. For this to be meaningful, the holds of one stance must be a superset of the holds of the other.
- Parameters:
space1 (StanceCSpace) – the first stance.
space2 (StanceCSpace) – the second stance.
- class klampt.plan.contactcspace.MultiContactCSpace(robot, contacts, stabilityTestObjects=None, collider=None)[source]
Bases:
CompositeCSpace
A cspace with contacts that impose closed-chain constraints between a robot and zero or more objects.
Warning
NOT IMPLEMENTED YET
Collisions are not checked between the world and fixed robot links, or contacting links that are initially already colliding with the world.
- gravity
the gravity vector (default [0,0,-9.8])
- contactMap
a dictionary mapping (obj1,obj2) pairs to lists of contacts. Same structures that results from
contactMap()
.- Type:
dict
- holds
a list of Holds associated with the contacts.
- Type:
list of
Hold
- robotCSpace
a ClosedLoopRobotCSpace for the robot
- Type:
- objectCSpaces
a list of RigidObjectCSpace’s for each moving object.
- Type:
list of
RigidObjectCSpace
- movingObjects
a list of moving robots and rigid objects.
- Type:
list
- stabilityTestObjects
a list of moving robots and rigid objects that will be stability tested.
- Type:
list
- supportPolygon
a list of supportPolygon planes (result from
contact.supportPolygon()
).- Type:
list
- supportPolygonVerts
a list of support polygon vertices.
- Type:
list
Initializes the ContactCSpace. The members contactMap, and objectives are constructed from the contacts argument.
- Parameters:
robot (RobotModel) – the moving robot
contacts – a list of
Hold
, orContactPoint
objects with theobject1
and/orobject2
elements filled out.stabilityTestObjects (list, optional) – if provided, specifies which objects are stability tested (either type
RobotModel
orRigidObjectModel
). Otherwise, all objects and free-floating robots in contact are stability tested.