template<typename T>
class drake::systems::SystemConstraint< T >
A SystemConstraint is a generic base-class 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 similar to, 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).
We can convert a SystemConstraint to a solvers::Constraint by using SystemConstraintWrapper or SystemConstraintAdapter.
- See also
- LeafSystem<T>::DeclareEqualityConstraint and LeafSystem<T>::DeclareInequalityConstraint for use cases.
- Template Parameters
-
|
| SystemConstraint (const System< T > *system, std::string description) |
| (Advanced) Constructs a default (zero-sized) SystemConstraint. More...
|
|
| SystemConstraint (const System< T > *system, ContextConstraintCalc< T > calc_function, SystemConstraintBounds bounds, std::string description) |
| (Advanced) Constructs a SystemConstraint. More...
|
|
| SystemConstraint (const System< T > *system, SystemConstraintCalc< T > calc_function, SystemConstraintBounds bounds, std::string description) |
| (Advanced) Constructs a SystemConstraint. More...
|
|
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...
|
|
boolean< T > | CheckSatisfied (const Context< T > &context, double tol) const |
| Evaluates the function pointer, and check if all of the outputs are within the desired bounds. More...
|
|
const System< T > & | get_system () const |
| Returns a reference to the System that owns this constraint. More...
|
|
const SystemConstraintBounds & | bounds () const |
|
int | size () const |
|
SystemConstraintType | type () const |
|
bool | is_equality_constraint () const |
|
const Eigen::VectorXd & | lower_bound () const |
|
const Eigen::VectorXd & | upper_bound () const |
|
const std::string & | description () const |
|
|
| SystemConstraint (const SystemConstraint &)=delete |
|
SystemConstraint & | operator= (const SystemConstraint &)=delete |
|
| SystemConstraint (SystemConstraint &&)=delete |
|
SystemConstraint & | operator= (SystemConstraint &&)=delete |
|
|
|
const std::optional< internal::SystemId > & | get_system_id () const |
| (Internal use only) Gets the id of the subsystem associated with this object, if one has been set. More...
|
|
void | set_system_id (internal::SystemId id) |
| (Internal use only) Records the id of the subsystem associated with this object. More...
|
|