Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
ExternalSystemConstraint Class Referencefinal

Detailed Description

An "external" constraint on a System.

This class is intended for use by applications that are examining a System by adding additional constraints based on their particular situation (e.g., that a velocity state element has an upper bound); it is not intended for declaring intrinsic constraints that some particular System subclass might always impose on itself (e.g., that a mass parameter is non-negative).

#include <drake/systems/framework/system_constraint.h>

Public Member Functions

 ExternalSystemConstraint ()
 Creates an empty constraint.
 ExternalSystemConstraint (std::string description, SystemConstraintBounds bounds, SystemConstraintCalc< double > calc_double, SystemConstraintCalc< AutoDiffXd > calc_autodiffxd={}, SystemConstraintCalc< symbolic::Expression > calc_expression={})
 Creates a constraint with the given arguments.
const std::string & description () const
 Returns a human-readable description of this constraint.
const SystemConstraintBoundsbounds () const
 Returns the bounds of this constraint (and whether it is an equality or inequality constraint.)
template<typename T>
const SystemConstraintCalc< T > & get_calc () const
 Retrieves the evaluation function value = f(system, context) for this constraint.
template<>
const SystemConstraintCalc< double > & do_get_calc () const
template<>
const SystemConstraintCalc< AutoDiffXd > & do_get_calc () const
template<>
const SystemConstraintCalc< symbolic::Expression > & do_get_calc () const
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 ExternalSystemConstraint (const ExternalSystemConstraint &)=default
ExternalSystemConstraintoperator= (const ExternalSystemConstraint &)=default
 ExternalSystemConstraint (ExternalSystemConstraint &&)=default
ExternalSystemConstraintoperator= (ExternalSystemConstraint &&)=default

Static Public Member Functions

template<typename GenericSystemConstraintCalc>
static ExternalSystemConstraint MakeForAllScalars (std::string description, SystemConstraintBounds bounds, GenericSystemConstraintCalc calc)
 Creates a constraint based on generic lambda.
template<typename GenericSystemConstraintCalc>
static ExternalSystemConstraint MakeForNonsymbolicScalars (std::string description, SystemConstraintBounds bounds, GenericSystemConstraintCalc calc)
 Creates a constraint based on generic lambda.

Constructor & Destructor Documentation

◆ ExternalSystemConstraint() [1/4]

◆ ExternalSystemConstraint() [2/4]

◆ ExternalSystemConstraint() [3/4]

Creates an empty constraint.

◆ ExternalSystemConstraint() [4/4]

ExternalSystemConstraint ( std::string description,
SystemConstraintBounds bounds,
SystemConstraintCalc< double > calc_double,
SystemConstraintCalc< AutoDiffXd > calc_autodiffxd = {},
SystemConstraintCalc< symbolic::Expression > calc_expression = {} )

Creates a constraint with the given arguments.

The calc functions (other than calc_double) may be omitted.

Member Function Documentation

◆ bounds()

const SystemConstraintBounds & bounds ( ) const

Returns the bounds of this constraint (and whether it is an equality or inequality constraint.)

◆ description()

const std::string & description ( ) const

Returns a human-readable description of this constraint.

◆ do_get_calc() [1/3]

template<>
const SystemConstraintCalc< double > & do_get_calc ( ) const

◆ do_get_calc() [2/3]

template<>
const SystemConstraintCalc< AutoDiffXd > & do_get_calc ( ) const

◆ do_get_calc() [3/3]

template<>
const SystemConstraintCalc< symbolic::Expression > & do_get_calc ( ) const

◆ get_calc()

template<typename T>
const SystemConstraintCalc< T > & get_calc ( ) const

Retrieves the evaluation function value = f(system, context) for this constraint.

The result may be a default-constructed (missing) function, if the scalar type T is not supported by this constraint instance.

Template Parameters
Tdenotes the scalar type of the System<T>.

◆ MakeForAllScalars()

template<typename GenericSystemConstraintCalc>
ExternalSystemConstraint MakeForAllScalars ( std::string description,
SystemConstraintBounds bounds,
GenericSystemConstraintCalc calc )
static

Creates a constraint based on generic lambda.

This constraint will supply Calc functions for Drake's default scalar types.

◆ MakeForNonsymbolicScalars()

template<typename GenericSystemConstraintCalc>
ExternalSystemConstraint MakeForNonsymbolicScalars ( std::string description,
SystemConstraintBounds bounds,
GenericSystemConstraintCalc calc )
static

Creates a constraint based on generic lambda.

This constraint will supply Calc functions for Drake's non-symbolic default scalar types.

◆ operator=() [1/2]

ExternalSystemConstraint & operator= ( const ExternalSystemConstraint & )
default

◆ operator=() [2/2]


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