template<class _Derived>
BipedalLocomotion::ContinuousDynamicalSystem::DynamicalSystem class

DynamicalSystem defines a continuous time dynamical system, i.e.

$\dot{x}=f(x, u, t)$ . Please inherit publicly from this class in order to define your custom dynamical system. Just be sure to call after your class definition BLF_DEFINE_CONTINUOUS_DYNAMICAL_SYSTEM_INTERAL_STRUCTURE() For instance

namespace BipedalLocomotion
{
namespace ContinuousDynamicalSystem
{
// forward declaration
class Foo;
}
}
// Here we define the internal structure of the Foo. Notice that the number of types contained in
// the FooStateType must be equal to the number of FooStateDerivetiveType (This is required by the integrator class)

using FooStateType = Eigen::Vector2d;
using FooStateDerivativeType = Eigen::Vector2d;
using FooInputType = Eigen::Vector2d;
BLF_DEFINE_CONTINUOUS_DYNAMICAL_SYSTEM_INTERAL_STRUCTURE(Foo, (FooStateType),
                                                              (FooStateDerivativeType),
                                                              (FooInputType))
namespace BipedalLocomotion
{
namespace ContinuousDynamicalSystem
{
// class definition
class Foo : public DynamicalSystem<Foo>
{
   ...
}
}
}

Public types

using State = typename internal::traits<_Derived>::State
State space type.
using StateDerivative = typename internal::traits<_Derived>::StateDerivative
State space derivative type.
using Input = typename internal::traits<_Derived>::Input
Input type.

Public functions

auto initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> handler) -> bool
Initialize the Dynamical system.
auto setState(const State& state) -> bool
Set the state of the dynamical system.
auto getState() const -> const State&
Get the state to the dynamical system.
auto setControlInput(const Input& controlInput) -> bool
Set the control input to the dynamical system.
auto dynamics(const std::chrono::nanoseconds& time, StateDerivative& stateDerivative) -> bool
Computes the system dynamics.

Function documentation

template<class _Derived>
bool BipedalLocomotion::ContinuousDynamicalSystem::DynamicalSystem<_Derived>::initialize(std::weak_ptr<const ParametersHandler::IParametersHandler> handler)

Initialize the Dynamical system.

Parameters
handler pointer to the parameter handler.
Returns true in case of success/false otherwise.

template<class _Derived>
bool BipedalLocomotion::ContinuousDynamicalSystem::DynamicalSystem<_Derived>::setState(const State& state)

Set the state of the dynamical system.

Parameters
state tuple containing a const reference to the state elements.
Returns true in case of success, false otherwise.

template<class _Derived>
const State& BipedalLocomotion::ContinuousDynamicalSystem::DynamicalSystem<_Derived>::getState() const

Get the state to the dynamical system.

Returns the current state of the dynamical system

template<class _Derived>
bool BipedalLocomotion::ContinuousDynamicalSystem::DynamicalSystem<_Derived>::setControlInput(const Input& controlInput)

Set the control input to the dynamical system.

Parameters
controlInput the value of the control input used to compute the system dynamics.
Returns true in case of success, false otherwise.

template<class _Derived>
bool BipedalLocomotion::ContinuousDynamicalSystem::DynamicalSystem<_Derived>::dynamics(const std::chrono::nanoseconds& time, StateDerivative& stateDerivative)

Computes the system dynamics.

Parameters
time the time at witch the dynamics is computed.
stateDerivative
Returns true in case of success, false otherwise.

It return $f(x, u, t)$ .