Crocoddyl
Loading...
Searching...
No Matches
StateNumDiffTpl< _Scalar > Class Template Reference
Inheritance diagram for StateNumDiffTpl< _Scalar >:
StateAbstractTpl< _Scalar >StateBase

Public Types

typedef StateAbstractTpl< _Scalar > Base
typedef MathBaseTpl< Scalar > MathBase
typedef MathBase::MatrixXs MatrixXs
typedef MathBase::VectorXs VectorXs
Public Types inherited from StateAbstractTpl< _Scalar >
typedef MathBaseTpl< Scalar > MathBase
typedef MathBase::MatrixXs MatrixXs
typedef MathBase::VectorXs VectorXs

Public Member Functions

 StateNumDiffTpl (std::shared_ptr< Base > state)
template<typename NewScalar>
StateNumDiffTpl< NewScalar > cast () const
virtual void diff (const Eigen::Ref< const VectorXs > &x0, const Eigen::Ref< const VectorXs > &x1, Eigen::Ref< VectorXs > dxout) const override
 Compute the state manifold differentiation.
const Scalar get_disturbance () const
 Return the disturbance constant used in the numerical differentiation routine.
virtual void integrate (const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &dx, Eigen::Ref< VectorXs > xout) const override
 Compute the state manifold integration.
virtual void Jdiff (const Eigen::Ref< const VectorXs > &x0, const Eigen::Ref< const VectorXs > &x1, Eigen::Ref< MatrixXs > Jfirst, Eigen::Ref< MatrixXs > Jsecond, Jcomponent firstsecond=both) const override
 This computes the Jacobian of the diff method by finite 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 op=setto) const override
 This computes the Jacobian of the integrate method by finite differentiation:
virtual void JintegrateTransport (const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &dx, Eigen::Ref< MatrixXs > Jin, const Jcomponent firstsecond=both) const override
 Parallel transport from integrate(x, dx) to x.
virtual void print (std::ostream &os) const override
 Print relevant information of the state numdiff.
virtual VectorXs rand () const override
 Generate a random state.
void set_disturbance (const Scalar disturbance)
 Modify the disturbance constant used by the numerical differentiation routine.
virtual VectorXs zero () const override
 Generate a zero state.
Public Member Functions inherited from StateAbstractTpl< _Scalar >
 StateAbstractTpl (const std::size_t nx, const std::size_t ndx)
 Initialize the state dimensions.
VectorXs diff_dx (const Eigen::Ref< const VectorXs > &x0, const Eigen::Ref< const VectorXs > &x1)
 Compute the state manifold differentiation.
bool get_has_limits () const
 Indicate if the state has defined limits.
const VectorXs & get_lb () const
 Return the state lower bound.
std::size_t get_ndx () const
 Return the dimension of the tangent space of the state manifold.
std::size_t get_nq () const
 Return the dimension of the configuration tuple.
std::size_t get_nv () const
 Return the dimension of tangent space of the configuration manifold.
std::size_t get_nx () const
 Return the dimension of the state tuple.
const VectorXs & get_ub () const
 Return the state upper bound.
VectorXs integrate_x (const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &dx)
 Compute the state manifold integration.
std::vector< MatrixXs > Jdiff_Js (const Eigen::Ref< const VectorXs > &x0, const Eigen::Ref< const VectorXs > &x1, const Jcomponent firstsecond=both)
std::vector< MatrixXs > Jintegrate_Js (const Eigen::Ref< const VectorXs > &x, const Eigen::Ref< const VectorXs > &dx, const Jcomponent firstsecond=both)
 Compute the Jacobian of the state manifold integration.
void set_lb (const VectorXs &lb)
 Modify the state lower bound.
void set_ub (const VectorXs &ub)
 Modify the state upper bound.

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
Public Attributes inherited from StateAbstractTpl< _Scalar >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Protected Attributes

bool has_limits_
 Indicates whether any of the state limits is finite.
VectorXs lb_
 Lower state limits.
