Drake

A SystemConstraint is a generic baseclass for constraints on Systems. More...
#include <drake/systems/framework/system_constraint.h>
Public Types  
using  CalcCallback = std::function< void(const Context< T > &context, VectorX< T > *value)> 
This is the signature of a stateless function that evaluates the value of the constraint function f: value = f(context), where value has the dimension specified in the constructor. More...  
Public Member Functions  
SystemConstraint (CalcCallback calc_function, int count, bool is_equality_constraint, const std::string &description)  
Constructs the SystemConstraint. More...  
virtual  ~SystemConstraint ()=default 
void  Calc (const Context< T > &context, VectorX< T > *value) const 
Evaluates the function pointer passed in through the constructor, writing the output to value . More...  
template<typename T1 = T>  
std::enable_if< is_numeric< T1 >::value, bool >::type  CheckSatisfied (const Context< T1 > &context, double tol=1E6) const 
Evaluates the function pointer, and check if all of the outputs are within the desired bounds. More...  
int  size () const 
bool  is_equality_constraint () const 
const std::string &  description () const 
Does not allow copy, move, or assignment  
SystemConstraint (const SystemConstraint &)=delete  
SystemConstraint &  operator= (const SystemConstraint &)=delete 
SystemConstraint (SystemConstraint &&)=delete  
SystemConstraint &  operator= (SystemConstraint &&)=delete 
A SystemConstraint is a generic baseclass for constraints on Systems.
A SystemConstraint is a means to inform our algorithms about the implemented system behavior – declaring the constraint does not cause the system behavior to change. It is meant to improve analysis by telling our algorithms that "all valid solutions of this dynamical system will satisfy the following (in)equalities". Examples could include conserved quantities or joint limits on a mechanism.
This class is intentionally compatible with, but (so far) independent from solvers::Constraint. This is primarily because there is no notion of decision variables in the system classes (yet); rather each individual algorithm (e.g. trajectory optimization, or system identification) constructs decision variables for the particular mathematical program that is being formulated, and must bind the system constraint to those variables (e.g. by populating the Context with the decision variables and calling Calc).
T  The vector element type, which must be a valid Eigen scalar. 
Instantiated templates for the following kinds of T's are provided:
They are already available to link against in the containing library.
using CalcCallback = std::function<void(const Context<T>& context, VectorX<T>* value)> 
This is the signature of a stateless function that evaluates the value of the constraint function f: value = f(context), where value has the dimension specified in the constructor.

delete 

delete 

inline 
Constructs the SystemConstraint.
count  the number of constraints (size of the value vector). 
is_equality_constraint  true implies that the constraint is of the form f(x)=0, false implies an inequality constraint of the form f(x)≥0. 
description  a humanreadable description useful for debugging. 

virtualdefault 
Evaluates the function pointer passed in through the constructor, writing the output to value
.
value
will be (nonconservatively) resized to match the constraint function output.

inline 
Evaluates the function pointer, and check if all of the outputs are within the desired bounds.

inline 

inline 

delete 

delete 

inline 