Drake

Structure for holding constraint data for computing constraint forces at the velocitylevel (i.e., impact problems). More...
#include <drake/multibody/constraint/constraint_problem_data.h>
Public Member Functions  
ConstraintVelProblemData (int gv_dim)  
Constructs velocity problem data for a system with a gv_dim dimensional generalized velocity. More...  
void  Reinitialize (int gv_dim) 
Reinitializes the constraint problem data using the specified dimension of the generalized velocities. More...  
Public Attributes  
std::vector< int >  r 
The number of spanning vectors in the contact tangents (used to linearize the friction cone) at the nc contact points. More...  
VectorX< T >  mu 
Coefficients of friction for the nc contacts. More...  
VectorX< T >  Mv 
The ℝⁿᵛ generalized momentum immediately before any impulsive forces (from impact) are applied. More...  
std::function< MatrixX< T >const MatrixX< T > &)>  solve_inertia 
A function for solving the equation MX = B for matrix X, given input matrix B, where M is the generalized inertia matrix for the rigid body system. More...  
Data for bilateral constraints at the velocity level  
Problem data for bilateral constraints of functions of system velocity, where the constraint can be formulated as: 0 = G(q)⋅v + kᴳ(t,q) which implies the constraint definition g(t,q,v) ≡ G(q)⋅v + kᴳ(t,q). G is defined as the ℝⁿᵇˣⁿᵛ Jacobian matrix that transforms generalized velocities (v ∈ ℝⁿᵛ) into the time derivatives of nb bilateral constraint functions. The class of constraint functions naturally includes holonomic constraints, which are constraints posable as g(t,q). Such holonomic constraints must be differentiated with respect to time to yield a velocitylevel formulation (i.e., ġ(t, q, v), for the aforementioned definition of g(t,q)). That differentiation yields ġ = G⋅v, which is consistent with the constraint class under the definition kᴳ(t,q) ≡ 0. An example such holonomic constraint function is the transmission (gearing) constraint below: 0 = vᵢ  rvⱼ which can be read as the velocity at joint i (vᵢ) must equal to  
std::function< VectorX< T >const VectorX< T > &)>  G_mult 
An operator that performs the multiplication G⋅v. More...  
std::function< VectorX< T >const VectorX< T > &)>  G_transpose_mult 
An operator that performs the multiplication Gᵀ⋅f where f ∈ ℝⁿᵇ are the magnitudes of the constraint forces. More...  
VectorX< T >  kG 
This ℝⁿᵇ vector is the vector kᴳ(t,q) defined above. More...  
Data for constraints on velocities along the contact normal  
Problem data for constraining the velocity of two bodies projected along the contact surface normal, for n point contacts. These data center around the Jacobian matrix N, the ℝⁿᶜˣⁿᵛ Jacobian matrix that transforms generalized velocities (v ∈ ℝⁿᵛ) into velocities projected along the contact normals at the n point contacts. Constraint error (φ < 0, where φ is the signed distance between two bodies) can be incorporated into the constraint solution process (and thereby reduced) through setting the 0 ≤ N(q) v + kᴺ(t,q) ⊥ fᶜ ≥ 0 which means that the constraint ċ(q,v) ≡ N(q)⋅v + kᴺ(t,q) is coupled to an impulsive force constraint (fᶜ ≥ 0) and a complementarity constraint fᶜ⋅(Nv + kᴺ(t,q)) = 0, meaning that the constraint can apply no force if it is inactive (i.e., if ġ(q,v) is strictly greater than zero).  
std::function< VectorX< T >const VectorX< T > &)>  N_mult 
An operator that performs the multiplication N⋅v. More...  
std::function< VectorX< T >const VectorX< T > &)>  N_transpose_mult 
An operator that performs the multiplication Nᵀ⋅f, where f ∈ ℝⁿᶜ are the the magnitudes of the impulsive forces applied along the contact normals at the nc point contacts. More...  
VectorX< T >  kN 
This ℝⁿᶜ vector is the vector kᴺ(t,q,v) defined above. More...  
VectorX< T >  gammaN 
This ℝⁿᶜ vector represents the diagonal matrix γᴺ. More...  
Data for constraints on contact friction  
Problem data for constraining the tangential velocity of two bodies projected along the contact surface tangents, for n point contacts. These data center around the Jacobian matrix, F ∈ ℝⁿⁿʳˣⁿᵛ, that transforms generalized velocities (v ∈ ℝⁿᵛ) into velocities projected along the nr vectors that span the contact tangents at the nc point contacts (these nc * nr vectors are denoted nnr for brevity). For contact problems in two dimensions, nr will be one and nnr would equal nc. For a friction pyramid at each point contact in in three dimensions, nr would be two and nnr would equation 2nc. While the definition of the dimension of the Jacobian matrix above indicates that every one of the nc contacts uses the same "nr", the code imposes no such requirement. Constraint error (F⋅v < 0) can be reduced through the constraint solution process by setting the 0 ≤ F(q)⋅v + kᴺ(t,q) + eλ ⊥ fᶜ ≥ 0 which means that the constraint ġ(q,v) ≡ F(q)⋅v + kᶠ(t,q) + eλ is coupled to an impulsive force constraint (fᶜ ≥ 0) and a complementarity constraint fᶜ⋅(Fv + kᶠ(t,q) + eλ) = 0, meaning that the constraint can apply no force if it is inactive (i.e., if ġ(q,v) is strictly greater than zero). The presence of the λe term is taken directly from [Anitescu 1997], where e is a vector of ones and zeros and λ corresponds roughly to the tangential acceleration at the contacts. The interested reader should refer to [Anitescu 1997] for a more thorough explanation of this constraint; the full constraint equation is presented only to elucidate the purpose of the kᶠ term.  
std::function< VectorX< T >const VectorX< T > &)>  F_mult 
An operator that performs the multiplication F⋅v. More...  
std::function< VectorX< T >const VectorX< T > &)>  F_transpose_mult 
An operator that performs the multiplication Fᵀ⋅f, where f ∈ ℝⁿᶜʳ corresponds to frictional impulsive force magnitudes. More...  
VectorX< T >  kF 
This ℝⁿᶜʳ vector is the vector kᶠ(t,q,v) defined above. More...  
VectorX< T >  gammaF 
This ℝⁿᶜʳ vector represents the diagonal matrix γᶠ. More...  
VectorX< T >  gammaE 
This ℝⁿᶜ vector represents the diagonal matrix γᴱ. More...  
Data for unilateral constraints at the velocity level  
Problem data for unilateral constraints of functions of system velocity, where the constraint can be formulated as: 0 ≤ L(q)⋅v + kᴸ(t,q) ⊥ fᶜ ≥ 0 which means that the constraint ċ(q,v) ≡ L(q)⋅v + kᴸ(t,q) is coupled to an impulsive force constraint (fᶜ ≥ 0) and a complementarity constraint fᶜ⋅(L⋅v + kᴸ(t,q)) = 0, meaning that the constraint can apply no force if it is inactive (i.e., if ġ(q,v) is strictly greater than zero). L is defined as the ℝⁿᵘˣⁿᵛ Jacobian matrix that transforms generalized velocities (v ∈ ℝⁿᵛ) into the time derivatives of nu unilateral constraint functions. The class of constraint functions naturally includes holonomic constraints, which are constraints posable as g(q, t). Such holonomic constraints must be differentiated with respect to time to yield a velocitylevel formulation (i.e., ġ(q, v, t), for the aforementioned definition of g(q, t)). That differentiation yields ġ = L⋅v, which is consistent with the constraint class under the definition kᴸ(t,q) ≡ 0. An example such holonomic constraint function is a joint velocity limit: 0 ≤ vⱼ + r ⊥ fᶜⱼ ≥ 0 which can be read as the velocity at joint j (vⱼ) must be no larger than r, the impulsive force must be applied to limit the acceleration at the joint, and the limiting force cannot be applied if the velocity at the joint is not at the limit (i.e., vⱼ < r). In this example, the constraint function is g(t,q) ≡ qⱼ + rt, yielding ġ(q, v) = vⱼ + r.  
std::function< VectorX< T >const VectorX< T > &)>  L_mult 
An operator that performs the multiplication L⋅v. More...  
std::function< VectorX< T >const VectorX< T > &)>  L_transpose_mult 
An operator that performs the multiplication Lᵀ⋅f where f ∈ ℝᵗ are the magnitudes of the impulsive constraint forces. More...  
VectorX< T >  kL 
This ℝⁿᵘ vector is the vector kᴸ(t,q) defined above. More...  
VectorX< T >  gammaL 
This ℝⁿᵘ vector represents the diagonal matrix γᴸ. More...  
Structure for holding constraint data for computing constraint forces at the velocitylevel (i.e., impact problems).

