aligator  0.15.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
linear-discrete-dynamics.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace aligator {
7
8namespace dynamics {
9
11template <typename _Scalar>
13 using Scalar = _Scalar;
15 const MatrixXs A_;
16 const MatrixXs B_;
17 const VectorXs c_;
18
23
25 LinearDiscreteDynamicsTpl(const MatrixXs &A, const MatrixXs &B,
26 const VectorXs &c)
27 : Base(VectorSpaceType((int)A.cols()), (int)B.cols())
28 , A_(A)
29 , B_(B)
30 , c_(c) {}
31
32 void forward(const ConstVectorRef &x, const ConstVectorRef &u,
33 Data &data) const {
34 data.xnext_ = A_ * x + B_ * u + c_;
35 }
36
37 void dForward(const ConstVectorRef &, const ConstVectorRef &, Data &) const {}
38
39 shared_ptr<DynData> createData() const {
40 auto data =
41 std::make_shared<Data>(this->ndx1, this->nu, this->nx2(), this->ndx2);
42 data->Jx_ = A_;
43 data->Ju_ = B_;
44 return data;
45 }
46};
47
48} // namespace dynamics
49
50} // namespace aligator
Namespace for modelling system dynamics.
Main package namespace.
const int ndx2
Next state space dimension.
Definition dynamics.hpp:29
const int nu
Control dimension.
Definition dynamics.hpp:27
const int ndx1
State space dimension.
Definition dynamics.hpp:25
Specific data struct for explicit dynamics ExplicitDynamicsModelTpl.
ExplicitDynamicsModelTpl(const ManifoldPtr &space, const int nu)
Constructor requires providing the next state's manifold.
Standard Euclidean vector space.
::aligator::VectorSpaceTpl< Scalar, Eigen::Dynamic > VectorSpaceType
LinearDiscreteDynamicsTpl(const MatrixXs &A, const MatrixXs &B, const VectorXs &c)
Constructor with state manifold and matrices.
void dForward(const ConstVectorRef &, const ConstVectorRef &, Data &) const
Compute the Jacobians of the forward dynamics.
void forward(const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const
Evaluate the forward discrete dynamics.