-
Notifications
You must be signed in to change notification settings - Fork 174
Floating in Contact Systems
As you might know, a differential action model describes the systems dynamics and cost function in continuous-time. For multi-contact locomotion, we account for the rigid contact by applying the Gauss principle over holonomic constraints in a set of predefined contact placements, i.e.:
This is equality-constrained quadratic problem with an analytical solution of the form:
in which
-
$(\dot{\mathbf{v}},\boldsymbol{\lambda})\in(\mathbb{R}^{nv},\mathbb{R}^{nf})$ are the primal and dual solutions, -
$\mathbf{M}\in\mathbb{R}^{nv\times nv}$ is formally the metric tensor over the configuration manifold$\mathbf{q}\in\mathbb{R}^{nq}$ , -
$\mathbf{J}_{c}= \begin{bmatrix} \mathbf{J}_{c_1} & \cdots & \mathbf{J}_{c_f}\end{bmatrix}\in\mathbb{R}^{nf\times nv}$ is a stack of$f$ contact Jacobians, -
$\boldsymbol{\tau}_b=\mathbf{S}\boldsymbol{\tau}-\mathbf{b}\in\mathbb{R}^{nv}$ is the force-bias vector that accounts for the control$\boldsymbol{\tau}\in\mathbb{R}^{nu}$ , the Coriolis and gravitational effects$\mathbf{b}$ , and$\mathbf{S}$ is the selection matrix of the actuated joint coordinates, and -
$nq$ ,$nv$ ,$nu$ and$nf$ are the number of coordinates used to describe the configuration manifold, its tangent-space dimension, control commands and contact forces, respectively.
And this equality-constrained forward dynamics can be formulated using state space representation, i.e.:
where
For handling a set of cost functions, we have defined a cost manager called CostModelSum
. In Crocoddyl, there is a set of predefined cost functions such as:
- CoM tracking (
CostModelCoM
). - Frame placement and position tracking (
CostModelFramePlacement
andCostModelFrameTranslation
). - Frame velocity (or linear velocity) tracking (
CostModelFrameVelocity
orCostModelFrameVelocityLinear
). - State and control regularization and tracking (
CostModelState
andCostModelControl
). - Force tracking (
CostModelForce
), among others.
Note: all these cost models use an activation function. With this, we can impose different cost function such as weighted quadratic ones. A cost model describes a residual vector, instead an activation model describe a function based on a residual.
As early described, the floating in contact dynamics require to predefined a set of contact placements. Other additional requirements are robot dynamics and the actuation model. First, for the robot dynamics, we use the Pinocchio model. Second, if you don't define actuator dynamics then you could use a simple floating base actuation, which is described in ActuationModelFreeFloating
. Typically you can do so as follows:
damfic = DifferentialActionModelFloatingInContact(pinocchioModel,
actuationModel,
contactModel,
costModel)
where the contact model stacks a set of constrained contact placements as follows:
constrainedContact = ContactModel6D(pinocchioModel, # for 3d contacts do ContactModel6D
frameID)
contactModel = ContactModelMultiple(pinocchioModel)
contactModel.addContact('contact_name', constrainedContact)
For advanced users
You can defined a PD gains that penalizes deviation in the frame position and its motion. These gains helps to numerically stabilize the dynamics rollout, and it's called Baumgarte's stabilization method. Mathematically the holonomic constraints are modified as:
where
-
$\alpha$ and$\beta$ are the Baumgarte gains. -
$\mathbf{R}_{ref}$ is the reference frame placement (or position for 3d contacts).
and it can be defined by the user as follows:
placementRef = # we use Pinocchio SE3, e.g. pinocchio.SE3(ref_rotation, ref_translation)
baumgarteGains = [alpha, beta] # alpha and beta are positive floats
constrainedContact = ContactModel6D(pinocchioModel, # for 3d contacts do ContactModel6D
frameID,
placementRef,
baumgarteGains)