![]() |
- 3.0.1 core module.
|
Computes the linearization of a system dynamics function through autodiff. More...
#include <DynamicsLinearizerAD.h>
Public Types | |
| typedef Base::OUT_SCALAR | OUT_SCALAR |
| scalar type of resulting linear system More... | |
| typedef Base::state_vector_t | state_vector_t |
| state vector type More... | |
| typedef Base::control_vector_t | control_vector_t |
| control vector type More... | |
| typedef Base::state_matrix_t | state_matrix_t |
| state Jacobian type (A) More... | |
| typedef Base::state_control_matrix_t | state_control_matrix_t |
| control Jacobian type (B) More... | |
| typedef Base::dynamics_fct_t | dynamics_fct_t |
| dynamics function signature More... | |
Public Types inherited from ct::core::internal::DynamicsLinearizerADBase< STATE_DIM, CONTROL_DIM, SCALAR, TIME > | |
| typedef std::conditional<(std::is_same< SCALAR, CppAD::AD< double >>::value)||(std::is_same< SCALAR, CppAD::AD< CppAD::cg::CG< double >>>::value), double, float >::type | OUT_SCALAR |
| scalar type of resulting linear system More... | |
| typedef StateVector< STATE_DIM, OUT_SCALAR > | state_vector_t |
| typedef ControlVector< CONTROL_DIM, OUT_SCALAR > | control_vector_t |
| typedef StateVector< STATE_DIM, SCALAR > | state_vector_ad_t |
| typedef ControlVector< CONTROL_DIM, SCALAR > | control_vector_ad_t |
| typedef StateMatrix< STATE_DIM, OUT_SCALAR > | state_matrix_t |
| typedef StateControlMatrix< STATE_DIM, CONTROL_DIM, OUT_SCALAR > | state_control_matrix_t |
| typedef std::function< void(const state_vector_ad_t &, const TIME &, const control_vector_ad_t &, state_vector_ad_t &)> | dynamics_fct_t |
| dynamics function signature More... | |
Public Member Functions | |
| DynamicsLinearizerAD (dynamics_fct_t dyn) | |
| default constructor More... | |
| DynamicsLinearizerAD (const DynamicsLinearizerAD &rhs) | |
| copy constructor More... | |
| const state_matrix_t & | getDerivativeState (const state_vector_t &x, const control_vector_t &u, const TIME t=TIME(0)) |
| const state_control_matrix_t & | getDerivativeControl (const state_vector_t &x, const control_vector_t &u, const TIME t=TIME(0)) |
Public Member Functions inherited from ct::core::internal::DynamicsLinearizerADBase< STATE_DIM, CONTROL_DIM, SCALAR, TIME > | |
| DynamicsLinearizerADBase (dynamics_fct_t dyn) | |
| default constructor More... | |
| DynamicsLinearizerADBase (const DynamicsLinearizerADBase &arg) | |
| copy constructor More... | |
| template<typename T = std::string> | |
| std::enable_if< std::is_same< OUT_SCALAR, double >::value, T >::type | getOutScalarType () const |
| template<typename T = std::string> | |
| std::enable_if< std::is_same< OUT_SCALAR, float >::value, T >::type | getOutScalarType () const |
| virtual | ~DynamicsLinearizerADBase () |
| destructor More... | |
Public Attributes | |
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef internal::DynamicsLinearizerADBase< STATE_DIM, CONTROL_DIM, SCALAR, TIME > | Base |
Public Attributes inherited from ct::core::internal::DynamicsLinearizerADBase< STATE_DIM, CONTROL_DIM, SCALAR, TIME > | |
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW | |
Protected Member Functions | |
| void | computeA (const state_vector_t &x, const control_vector_t &u) |
| compute the state Jacobian More... | |
| void | computeB (const state_vector_t &x, const control_vector_t &u) |
| compute the input Jacobian More... | |
Protected Member Functions inherited from ct::core::internal::DynamicsLinearizerADBase< STATE_DIM, CONTROL_DIM, SCALAR, TIME > | |
| void | initialize () |
| initialize all utilities More... | |
| void | recordTerms () |
| record the model More... | |
| void | setupSparsityA () |
| setup the sparsity of the state Jacobian More... | |
| void | setupSparsityB () |
| setup the sparsity of the input Jacobian More... | |
Protected Attributes | |
| dynamics_fct_t | dynamics_fct_ |
| function handle to system dynamics More... | |
| state_matrix_t | dFdx_ |
| Jacobian wrt state. More... | |
| state_control_matrix_t | dFdu_ |
| Jacobian wrt input. More... | |
Protected Attributes inherited from ct::core::internal::DynamicsLinearizerADBase< STATE_DIM, CONTROL_DIM, SCALAR, TIME > | |
| const size_t | A_entries = STATE_DIM * STATE_DIM |
| number of entries in the state Jacobian More... | |
| const size_t | B_entries = STATE_DIM * CONTROL_DIM |
| number of entries in the input Jacobian More... | |
| const size_t | FullJac_entries |
| number of entries in the stacked Jacobian More... | |
| dynamics_fct_t | dynamics_fct_ |
| function handle to system dynamics More... | |
| CppAD::ADFun< typename SCALAR::value_type > | f_ |
| Auto-Diff function. More... | |
| SparsityPattern | sparsityA_ |
| sparsity pattern of the state Jacobian More... | |
| SparsityPattern | sparsityB_ |
| sparsity pattern of the input Jacobian More... | |
Computes the linearization of a system dynamics function through autodiff.
This class takes a function handle representing system dynamics of the form
or
where the last argument is the result of the evaluation in each case. It then computes the linearization around a given point
,
.
| STATE_DIM | dimension of state vector |
| CONTROL_DIM | dimension of control vector |
| SCALAR | scalar type |
| TIME | type of time variable of dynamics |
| typedef Base::OUT_SCALAR ct::core::DynamicsLinearizerAD< STATE_DIM, CONTROL_DIM, SCALAR, TIME >::OUT_SCALAR |
scalar type of resulting linear system
| typedef Base::state_vector_t ct::core::DynamicsLinearizerAD< STATE_DIM, CONTROL_DIM, SCALAR, TIME >::state_vector_t |
state vector type
| typedef Base::control_vector_t ct::core::DynamicsLinearizerAD< STATE_DIM, CONTROL_DIM, SCALAR, TIME >::control_vector_t |
control vector type
| typedef Base::state_matrix_t ct::core::DynamicsLinearizerAD< STATE_DIM, CONTROL_DIM, SCALAR, TIME >::state_matrix_t |
state Jacobian type (A)
| typedef Base::state_control_matrix_t ct::core::DynamicsLinearizerAD< STATE_DIM, CONTROL_DIM, SCALAR, TIME >::state_control_matrix_t |
control Jacobian type (B)
| typedef Base::dynamics_fct_t ct::core::DynamicsLinearizerAD< STATE_DIM, CONTROL_DIM, SCALAR, TIME >::dynamics_fct_t |
dynamics function signature
|
inline |
default constructor
| dyn | function handle to system dynamics |
|
inline |
copy constructor
|
inline |
|
inline |
|
inlineprotected |
compute the state Jacobian
| x | state to linearize around |
| u | input to linearize around |
Referenced by ct::core::DynamicsLinearizerAD< STATE_DIM, CONTROL_DIM, ADScalar, int >::getDerivativeState().
|
inlineprotected |
compute the input Jacobian
| x | state to linearize around |
| u | input to linearize around |
Referenced by ct::core::DynamicsLinearizerAD< STATE_DIM, CONTROL_DIM, ADScalar, int >::getDerivativeControl().
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef internal::DynamicsLinearizerADBase<STATE_DIM, CONTROL_DIM, SCALAR, TIME> ct::core::DynamicsLinearizerAD< STATE_DIM, CONTROL_DIM, SCALAR, TIME >::Base |
|
protected |
function handle to system dynamics
|
protected |
|
protected |