Builder design pattern to help with all of the optional arguments in the constructor of SymbolicVectorSystem.
For example, to define the system: ẋ = -x + x³, y = x, we could write
#include <drake/systems/primitives/symbolic_vector_system.h>
Public Member Functions | |
| SymbolicVectorSystemBuilder () | |
| SymbolicVectorSystemBuilder | time (const symbolic::Variable &t) |
| Sets the time variable. | |
| SymbolicVectorSystemBuilder | state (const symbolic::Variable &v) |
| Sets the state variable (scalar version). | |
| SymbolicVectorSystemBuilder | state (const Eigen::Ref< const VectorX< symbolic::Variable > > &vars) |
| Sets the state variables (Eigen::Vector version). | |
| SymbolicVectorSystemBuilder | state (const std::vector< symbolic::Variable > &vars) |
| Sets the state variables (std::vector version). | |
| SymbolicVectorSystemBuilder | input (const symbolic::Variable &v) |
| Sets the input variable (scalar version). | |
| SymbolicVectorSystemBuilder | input (const Eigen::Ref< const VectorX< symbolic::Variable > > &vars) |
| Sets the input variables (Eigen::Vector version). | |
| SymbolicVectorSystemBuilder | input (const std::vector< symbolic::Variable > &vars) |
| Sets the input variables (std::vector version). | |
| SymbolicVectorSystemBuilder | parameter (const symbolic::Variable &v) |
| Sets the parameter variable (scalar version). | |
| SymbolicVectorSystemBuilder | parameter (const Eigen::Ref< const VectorX< symbolic::Variable > > &vars) |
| Sets the parameter variables (Eigen::Vector version). | |
| SymbolicVectorSystemBuilder | parameter (const std::vector< symbolic::Variable > &vars) |
| Sets the parameter variables (std::vector version). | |
| SymbolicVectorSystemBuilder | dynamics (const symbolic::Expression &e) |
| Sets the dynamics method (scalar version). | |
| SymbolicVectorSystemBuilder | dynamics (const Eigen::Ref< const VectorX< symbolic::Expression > > &e) |
| Sets the dynamics method (Eigen::Vector version). | |
| SymbolicVectorSystemBuilder | dynamics (const std::vector< symbolic::Expression > &e) |
| Sets the dynamics variables (std::vector version). | |
| SymbolicVectorSystemBuilder | output (const symbolic::Expression &e) |
| Sets the output method (scalar version). | |
| SymbolicVectorSystemBuilder | output (const Eigen::Ref< const VectorX< symbolic::Expression > > &e) |
| Sets the output method (Eigen::Vector version). | |
| SymbolicVectorSystemBuilder | output (const std::vector< symbolic::Expression > &e) |
| Sets the output variables (std::vector version). | |
| SymbolicVectorSystemBuilder | LinearizeDynamics (const Eigen::Ref< const VectorX< symbolic::Expression > > &x0, const Eigen::Ref< const VectorX< symbolic::Expression > > &u0) |
| Linearizes the system dynamics around (x0, u0) using the first-order Taylor Series expansion. | |
| SymbolicVectorSystemBuilder | time_period (double p) |
| Sets the time period (0 is continuous time). | |
| template<typename T = double> | |
| std::unique_ptr< SymbolicVectorSystem< T > > | Build () |
| Dispatches to the SymbolicVectorSystem constructor with our accumulated arguments. | |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
| SymbolicVectorSystemBuilder (const SymbolicVectorSystemBuilder &)=default | |
| SymbolicVectorSystemBuilder & | operator= (const SymbolicVectorSystemBuilder &)=default |
| SymbolicVectorSystemBuilder (SymbolicVectorSystemBuilder &&)=default | |
| SymbolicVectorSystemBuilder & | operator= (SymbolicVectorSystemBuilder &&)=default |
Accessor methods. | |
Returns the time variable if exists. | |
| const std::optional< symbolic::Variable > & | time () const |
| const VectorX< symbolic::Variable > & | state () const |
| Returns the state variables. | |
| const VectorX< symbolic::Variable > & | input () const |
| Returns the input variables. | |
| const VectorX< symbolic::Variable > & | parameter () const |
| Returns the parameter variables. | |
| const VectorX< symbolic::Expression > & | dynamics () const |
| Returns the dynamics. | |
|
default |
|
default |
| std::unique_ptr< SymbolicVectorSystem< T > > Build | ( | ) |
Dispatches to the SymbolicVectorSystem constructor with our accumulated arguments.
| const VectorX< symbolic::Expression > & dynamics | ( | ) | const |
Returns the dynamics.
| SymbolicVectorSystemBuilder dynamics | ( | const Eigen::Ref< const VectorX< symbolic::Expression > > & | e | ) |
Sets the dynamics method (Eigen::Vector version).
| SymbolicVectorSystemBuilder dynamics | ( | const std::vector< symbolic::Expression > & | e | ) |
Sets the dynamics variables (std::vector version).
| SymbolicVectorSystemBuilder dynamics | ( | const symbolic::Expression & | e | ) |
Sets the dynamics method (scalar version).
| const VectorX< symbolic::Variable > & input | ( | ) | const |
Returns the input variables.
| SymbolicVectorSystemBuilder input | ( | const Eigen::Ref< const VectorX< symbolic::Variable > > & | vars | ) |
Sets the input variables (Eigen::Vector version).
| SymbolicVectorSystemBuilder input | ( | const std::vector< symbolic::Variable > & | vars | ) |
Sets the input variables (std::vector version).
| SymbolicVectorSystemBuilder input | ( | const symbolic::Variable & | v | ) |
Sets the input variable (scalar version).
| SymbolicVectorSystemBuilder LinearizeDynamics | ( | const Eigen::Ref< const VectorX< symbolic::Expression > > & | x0, |
| const Eigen::Ref< const VectorX< symbolic::Expression > > & | u0 ) |
Linearizes the system dynamics around (x0, u0) using the first-order Taylor Series expansion.
x0 should be the length of state(). u0 should be the length of input(). x0 and u0 should not include a state variable or an input variable.x0 or u0 includes a variable new to this system builder, it will be added to this system builder as a parameter.
|
default |
|
default |
| SymbolicVectorSystemBuilder output | ( | const Eigen::Ref< const VectorX< symbolic::Expression > > & | e | ) |
Sets the output method (Eigen::Vector version).
| SymbolicVectorSystemBuilder output | ( | const std::vector< symbolic::Expression > & | e | ) |
Sets the output variables (std::vector version).
| SymbolicVectorSystemBuilder output | ( | const symbolic::Expression & | e | ) |
Sets the output method (scalar version).
| const VectorX< symbolic::Variable > & parameter | ( | ) | const |
Returns the parameter variables.
| SymbolicVectorSystemBuilder parameter | ( | const Eigen::Ref< const VectorX< symbolic::Variable > > & | vars | ) |
Sets the parameter variables (Eigen::Vector version).
| SymbolicVectorSystemBuilder parameter | ( | const std::vector< symbolic::Variable > & | vars | ) |
Sets the parameter variables (std::vector version).
| SymbolicVectorSystemBuilder parameter | ( | const symbolic::Variable & | v | ) |
Sets the parameter variable (scalar version).
| const VectorX< symbolic::Variable > & state | ( | ) | const |
Returns the state variables.
| SymbolicVectorSystemBuilder state | ( | const Eigen::Ref< const VectorX< symbolic::Variable > > & | vars | ) |
Sets the state variables (Eigen::Vector version).
| SymbolicVectorSystemBuilder state | ( | const std::vector< symbolic::Variable > & | vars | ) |
Sets the state variables (std::vector version).
| SymbolicVectorSystemBuilder state | ( | const symbolic::Variable & | v | ) |
Sets the state variable (scalar version).
| const std::optional< symbolic::Variable > & time | ( | ) | const |
| SymbolicVectorSystemBuilder time | ( | const symbolic::Variable & | t | ) |
Sets the time variable.
| SymbolicVectorSystemBuilder time_period | ( | double | p | ) |
Sets the time period (0 is continuous time).