10 #ifndef CROCODDYL_CORE_ACTIONS_UNICYCLE_HPP_
11 #define CROCODDYL_CORE_ACTIONS_UNICYCLE_HPP_
13 #include "crocoddyl/core/action-base.hpp"
14 #include "crocoddyl/core/fwd.hpp"
15 #include "crocoddyl/core/states/euclidean.hpp"
18 template <
typename _Scalar>
21 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
24 typedef _Scalar Scalar;
29 typedef typename MathBase::VectorXs VectorXs;
30 typedef typename MathBase::Vector2s Vector2s;
35 virtual void calc(
const std::shared_ptr<ActionDataAbstract>& data,
36 const Eigen::Ref<const VectorXs>& x,
37 const Eigen::Ref<const VectorXs>& u)
override;
38 virtual void calc(
const std::shared_ptr<ActionDataAbstract>& data,
39 const Eigen::Ref<const VectorXs>& x)
override;
40 virtual void calcDiff(
const std::shared_ptr<ActionDataAbstract>& data,
41 const Eigen::Ref<const VectorXs>& x,
42 const Eigen::Ref<const VectorXs>& u)
override;
43 virtual void calcDiff(
const std::shared_ptr<ActionDataAbstract>& data,
44 const Eigen::Ref<const VectorXs>& x)
override;
45 virtual std::shared_ptr<ActionDataAbstract>
createData()
override;
56 template <
typename NewScalar>
60 const std::shared_ptr<ActionDataAbstract>& data)
override;
62 const Vector2s& get_cost_weights()
const;
63 void set_cost_weights(
const Vector2s& weights);
65 Scalar get_dt()
const;
66 void set_dt(
const Scalar dt);
73 virtual void print(std::ostream& os)
const override;
80 Vector2s cost_weights_;
84 template <
typename _Scalar>
86 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
88 typedef _Scalar Scalar;
102 template <
template <
typename Scalar>
class Model>
104 Fx.diagonal().array() = Scalar(1.);
114 #include "crocoddyl/core/actions/unicycle.hxx"
Abstract class for action model.
std::shared_ptr< StateAbstract > state_
Model of the state.
std::size_t nu_
Control dimension.
virtual void calc(const std::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) override
Compute the next state and cost value.
virtual std::shared_ptr< ActionDataAbstract > createData() override
Create the action data.
virtual void calcDiff(const std::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) override
Compute the derivatives of the cost functions with respect to the state only.
virtual bool checkData(const std::shared_ptr< ActionDataAbstract > &data) override
Checks that a specific data belongs to this model.
ActionModelUnicycleTpl< NewScalar > cast() const
Cast the unicycle model to a different scalar type.
virtual void calc(const std::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x) override
Compute the total cost value for nodes that depends only on the state.
virtual void calcDiff(const std::shared_ptr< ActionDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u) override
Compute the derivatives of the dynamics and cost functions.
virtual void print(std::ostream &os) const override
Print relevant information of the unicycle model.
VectorXs xnext
evolution state
MatrixXs Fx
Jacobian of the dynamics w.r.t. the state .
MatrixXs Fu
Jacobian of the dynamics w.r.t. the control .
MatrixXs Luu
Hessian of the cost w.r.t. the control .
VectorXs Lx
Jacobian of the cost w.r.t. the state .
MatrixXs Lxx
Hessian of the cost w.r.t. the state .
VectorXs Lu
Jacobian of the cost w.r.t. the control .
MatrixXs Fx
Jacobian of the dynamics w.r.t. the state .