Robot Dynamics Library
Public Member Functions | Public Attributes | List of all members
RobotDynamics::ConstraintSet Struct Reference

Structure that contains both constraint information and workspace memory. More...

#include <Contacts.hpp>

Public Member Functions

 ConstraintSet ()
 
unsigned int addConstraint (unsigned int body_id, const Math::Vector3d &body_point, const Math::Vector3d &world_normal, const char *constraint_name=NULL, double normal_acceleration=0.)
 Adds a constraint to the constraint set. More...
 
ConstraintSet Copy ()
 Copies the constraints and resets its ConstraintSet::bound flag. More...
 
void setSolver (Math::LinearSolver solver)
 Specifies which method should be used for solving undelying linear systems. More...
 
bool bind (const Model &model)
 Initializes and allocates memory for the constraint set. More...
 
size_t size () const
 Returns the number of constraints. More...
 
void clear ()
 Clears all variables in the constraint set. More...
 

Public Attributes

Math::LinearSolver linear_solver
 Method that should be used to solve internal linear systems. More...
 
bool bound
 Whether the constraint set was bound to a model (mandatory!). More...
 
std::vector< std::string > name
 
std::vector< unsigned int > body
 
std::vector< Math::Vector3dpoint
 
std::vector< Math::Vector3dnormal
 
Math::VectorNd acceleration
 
Math::VectorNd force
 
Math::VectorNd impulse
 
Math::VectorNd v_plus
 
Math::MatrixNd H
 Workspace for the joint space inertia matrix. More...
 
Math::VectorNd C
 Workspace for the coriolis forces. More...
 
Math::VectorNd gamma
 Workspace of the lower part of b. More...
 
Math::MatrixNd G
 
Math::MatrixNd A
 Workspace for the Lagrangian left-hand-side matrix. More...
 
Math::VectorNd b
 Workspace for the Lagrangian right-hand-side. More...
 
Math::VectorNd x
 Workspace for the Lagrangian solution. More...
 
Eigen::HouseholderQR< Math::MatrixNdGT_qr
 Workspace for the QR decomposition of the null-space method. More...
 
Math::MatrixNd GT_qr_Q
 
Math::MatrixNd Y
 
Math::MatrixNd Z
 
Math::VectorNd qddot_y
 
Math::VectorNd qddot_z
 
Math::MatrixNd K
 Workspace for the Inverse Articulated-Body Inertia. More...
 
Math::VectorNd a
 Workspace for the accelerations of due to the test forces. More...
 
Math::VectorNd QDDot_t
 Workspace for the test accelerations. More...
 
Math::VectorNd QDDot_0
 Workspace for the default accelerations. More...
 
Math::SpatialForceV f_t
 Workspace for the test forces. More...
 
Math::SpatialForceV f_ext_constraints
 Workspace for the actual spatial forces. More...
 
std::vector< Math::Vector3dpoint_accel_0
 Workspace for the default point accelerations. More...
 
Math::SpatialForceV d_pA
 Workspace for the bias force due to the test force. More...
 
std::vector< Math::SpatialVectord_a
 Workspace for the acceleration due to the test force. More...
 
Math::VectorNd d_u
 
std::vector< Math::SpatialMatrixd_IA
 Workspace for the inertia when applying constraint forces. More...
 
std::vector< Math::SpatialVectord_U
 Workspace when applying constraint forces. More...
 
Math::VectorNd d_d
 Workspace when applying constraint forces. More...
 
std::vector< Math::Vector3dd_multdof3_u
 

Detailed Description

Structure that contains both constraint information and workspace memory.

This structure is used to reduce the amount of memory allocations that are needed when computing constraint forces.

The ConstraintSet has to be bound to a model using ConstraintSet::bind() before it can be used in forwardDynamicsContacts .

Constructor & Destructor Documentation

◆ ConstraintSet()

RobotDynamics::ConstraintSet::ConstraintSet ( )
inline

Member Function Documentation

◆ addConstraint()

unsigned int RobotDynamics::ConstraintSet::addConstraint ( unsigned int  body_id,
const Math::Vector3d body_point,
const Math::Vector3d world_normal,
const char *  constraint_name = NULL,
double  normal_acceleration = 0. 
)

Adds a constraint to the constraint set.

Parameters
body_idthe body which is affected directly by the constraint
body_pointthe point that is constrained relative to the contact body
world_normalthe normal along the constraint acts (in base coordinates)
constraint_namea human readable name (optional, default: NULL)
normal_accelerationthe acceleration of the contact along the normal (optional, default: 0.)

◆ bind()

bool RobotDynamics::ConstraintSet::bind ( const Model model)

Initializes and allocates memory for the constraint set.

This function allocates memory for temporary values and matrices that are required for contact force computation. Both model and constraint set must not be changed after a binding as the required memory is dependent on the model size (i.e. the number of bodies and degrees of freedom) and the number of constraints in the Constraint set.

The values of ConstraintSet::acceleration may still be modified after the set is bound to the model.

◆ clear()

void RobotDynamics::ConstraintSet::clear ( )

Clears all variables in the constraint set.

