crocoddyl 1.9.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
 
Loading...
Searching...
No Matches
control.hpp
1
2// BSD 3-Clause License
3//
4// Copyright (C) 2019-2021, LAAS-CNRS, University of Edinburgh, INRIA
5// Copyright note valid unless otherwise stated in individual files.
6// All rights reserved.
8
9#ifndef CROCODDYL_CORE_COSTS_CONTROL_HPP_
10#define CROCODDYL_CORE_COSTS_CONTROL_HPP_
11
12#include "crocoddyl/core/fwd.hpp"
13#include "crocoddyl/core/costs/residual.hpp"
14#include "crocoddyl/core/residuals/control.hpp"
15
16namespace crocoddyl {
17
34template <typename _Scalar>
36 public:
37 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
38
39 typedef _Scalar Scalar;
44 typedef typename MathBase::VectorXs VectorXs;
45
55 CostModelControlTpl(boost::shared_ptr<typename Base::StateAbstract> state,
56 boost::shared_ptr<ActivationModelAbstract> activation, const VectorXs& uref);
66 CostModelControlTpl(boost::shared_ptr<typename Base::StateAbstract> state,
67 boost::shared_ptr<ActivationModelAbstract> activation);
68
78 CostModelControlTpl(boost::shared_ptr<typename Base::StateAbstract> state,
79 boost::shared_ptr<ActivationModelAbstract> activation, const std::size_t nu);
80
90 CostModelControlTpl(boost::shared_ptr<typename Base::StateAbstract> state, const VectorXs& uref);
91
102 explicit CostModelControlTpl(boost::shared_ptr<typename Base::StateAbstract> state);
103
113 CostModelControlTpl(boost::shared_ptr<typename Base::StateAbstract> state, const std::size_t nu);
114 virtual ~CostModelControlTpl();
115
123 virtual void calcDiff(const boost::shared_ptr<CostDataAbstract>& data, const Eigen::Ref<const VectorXs>& x,
124 const Eigen::Ref<const VectorXs>& u);
125
126 protected:
130 virtual void set_referenceImpl(const std::type_info& ti, const void* pv);
131
135 virtual void get_referenceImpl(const std::type_info& ti, void* pv);
136
137 using Base::activation_;
138 using Base::nu_;
139 using Base::residual_;
140 using Base::state_;
141 using Base::unone_;
142
143 private:
144 VectorXs uref_;
145};
146
147} // namespace crocoddyl
148
149/* --- Details -------------------------------------------------------------- */
150/* --- Details -------------------------------------------------------------- */
151/* --- Details -------------------------------------------------------------- */
152#include "crocoddyl/core/costs/control.hxx"
153
154#endif // CROCODDYL_CORE_COSTS_CONTROL_HPP_
virtual void set_referenceImpl(const std::type_info &ti, const void *pv)
Modify the control reference.
CostModelControlTpl(boost::shared_ptr< typename Base::StateAbstract > state, const std::size_t nu)
Initialize the control cost model.
CostModelControlTpl(boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation, const std::size_t nu)
Initialize the control cost model.
CostModelControlTpl(boost::shared_ptr< typename Base::StateAbstract > state)
Initialize the control cost model.
virtual void calcDiff(const boost::shared_ptr< CostDataAbstract > &data, const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &u)
Compute the derivatives of the control cost.
CostModelControlTpl(boost::shared_ptr< typename Base::StateAbstract > state, const VectorXs &uref)
Initialize the control cost model.
virtual void get_referenceImpl(const std::type_info &ti, void *pv)
Return the state control.
CostModelControlTpl(boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation, const VectorXs &uref)
Initialize the control cost model.
CostModelControlTpl(boost::shared_ptr< typename Base::StateAbstract > state, boost::shared_ptr< ActivationModelAbstract > activation)
Initialize the control cost model.
Residual-based cost.
Definition: residual.hpp:36
boost::shared_ptr< ActivationModelAbstract > activation_
Activation model.
Definition: cost-base.hpp:241
boost::shared_ptr< StateAbstract > state_
State description.
Definition: cost-base.hpp:240
std::size_t nu_
Control dimension.
Definition: cost-base.hpp:243
VectorXs unone_
No control vector.
Definition: cost-base.hpp:244
boost::shared_ptr< ResidualModelAbstract > residual_
Residual model.
Definition: cost-base.hpp:242
Define a control residual.
Definition: control.hpp:32