Crocoddyl
 
Loading...
Searching...
No Matches
euclidean.hpp
1
2// BSD 3-Clause License
3//
4// Copyright (C) 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/state-base.hpp"
14#include "crocoddyl/core/utils/exception.hpp"
15
16namespace crocoddyl {
17
18template <typename _Scalar>
19class StateVectorTpl : public StateAbstractTpl<_Scalar> {
20 public:
21 typedef _Scalar Scalar;
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,
32 const Eigen::Ref<const VectorXs>& x1,
33 Eigen::Ref<VectorXs> dxout) const;
34 virtual void integrate(const Eigen::Ref<const VectorXs>& x,
35 const Eigen::Ref<const VectorXs>& dx,
36 Eigen::Ref<VectorXs> xout) const;
37 virtual void Jdiff(const Eigen::Ref<const VectorXs>&,
38 const Eigen::Ref<const VectorXs>&,
39 Eigen::Ref<MatrixXs> Jfirst, Eigen::Ref<MatrixXs> Jsecond,
40 const Jcomponent firstsecond = both) const;
41 virtual void Jintegrate(const Eigen::Ref<const VectorXs>& x,
42 const Eigen::Ref<const VectorXs>& dx,
43 Eigen::Ref<MatrixXs> Jfirst,
44 Eigen::Ref<MatrixXs> Jsecond,
45 const Jcomponent firstsecond = both,
46 const AssignmentOp = setto) const;
47 virtual void JintegrateTransport(const Eigen::Ref<const VectorXs>& x,
48 const Eigen::Ref<const VectorXs>& dx,
49 Eigen::Ref<MatrixXs> Jin,
50 const Jcomponent firstsecond) const;
51
52 protected:
53 using StateAbstractTpl<Scalar>::nx_;
54 using StateAbstractTpl<Scalar>::ndx_;
55 using StateAbstractTpl<Scalar>::nq_;
56 using StateAbstractTpl<Scalar>::nv_;
57 using StateAbstractTpl<Scalar>::lb_;
58 using StateAbstractTpl<Scalar>::ub_;
60};
61
62} // namespace crocoddyl
63
64/* --- Details -------------------------------------------------------------- */
65/* --- Details -------------------------------------------------------------- */
66/* --- Details -------------------------------------------------------------- */
67#include "crocoddyl/core/states/euclidean.hxx"
68
69#endif // CROCODDYL_CORE_STATES_EUCLIDEAN_HPP_
Abstract class for the state representation.
std::size_t nv_
Velocity dimension.
std::size_t nx_
State dimension.
bool has_limits_
Indicates whether any of the state limits is finite.
std::size_t nq_
Configuration dimension.
VectorXs lb_
Lower state limits.
VectorXs ub_
Upper state limits.
std::size_t ndx_
State rate dimension.
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.
virtual VectorXs zero() const
Generate a zero state.
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 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.
virtual VectorXs rand() const
Generate a random state.
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 integrate(x, dx) to x.
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.