Template Class ActionModelUnicycleTpl

Inheritance Relationships

Base Type

Class Documentation

template<typename _Scalar>
class ActionModelUnicycleTpl : public crocoddyl::ActionModelAbstractTpl<_Scalar>

Public Types

typedef ActionDataAbstractTpl<Scalar> ActionDataAbstract
typedef ActionModelAbstractTpl<Scalar> Base
typedef ActionDataUnicycleTpl<Scalar> Data
typedef MathBaseTpl<Scalar> MathBase
typedef MathBase::VectorXs VectorXs
typedef MathBase::Vector2s Vector2s

Public Functions

ActionModelUnicycleTpl()
virtual ~ActionModelUnicycleTpl() = default
virtual void calc(const std::shared_ptr<ActionDataAbstract> &data, const Eigen::Ref<const VectorXs> &x, const Eigen::Ref<const VectorXs> &u) override

Compute the next state and cost value.

Parameters:
  • data[in] Action data

  • x[in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

  • u[in] Control input \(\mathbf{u}\in\mathbb{R}^{nu}\)

virtual void calc(const std::shared_ptr<ActionDataAbstract> &data, const Eigen::Ref<const VectorXs> &x) override

Compute the total cost value for nodes that depends only on the state.

It updates the total cost and the next state is not computed as it is not expected to change. This function is used in the terminal nodes of an optimal control problem.

Parameters:
  • data[in] Action data

  • x[in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

virtual void calcDiff(const std::shared_ptr<ActionDataAbstract> &data, const Eigen::Ref<const VectorXs> &x, const Eigen::Ref<const VectorXs> &u) override

Compute the derivatives of the dynamics and cost functions.

It computes the partial derivatives of the dynamical system and the cost function. It assumes that calc() has been run first. This function builds a linear-quadratic approximation of the action model (i.e. dynamical system and cost function).

Parameters:
  • data[in] Action data

  • x[in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

  • u[in] Control input \(\mathbf{u}\in\mathbb{R}^{nu}\)

virtual void calcDiff(const std::shared_ptr<ActionDataAbstract> &data, const Eigen::Ref<const VectorXs> &x) override

Compute the derivatives of the cost functions with respect to the state only.

It updates the derivatives of the cost function with respect to the state only. This function is used in the terminal nodes of an optimal control problem.

Parameters:
  • data[in] Action data

  • x[in] State point \(\mathbf{x}\in\mathbb{R}^{ndx}\)

virtual std::shared_ptr<ActionDataAbstract> createData() override

Create the action data.

Returns:

the action data

template<typename NewScalar>
ActionModelUnicycleTpl<NewScalar> cast() const

Cast the unicycle model to a different scalar type.

It is useful for operations requiring different precision or scalar types.

Template Parameters:

NewScalar – The new scalar type to cast to.

Returns:

ActionModelUnicycleTpl<NewScalar> A unicycle model with the new scalar type.

virtual bool checkData(const std::shared_ptr<ActionDataAbstract> &data) override

Checks that a specific data belongs to this model.

const Vector2s &get_cost_weights() const
void set_cost_weights(const Vector2s &weights)
Scalar get_dt() const
void set_dt(const Scalar dt)
virtual void print(std::ostream &os) const override

Print relevant information of the unicycle model.

Parameters:

os[out] Output stream object

Public Members

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar

Protected Attributes

std::size_t nu_

Control dimension.

std::shared_ptr<StateAbstract> state_

< Control dimension