1 #ifndef __quadruped_walkgen_quadruped_augmented_time_hpp__
2 #define __quadruped_walkgen_quadruped_augmented_time_hpp__
5 #include "crocoddyl/core/action-base.hpp"
6 #include "crocoddyl/core/fwd.hpp"
7 #include "crocoddyl/core/states/euclidean.hpp"
8 #include "crocoddyl/core/utils/timer.hpp"
9 #include "crocoddyl/multibody/friction-cone.hpp"
12 template <
typename _Scalar>
14 :
public crocoddyl::ActionModelAbstractTpl<_Scalar> {
18 typedef crocoddyl::ActionModelAbstractTpl<Scalar>
Base;
19 typedef crocoddyl::MathBaseTpl<Scalar>
MathBase;
24 virtual void calc(
const boost::shared_ptr<ActionDataAbstract>& data,
25 const Eigen::Ref<const typename MathBase::VectorXs>& x,
26 const Eigen::Ref<const typename MathBase::VectorXs>& u);
27 virtual void calcDiff(
const boost::shared_ptr<ActionDataAbstract>& data,
28 const Eigen::Ref<const typename MathBase::VectorXs>& x,
29 const Eigen::Ref<const typename MathBase::VectorXs>& u);
30 virtual boost::shared_ptr<ActionDataAbstract>
createData();
63 const typename Eigen::Matrix<Scalar, 3, 3>&
get_gI()
const;
64 void set_gI(
const typename MathBase::Matrix3s& inertia_matrix);
102 void update_model(
const Eigen::Ref<const typename MathBase::MatrixXs>& l_feet,
103 const Eigen::Ref<const typename MathBase::MatrixXs>& l_stop,
104 const Eigen::Ref<const typename MathBase::MatrixXs>& xref,
105 const Eigen::Ref<const typename MathBase::MatrixXs>& S);
108 const typename Eigen::Matrix<Scalar, 12, 12>&
get_A()
const;
109 const typename Eigen::Matrix<Scalar, 12, 12>&
get_B()
const;
112 const typename Eigen::Matrix<Scalar, 7, 1>&
get_cost()
const;
115 using Base::has_control_limits_;
133 bool centrifugal_term;
136 bool relative_forces;
137 typename Eigen::Matrix<Scalar, 12, 1> uref_;
139 typename Eigen::Matrix<Scalar, 12, 1> force_weights_;
140 typename Eigen::Matrix<Scalar, 12, 1> state_weights_;
141 typename Eigen::Matrix<Scalar, 8, 1> heuristicWeights;
142 typename Eigen::Matrix<Scalar, 8, 1> last_position_weights_;
144 typename Eigen::Matrix<Scalar, 12, 12> A;
145 typename Eigen::Matrix<Scalar, 12, 12> B;
146 typename Eigen::Matrix<Scalar, 12, 1> g;
147 typename Eigen::Matrix<Scalar, 3, 3> R;
148 typename MathBase::Matrix3s R_tmp;
149 typename Eigen::Matrix<Scalar, 3, 3> gI;
151 typename Eigen::Matrix<Scalar, 3, 4> lever_arms;
152 typename MathBase::Vector3s lever_tmp;
153 typename MathBase::MatrixXs xref_;
155 typename Eigen::Matrix<Scalar, 8, 1> pshoulder_;
156 typename Eigen::Matrix<Scalar, 8, 1> pheuristic_;
157 typename Eigen::Matrix<Scalar, 2, 4> pshoulder_0;
158 typename Eigen::Matrix<Scalar, 2, 4> pshoulder_tmp;
160 typename Eigen::Matrix<Scalar, 3, 1> pcentrifugal_tmp;
161 typename Eigen::Matrix<Scalar, 3, 1> pcentrifugal_tmp_1;
162 typename Eigen::Matrix<Scalar, 3, 1> pcentrifugal_tmp_2;
164 typename Eigen::Matrix<Scalar, 8, 1> pref_;
166 typename Eigen::Matrix<Scalar, 24, 1> ub;
168 typename Eigen::Matrix<Scalar, 24, 1> Fa_x_u;
169 typename Eigen::Matrix<Scalar, 24, 1> rub_max_;
170 typename Eigen::Matrix<Scalar, 24, 24> Arr;
171 typename Eigen::Matrix<Scalar, 6, 1> r;
172 typename Eigen::Matrix<Scalar, 4, 1> gait;
173 typename Eigen::Matrix<Scalar, 8, 1> gait_double;
175 typename Eigen::Matrix<Scalar, 3, 1> base_vector_x;
176 typename Eigen::Matrix<Scalar, 3, 1> base_vector_y;
177 typename Eigen::Matrix<Scalar, 3, 1> base_vector_z;
178 typename Eigen::Matrix<Scalar, 3, 1> forces_3d;
180 typename Eigen::Matrix<Scalar, 1, 1> dt_min_;
181 typename Eigen::Matrix<Scalar, 1, 1> dt_max_;
183 typename Eigen::Matrix<Scalar, 2, 1> rub_max_dt;
184 typename Eigen::Matrix<Scalar, 2, 1> rub_max_dt_bool;
188 typename Eigen::Matrix<Scalar, 7, 1> cost_;
191 typename Eigen::Matrix<Scalar, 3, 4> psh;
192 typename Eigen::Matrix<Scalar, 4, 1> sh_ub_max_;
197 template <
typename _Scalar>
199 :
public crocoddyl::ActionDataAbstractTpl<_Scalar> {
200 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
204 typedef crocoddyl::ActionDataAbstractTpl<Scalar>
Base;
216 template <
template <
typename Scalar>
class Model>
218 : crocoddyl::ActionDataAbstractTpl<
Scalar>(model) {}
225 typedef ActionModelQuadrupedAugmentedTimeTpl<double>