crocoddyl  1.5.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
euclidean.hpp
1 // BSD 3-Clause License
3 //
4 // Copyright (C) 2018-2019, LAAS-CNRS
5 // Copyright note valid unless otherwise stated in individual files.
6 // All rights reserved.
8 
9 #ifndef CROCODDYL_CORE_STATES_EUCLIDEAN_HPP_
10 #define CROCODDYL_CORE_STATES_EUCLIDEAN_HPP_
11 
12 #include "crocoddyl/core/fwd.hpp"
13 #include "crocoddyl/core/utils/exception.hpp"
14 #include "crocoddyl/core/state-base.hpp"
15 
16 namespace crocoddyl {
17 
18 template <typename _Scalar>
19 class StateVectorTpl : public StateAbstractTpl<_Scalar> {
20  public:
21  typedef _Scalar Scalar;
22  typedef MathBaseTpl<Scalar> MathBase;
23  typedef typename MathBase::VectorXs VectorXs;
24  typedef typename MathBase::MatrixXs MatrixXs;
25 
26  explicit StateVectorTpl(const std::size_t& nx);
27  virtual ~StateVectorTpl();
28 
29  virtual VectorXs zero() const;
30  virtual VectorXs rand() const;
31  virtual void diff(const Eigen::Ref<const VectorXs>& x0, const Eigen::Ref<const VectorXs>& x1,
32  Eigen::Ref<VectorXs> dxout) const;
33  virtual void integrate(const Eigen::Ref<const VectorXs>& x, const Eigen::Ref<const VectorXs>& dx,
34  Eigen::Ref<VectorXs> xout) const;
35  virtual void Jdiff(const Eigen::Ref<const VectorXs>&, const Eigen::Ref<const VectorXs>&, Eigen::Ref<MatrixXs> Jfirst,
36  Eigen::Ref<MatrixXs> Jsecond, const Jcomponent firstsecond = both) const;
37  virtual void Jintegrate(const Eigen::Ref<const VectorXs>& x, const Eigen::Ref<const VectorXs>& dx,
38  Eigen::Ref<MatrixXs> Jfirst, Eigen::Ref<MatrixXs> Jsecond,
39  const Jcomponent firstsecond = both, const AssignmentOp = setto) const;
40  virtual void JintegrateTransport(const Eigen::Ref<const VectorXs>& x, const Eigen::Ref<const VectorXs>& dx,
41  Eigen::Ref<MatrixXs> Jin, const Jcomponent firstsecond) const;
42 
43  protected:
51 };
52 
53 } // namespace crocoddyl
54 
55 /* --- Details -------------------------------------------------------------- */
56 /* --- Details -------------------------------------------------------------- */
57 /* --- Details -------------------------------------------------------------- */
58 #include "crocoddyl/core/states/euclidean.hxx"
59 
60 #endif // CROCODDYL_CORE_STATES_EUCLIDEAN_HPP_
virtual void Jdiff(const Eigen::Ref< const VectorXs > &, const Eigen::Ref< const VectorXs > &, Eigen::Ref< MatrixXs > Jfirst, Eigen::Ref< MatrixXs > Jsecond, const Jcomponent firstsecond=both) const
Compute the Jacobian of the state manifold differentiation.
virtual void diff(const Eigen::Ref< const VectorXs > &x0, const Eigen::Ref< const VectorXs > &x1, Eigen::Ref< VectorXs > dxout) const
Compute the state manifold differentiation.
virtual VectorXs zero() const
Generate a zero reference state.
VectorXs lb_
Lower state limits.
Definition: state-base.hpp:289
VectorXs ub_
Upper state limits.
Definition: state-base.hpp:290
virtual void integrate(const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &dx, Eigen::Ref< VectorXs > xout) const
Compute the state manifold integration.
bool has_limits_
Indicates whether any of the state limits is finite.
Definition: state-base.hpp:291
virtual void JintegrateTransport(const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &dx, Eigen::Ref< MatrixXs > Jin, const Jcomponent firstsecond) const
Parallel transport from x + dx to x.
std::size_t nx_
State dimension.
Definition: state-base.hpp:285
std::size_t nv_
Velocity dimension.
Definition: state-base.hpp:288
virtual VectorXs rand() const
Generate a random reference state.
virtual void Jintegrate(const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &dx, Eigen::Ref< MatrixXs > Jfirst, Eigen::Ref< MatrixXs > Jsecond, const Jcomponent firstsecond=both, const AssignmentOp=setto) const
Compute the Jacobian of the state manifold integration.
std::size_t ndx_
State rate dimension.
Definition: state-base.hpp:286
std::size_t nq_
Configuration dimension.
Definition: state-base.hpp:287