inlineexplicit 
Constructs velocity problem data for a system with a gv_dim
dimensional generalized velocity.

inline 
Reinitializes the constraint problem data using the specified dimension of the generalized velocities.
An operator that performs the multiplication F⋅v.
The default operator returns an empty vector.
An operator that performs the multiplication Fᵀ⋅f, where f ∈ ℝⁿᶜʳ corresponds to frictional impulsive force magnitudes.
The default operator returns a zero vector of dimension equal to that of the generalized forces.
An operator that performs the multiplication G⋅v.
The default operator returns an empty vector.
An operator that performs the multiplication Gᵀ⋅f where f ∈ ℝⁿᵇ are the magnitudes of the constraint forces.
The default operator returns a zero vector of dimension equal to that of the generalized forces.
VectorX<T> gammaE 
This ℝⁿᶜ vector represents the diagonal matrix γᴱ.
VectorX<T> gammaF 
This ℝⁿᶜʳ vector represents the diagonal matrix γᶠ.
VectorX<T> gammaL 
This ℝⁿᵘ vector represents the diagonal matrix γᴸ.
VectorX<T> gammaN 
This ℝⁿᶜ vector represents the diagonal matrix γᴺ.
VectorX<T> kF 
This ℝⁿᶜʳ vector is the vector kᶠ(t,q,v) defined above.
VectorX<T> kG 
This ℝⁿᵇ vector is the vector kᴳ(t,q) defined above.
VectorX<T> kL 
This ℝⁿᵘ vector is the vector kᴸ(t,q) defined above.
VectorX<T> kN 
This ℝⁿᶜ vector is the vector kᴺ(t,q,v) defined above.
An operator that performs the multiplication L⋅v.
The default operator returns an empty vector.
An operator that performs the multiplication Lᵀ⋅f where f ∈ ℝᵗ are the magnitudes of the impulsive constraint forces.
The default operator returns a zero vector of dimension equal to that of the generalized forces.
VectorX<T> mu 
Coefficients of friction for the nc contacts.
This problem specification does not distinguish between static and dynamic friction coefficients.
VectorX<T> Mv 
The ℝⁿᵛ generalized momentum immediately before any impulsive forces (from impact) are applied.
An operator that performs the multiplication N⋅v.
The default operator returns an empty vector.
An operator that performs the multiplication Nᵀ⋅f, where f ∈ ℝⁿᶜ are the the magnitudes of the impulsive forces applied along the contact normals at the nc point contacts.
The default operator returns a zero vector of dimension equal to that of the generalized velocities (which should be identical to the dimension of the generalized forces).
std::vector<int> r 
The number of spanning vectors in the contact tangents (used to linearize the friction cone) at the nc contact points.
For contact problems in two dimensions, each element of r will be one. For contact problems in three dimensions, a friction pyramid (for example), for a contact point i will have rᵢ = 2. [Anitescu 1997] define k such vectors and require that, for each vector w in the spanning set, w also exists in the spanning set. The RigidContactVelProblemData structure expects that the contact solving mechanism negates the spanning vectors so r
= k/2 spanning vectors will correspond to a kedge polygon friction cone approximation.
A function for solving the equation MX = B for matrix X, given input matrix B, where M is the generalized inertia matrix for the rigid body system.