aligator  0.10.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
linear-discrete-dynamics.hpp
Go to the documentation of this file.
1#pragma once
2
4#include <proxsuite-nlp/modelling/spaces/vector-space.hpp>
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 proxsuite::nlp::VectorSpaceTpl<Scalar, Eigen::Dynamic>;
24
26 LinearDiscreteDynamicsTpl(const MatrixXs &A, const MatrixXs &B,
27 const VectorXs &c)
28 : Base(VectorSpaceType((int)A.cols()), (int)B.cols()), A_(A), B_(B),
29 c_(c) {}
30
31 void forward(const ConstVectorRef &x, const ConstVectorRef &u,
32 Data &data) const {
33 data.xnext_ = A_ * x + B_ * u + c_;
34 }
35
36 void dForward(const ConstVectorRef &, const ConstVectorRef &, Data &) const {}
37
38 shared_ptr<DynData> createData() const {
39 auto data =
40 std::make_shared<Data>(this->ndx1, this->nu, this->nx2(), this->ndx2);
41 data->Jx_ = A_;
42 data->Ju_ = B_;
43 return data;
44 }
45};
46
47} // namespace dynamics
48
49} // namespace aligator
Main package namespace.
Specific data struct for explicit dynamics ExplicitDynamicsModelTpl.
Definition fwd.hpp:80
Explicit forward dynamics model .
Definition fwd.hpp:77
LinearDiscreteDynamicsTpl(const MatrixXs &A, const MatrixXs &B, const VectorXs &c)
Constructor with state manifold and matrices.
void dForward(const ConstVectorRef &, const ConstVectorRef &, Data &) const
proxsuite::nlp::VectorSpaceTpl< Scalar, Eigen::Dynamic > VectorSpaceType
void forward(const ConstVectorRef &x, const ConstVectorRef &u, Data &data) const