Drake
ConstrainedValues Class Reference

Base class for specifying various desired objectives. More...

#include <drake/systems/controllers/qp_inverse_dynamics/qp_inverse_dynamics_common.h>

Inheritance diagram for ConstrainedValues:
[legend]

Public Member Functions

 ConstrainedValues ()
 Constructs a ConstrainedValues object with 0 dimension. More...
 
 ConstrainedValues (int dim)
 Constructs a ConstrainedValues object with dimension dim. More...
 
void resize (int dim)
 
void SetAllConstraintTypesBasedOnWeights ()
 Sets all the ConstraintType enums based on their corresponding weight values. More...
 
std::list< intGetConstraintTypeIndices (ConstraintType type) const
 Gets all the indices that have the specified constraint type. More...
 
void SetConstraintType (const std::list< int > &indices, ConstraintType type)
 Sets the given indices' constraint types to the given type. More...
 
void SetAllConstraintType (ConstraintType type)
 Sets all constraint types to the given type. More...
 
bool is_valid () const
 
bool is_valid (int dim) const
 
bool operator== (const ConstrainedValues &other) const
 
bool operator!= (const ConstrainedValues &other) const
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 ConstrainedValues (const ConstrainedValues &)=default
 
ConstrainedValuesoperator= (const ConstrainedValues &)=default
 
 ConstrainedValues (ConstrainedValues &&)=default
 
ConstrainedValuesoperator= (ConstrainedValues &&)=default
 
Accessors
int size () const
 
const VectorX< double > & weights () const
 
const VectorX< double > & values () const
 
const std::vector< ConstraintType > & constraint_types () const
 
double value (int i) const
 
double weight (int i) const
 
ConstraintType constraint_type (int i) const
 
VectorX< double > & mutable_weights ()
 
VectorX< double > & mutable_values ()
 
std::vector< ConstraintType > & mutable_constraint_types ()
 
doublemutable_value (int i)
 
doublemutable_weight (int i)
 
ConstraintTypemutable_constraint_type (int i)
 

Detailed Description

Base class for specifying various desired objectives.

The objectives can be ignored, set as equality constraints or optimized as cost terms depending on the specified types. For cost terms, a positive weight needs to be specified.

Constructor & Destructor Documentation

ConstrainedValues ( const ConstrainedValues )
default
ConstrainedValues ( )
inline

Constructs a ConstrainedValues object with 0 dimension.

ConstrainedValues ( int  dim)
inlineexplicit

Constructs a ConstrainedValues object with dimension dim.

All weights and values are initialized to zero, and constraint types are set to ConstraintType::Skip.

Member Function Documentation

ConstraintType constraint_type ( int  i) const
inline

Here is the caller graph for this function:

const std::vector<ConstraintType>& constraint_types ( ) const
inline

Here is the caller graph for this function:

std::list< int > GetConstraintTypeIndices ( ConstraintType  type) const

Gets all the indices that have the specified constraint type.

Parameters
typeMatching constraint type
Returns
indices

Here is the caller graph for this function:

bool is_valid ( ) const
inline

Here is the call graph for this function:

Here is the caller graph for this function:

bool is_valid ( int  dim) const
ConstraintType& mutable_constraint_type ( int  i)
inline

Here is the caller graph for this function:

std::vector<ConstraintType>& mutable_constraint_types ( )
inline
double& mutable_value ( int  i)
inline
VectorX<double>& mutable_values ( )
inline

Here is the caller graph for this function:

double& mutable_weight ( int  i)
inline

Here is the caller graph for this function:

VectorX<double>& mutable_weights ( )
inline

Here is the caller graph for this function:

bool operator!= ( const ConstrainedValues other) const
inline

Here is the call graph for this function:

ConstrainedValues& operator= ( ConstrainedValues &&  )
default
ConstrainedValues& operator= ( const ConstrainedValues )
default
bool operator== ( const ConstrainedValues other) const

Here is the caller graph for this function:

void resize ( int  dim)

Here is the caller graph for this function:

void SetAllConstraintType ( ConstraintType  type)

Sets all constraint types to the given type.

Parameters
typeDesired type
void SetAllConstraintTypesBasedOnWeights ( )

Sets all the ConstraintType enums based on their corresponding weight values.

ConstraintType is set to:

  ConstraintType::Soft if weight > 0
  ConstraintType::Skip if weight = 0
  ConstraintType::Hard if weight < 0

Here is the caller graph for this function:

void SetConstraintType ( const std::list< int > &  indices,
ConstraintType  type 
)

Sets the given indices' constraint types to the given type.

Parameters
indicesList of indices
typeDesired type
int size ( ) const
inline

Here is the caller graph for this function:

double value ( int  i) const
inline

Here is the caller graph for this function:

const VectorX<double>& values ( ) const
inline

Here is the caller graph for this function:

double weight ( int  i) const
inline

Here is the caller graph for this function:

const VectorX<double>& weights ( ) const
inline

Here is the caller graph for this function:


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