◆ Copy()

ConstraintSet RobotDynamics::ConstraintSet::Copy ( )
inline

Copies the constraints and resets its ConstraintSet::bound flag.

◆ setSolver()

void RobotDynamics::ConstraintSet::setSolver ( Math::LinearSolver  solver)
inline

Specifies which method should be used for solving undelying linear systems.

◆ size()

size_t RobotDynamics::ConstraintSet::size ( ) const
inline

Returns the number of constraints.

Member Data Documentation

◆ A

Math::MatrixNd RobotDynamics::ConstraintSet::A

Workspace for the Lagrangian left-hand-side matrix.

◆ a

Math::VectorNd RobotDynamics::ConstraintSet::a

Workspace for the accelerations of due to the test forces.

◆ acceleration

Math::VectorNd RobotDynamics::ConstraintSet::acceleration

Enforced accelerations of the contact points along the contact normal.

◆ b

Math::VectorNd RobotDynamics::ConstraintSet::b

Workspace for the Lagrangian right-hand-side.

◆ body

std::vector<unsigned int> RobotDynamics::ConstraintSet::body

◆ bound

bool RobotDynamics::ConstraintSet::bound

Whether the constraint set was bound to a model (mandatory!).

◆ C

Math::VectorNd RobotDynamics::ConstraintSet::C

Workspace for the coriolis forces.

◆ d_a

std::vector<Math::SpatialVector> RobotDynamics::ConstraintSet::d_a

Workspace for the acceleration due to the test force.

◆ d_d

Math::VectorNd RobotDynamics::ConstraintSet::d_d

Workspace when applying constraint forces.

◆ d_IA

std::vector<Math::SpatialMatrix> RobotDynamics::ConstraintSet::d_IA

Workspace for the inertia when applying constraint forces.

◆ d_multdof3_u

std::vector<Math::Vector3d> RobotDynamics::ConstraintSet::d_multdof3_u

◆ d_pA

Math::SpatialForceV RobotDynamics::ConstraintSet::d_pA

Workspace for the bias force due to the test force.

◆ d_u

Math::VectorNd RobotDynamics::ConstraintSet::d_u

◆ d_U

std::vector<Math::SpatialVector> RobotDynamics::ConstraintSet::d_U

Workspace when applying constraint forces.

◆ f_ext_constraints

Math::SpatialForceV RobotDynamics::ConstraintSet::f_ext_constraints

Workspace for the actual spatial forces.

◆ f_t

Math::SpatialForceV RobotDynamics::ConstraintSet::f_t

Workspace for the test forces.

◆ force

Math::VectorNd RobotDynamics::ConstraintSet::force

Actual constraint forces along the contact normals.

◆ G

Math::MatrixNd RobotDynamics::ConstraintSet::G

◆ gamma

Math::VectorNd RobotDynamics::ConstraintSet::gamma

Workspace of the lower part of b.

◆ GT_qr

Eigen::HouseholderQR<Math::MatrixNd> RobotDynamics::ConstraintSet::GT_qr

Workspace for the QR decomposition of the null-space method.

◆ GT_qr_Q

Math::MatrixNd RobotDynamics::ConstraintSet::GT_qr_Q

◆ H

Math::MatrixNd RobotDynamics::ConstraintSet::H

Workspace for the joint space inertia matrix.

◆ impulse

Math::VectorNd RobotDynamics::ConstraintSet::impulse

Actual constraint impulses along the contact normals.

◆ K

Math::MatrixNd RobotDynamics::ConstraintSet::K

Workspace for the Inverse Articulated-Body Inertia.

◆ linear_solver

Math::LinearSolver RobotDynamics::ConstraintSet::linear_solver

Method that should be used to solve internal linear systems.

◆ name

std::vector<std::string> RobotDynamics::ConstraintSet::name

◆ normal

std::vector<Math::Vector3d> RobotDynamics::ConstraintSet::normal

◆ point

std::vector<Math::Vector3d> RobotDynamics::ConstraintSet::point

◆ point_accel_0

std::vector<Math::Vector3d> RobotDynamics::ConstraintSet::point_accel_0

Workspace for the default point accelerations.

◆ QDDot_0

Math::VectorNd RobotDynamics::ConstraintSet::QDDot_0

Workspace for the default accelerations.

◆ QDDot_t

Math::VectorNd RobotDynamics::ConstraintSet::QDDot_t

Workspace for the test accelerations.

◆ qddot_y

Math::VectorNd RobotDynamics::ConstraintSet::qddot_y

◆ qddot_z

Math::VectorNd RobotDynamics::ConstraintSet::qddot_z

◆ v_plus

Math::VectorNd RobotDynamics::ConstraintSet::v_plus

The velocities we want to have along the contact normals after calling ComputeContactImpulsesLagrangian

◆ x

Math::VectorNd RobotDynamics::ConstraintSet::x

Workspace for the Lagrangian solution.

◆ Y

Math::MatrixNd RobotDynamics::ConstraintSet::Y

◆ Z

Math::MatrixNd RobotDynamics::ConstraintSet::Z

The documentation for this struct was generated from the following files: