aligator  0.12.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
 
Loading...
Searching...
No Matches
action-model-wrap.hpp
Go to the documentation of this file.
1
3#pragma once
4
8
12#include <crocoddyl/core/action-base.hpp>
13
14namespace aligator {
15namespace compat {
16namespace croc {
17template <typename Scalar>
18struct NoOpDynamics final : DynamicsModelTpl<Scalar> {
21 using Manifold = ManifoldAbstractTpl<Scalar>;
23 NoOpDynamics(xyz::polymorphic<Manifold> state, const int nu)
24 : Base(state, nu) {}
25
26 void evaluate(const ConstVectorRef &, const ConstVectorRef &,
27 const ConstVectorRef &, DynData &) const override {}
28
29 void computeJacobians(const ConstVectorRef &, const ConstVectorRef &,
30 const ConstVectorRef &, DynData &) const override {}
31};
32
38template <typename Scalar>
44 using CrocActionModel = crocoddyl::ActionModelAbstractTpl<Scalar>;
48 using Manifold = ManifoldAbstractTpl<Scalar>;
49
50 shared_ptr<CrocActionModel> action_model_;
51
52 explicit ActionModelWrapperTpl(shared_ptr<CrocActionModel> action_model);
53
54 bool hasDynModel() const override { return false; }
55
56 void evaluate(const ConstVectorRef &x, const ConstVectorRef &u,
57 const ConstVectorRef &y, Data &data) const override;
58
59 void computeFirstOrderDerivatives(const ConstVectorRef &x,
60 const ConstVectorRef &u,
61 const ConstVectorRef &y,
62 Data &data) const override;
63
65 void computeSecondOrderDerivatives(const ConstVectorRef & /*x*/,
66 const ConstVectorRef & /*u*/,
67 Data & /*data*/) const override {}
68
69 shared_ptr<Data> createData() const override;
70};
71
76template <typename Scalar>
77struct ActionDataWrapperTpl : public StageDataTpl<Scalar> {
79 using CrocActionModel = crocoddyl::ActionModelAbstractTpl<Scalar>;
80 using CrocActionData = crocoddyl::ActionDataAbstractTpl<Scalar>;
82
83 shared_ptr<CrocActionData> croc_action_data;
84
86
87 void checkData();
88
89protected:
90 // utility pointer
91 shared_ptr<DynamicsDataWrapper> dynamics_data;
93};
94
95} // namespace croc
96} // namespace compat
97} // namespace aligator
98
99#include "aligator/compat/crocoddyl/action-model-wrap.txx"
Headers for the Crocoddyl compatibility module.
Headers for compatibility modules.
Main package namespace.
Stage costs for control problems.
DynamicsModelTpl(xyz::polymorphic< Manifold > space, const int nu)
Data struct for stage models StageModelTpl.
StageDataTpl(const StageModel &stage_model)
StageModelTpl(const PolyCost &cost, const PolyDynamics &dynamics)
A complicated child class to StageDataTpl which pipes Crocoddyl's data to the right places.
DynamicsDataWrapperTpl< Scalar > DynamicsDataWrapper
crocoddyl::ActionModelAbstractTpl< Scalar > CrocActionModel
crocoddyl::ActionDataAbstractTpl< Scalar > CrocActionData
shared_ptr< DynamicsDataWrapper > dynamics_data
ActionDataWrapperTpl(const ActionModelWrapperTpl< Scalar > &croc_action_model)
void checkData()
Check data integrity.
Wraps a crocoddyl::ActionModelAbstract.
ActionModelWrapperTpl(shared_ptr< CrocActionModel > action_model)
void computeFirstOrderDerivatives(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, Data &data) const override
Compute the first-order derivatives of the StageModelTpl.
void evaluate(const ConstVectorRef &x, const ConstVectorRef &u, const ConstVectorRef &y, Data &data) const override
Evaluate all the functions (cost, dynamics, constraints) at this node.
DynamicsDataWrapperTpl< Scalar > DynDataWrap
void computeSecondOrderDerivatives(const ConstVectorRef &, const ConstVectorRef &, Data &) const override
Does nothing for this class.
crocoddyl::ActionModelAbstractTpl< Scalar > CrocActionModel
shared_ptr< Data > createData() const override
Create a StageData object.
NoOpDynamics(xyz::polymorphic< Manifold > state, const int nu)
void evaluate(const ConstVectorRef &, const ConstVectorRef &, const ConstVectorRef &, DynData &) const override
void computeJacobians(const ConstVectorRef &, const ConstVectorRef &, const ConstVectorRef &, DynData &) const override
ManifoldAbstractTpl< Scalar > Manifold
Wraps a crocoddyl::StateAbstractTpl to a manifold (proxsuite::nlp::ManifoldAbstractTpl).