Base Class#

#include "navground/core/kinematics.h"
class Kinematics : public virtual navground::core::HasRegister<Kinematics>#

Abstract Kinematics type.

A kinematics is used to

  • validated twist in the agent’s frame as feasible

  • convert between wheel speeds and body twist

  • returns maximal linear and angular speed

  • returns the number of degrees of freedom

Negative speed means unconstrained.

Subclassed by navground::core::AheadKinematics, navground::core::FourWheelsOmniDriveKinematics, navground::core::OmnidirectionalKinematics, navground::core::TwoWheelsDifferentialDriveKinematics, navground::core::WheeledKinematics

Public Functions

virtual Twist2 feasible(const Twist2 &twist) const = 0#

The most natural frame for this kinematics: Frame::relative in case the agent is wheeled, else Frame::absolute.

Computes the nearest feasible twist to a desired twist.

Returns:

The frame

Parameters:

twist[in] The desired twist

Returns:

The same desired twist if feasible else the nearest feasible value. How this is defined depends on the concrete sub-class.

inline virtual Twist2 feasible_from_current(const Twist2 &twist, const Twist2 &current, ng_float_t time_step) const#

Computes the nearest feasible twist to a desired twist, taking into account dynamic constraints.

Parameters:
  • twist[in] The desired twist

  • current[in] The current twist

  • time_step[in] The time step to reach the desired twist

Returns:

The same desired twist if feasible else the nearest feasible value. How this is defined depends on the concrete sub-class.

inline virtual bool is_wheeled() const#

Returns whether the kinematics has wheels.

Returns:

True if wheeled, False otherwise.

virtual unsigned dof() const = 0#

Returns the degrees of freedom (between 0 and 3 for planar rigid body kinematics)

Returns:

The number of degrees of freedom.

inline virtual ng_float_t get_max_speed() const#

Gets the maximal speed.

Returns:

The maximal speed.

inline void set_max_speed(ng_float_t value)#

Sets the maximum speed.

Parameters:

value[in] The desired value. A negative number is interpreted as +infinite.

inline virtual ng_float_t get_max_angular_speed() const#

Gets the maximal angular speed.

Returns:

The maximal angular speed.

inline void set_max_angular_speed(ng_float_t value)#

Sets the maximum angular speed.

Parameters:

value[in] The desired value. A negative number is interpreted as +infinite.

Public Static Attributes

static ng_float_t inf = std::numeric_limits<ng_float_t>::infinity()#

We use infinite (or negative) to mark unconstrained values.