std::size_t ndx_
 State rate dimension.
std::size_t nq_
 Configuration dimension.
std::size_t nv_
 Velocity dimension.
std::size_t nx_
 State dimension.
VectorXs ub_
 Upper state limits.
Protected Attributes inherited from StateAbstractTpl< _Scalar >
bool has_limits_
 Indicates whether any of the state limits is finite.
VectorXs lb_
 Lower state limits.
std::size_t ndx_
 State rate dimension.
std::size_t nq_
 Configuration dimension.
std::size_t nv_
 Velocity dimension.
std::size_t nx_
 State dimension.
VectorXs ub_
 Upper state limits.

Additional Inherited Members

Protected Member Functions inherited from StateAbstractTpl< _Scalar >
void update_has_limits ()

Detailed Description

template<typename _Scalar>
class crocoddyl::StateNumDiffTpl< _Scalar >

Definition at line 20 of file state.hpp.

Member Typedef Documentation

◆ MathBase

template<typename _Scalar>
typedef MathBaseTpl<Scalar> MathBase

Definition at line 26 of file state.hpp.

◆ Base

template<typename _Scalar>
typedef StateAbstractTpl<_Scalar> Base

Definition at line 27 of file state.hpp.

◆ VectorXs

template<typename _Scalar>
typedef MathBase::VectorXs VectorXs

Definition at line 28 of file state.hpp.

◆ MatrixXs

template<typename _Scalar>
typedef MathBase::MatrixXs MatrixXs

Definition at line 29 of file state.hpp.

Member Function Documentation

◆ zero()

template<typename _Scalar>
virtual VectorXs zero()const
overridevirtual

Generate a zero state.

Implements StateAbstractTpl< _Scalar >.

◆ rand()

template<typename _Scalar>
virtual VectorXs rand()const
overridevirtual

Generate a random state.

Implements StateAbstractTpl< _Scalar >.

◆ diff()

template<typename _Scalar>
virtual void diff(const Eigen::Ref< const VectorXs > &x0,
const Eigen::Ref< const VectorXs > &x1,
Eigen::Ref< VectorXs >dxout ) const
overridevirtual

Compute the state manifold differentiation.

The state differentiation is defined as:

\begin{equation*}  \delta\mathbf{x} = \mathbf{x}_{1} \ominus \mathbf{x}_{0},
\end{equation*}

where $\mathbf{x}_{1}$, $\mathbf{x}_{0}$ are the current and previous state which lie in a manifold $\mathcal{M}$, and $\delta\mathbf{x} \in T_\mathbf{x} \mathcal{M}$ is the rate of change in the state in the tangent space of the manifold.

Parameters
[in]x0Previous state point (size nx)
[in]x1Current state point (size nx)
[out]dxoutDifference between the current and previous state points (size ndx)

Implements StateAbstractTpl< _Scalar >.

◆ integrate()

template<typename _Scalar>
virtual void integrate(const Eigen::Ref< const VectorXs > &x,
const Eigen::Ref< const VectorXs > &dx,
Eigen::Ref< VectorXs >xout ) const
overridevirtual

Compute the state manifold integration.

The state integration is defined as:

\begin{equation*}  \mathbf{x}_{next} = \mathbf{x} \oplus \delta\mathbf{x},
\end{equation*}

where $\mathbf{x}$, $\mathbf{x}_{next}$ are the current and next state which lie in a manifold $\mathcal{M}$, and $\delta\mathbf{x}
\in T_\mathbf{x} \mathcal{M}$ is the rate of change in the state in the tangent space of the manifold.

Parameters
[in]xState point (size nx)
[in]dxVelocity vector (size ndx)
[out]xoutNext state point (size nx)

Implements StateAbstractTpl< _Scalar >.

◆ Jdiff()

template<typename _Scalar>
virtual void Jdiff(const Eigen::Ref< const VectorXs > &x0,
const Eigen::Ref< const VectorXs > &x1,
Eigen::Ref< MatrixXs >Jfirst,
Eigen::Ref< MatrixXs >Jsecond,
Jcomponentfirstsecond = both ) const
overridevirtual

This computes the Jacobian of the diff method by finite differentiation:

\begin{equation}   Jfirst[:,k] = diff(int(x_1, dx_dist), x_2) - diff(x_1, x_2)/disturbance
\end{equation}

and

\begin{equation}   Jsecond[:,k] = diff(x_1, int(x_2, dx_dist)) - diff(x_1, x_2)/disturbance
\end{equation}

Parameters
Jfirst
Jsecond
firstsecond

Implements StateAbstractTpl< _Scalar >.

◆ Jintegrate()

template<typename _Scalar>
virtual void Jintegrate(const Eigen::Ref< const VectorXs > &x,
const Eigen::Ref< const VectorXs > &dx,
Eigen::Ref< MatrixXs >Jfirst,
Eigen::Ref< MatrixXs >Jsecond,
const Jcomponentfirstsecond = both,
const AssignmentOpop = setto ) const
overridevirtual

This computes the Jacobian of the integrate method by finite differentiation:

\begin{equation}   Jfirst[:,k] = diff( int(x, d_x), int( int(x, dx_dist), dx) )/disturbance
\end{equation}

and

\begin{equation}   Jsecond[:,k] = diff( int(x, d_x), int( x, dx + dx_dist) )/disturbance
\end{equation}

Parameters
Jfirst
Jsecond
firstsecond

Implements StateAbstractTpl< _Scalar >.

◆ JintegrateTransport()

template<typename _Scalar>
virtual void JintegrateTransport(const Eigen::Ref< const VectorXs > &x,
const Eigen::Ref< const VectorXs > &dx,
Eigen::Ref< MatrixXs >Jin,
const Jcomponentfirstsecond = both ) const
overridevirtual

Parallel transport from integrate(x, dx) to x.

This function performs the parallel transportation of an input matrix whose columns are expressed in the tangent space at $\mathbf{x}\oplus\delta\mathbf{x}$ to the tangent space at $\mathbf{x}$ point.

Parameters
[in]xState point (size nx).
[in]dxVelocity vector (size ndx)
[out]JinInput matrix (number of rows = nv).
[in]firstsecondArgument (either x or dx) with respect to which the differentiation of Jintegrate is performed.

Implements StateAbstractTpl< _Scalar >.

◆ print()

template<typename _Scalar>
virtual void print(std::ostream &os)const
overridevirtual

Print relevant information of the state numdiff.

Parameters
[out]osOutput stream object

Reimplemented from StateAbstractTpl< _Scalar >.

Member Data Documentation

◆ Scalar

template<typename _Scalar>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Definition at line 25 of file state.hpp.

◆ has_limits_

template<typename _Scalar>
bool has_limits_
protected

Indicates whether any of the state limits is finite.

Definition at line 340 of file state-base.hpp.

◆ lb_

template<typename _Scalar>
VectorXs lb_
protected

Lower state limits.

Definition at line 338 of file state-base.hpp.

◆ ndx_

template<typename _Scalar>
std::size_t ndx_
protected

State rate dimension.

Definition at line 335 of file state-base.hpp.

◆ nq_

template<typename _Scalar>
std::size_t nq_
protected

Configuration dimension.

Definition at line 336 of file state-base.hpp.

◆ nv_

template<typename _Scalar>
std::size_t nv_
protected

Velocity dimension.

Definition at line 337 of file state-base.hpp.

◆ nx_

template<typename _Scalar>
std::size_t nx_
protected

State dimension.

Definition at line 334 of file state-base.hpp.

◆ ub_

template<typename _Scalar>
VectorXs ub_
protected

Upper state limits.

Definition at line 339 of file state-base.hpp.


The documentation for this class was generated from the following files:
  • /build/source/include/crocoddyl/core/fwd.hpp
  • /build/source/include/crocoddyl/core/numdiff/state.hpp