Class DiffDriveDynamics

Inheritance Relationships

Base Type

Class Documentation

class DiffDriveDynamics : public bitrl::dynamics::MotionModelDynamicsBase<SysState<3>, DynamicsMatrixDescriptor, std::map<std::string, std::any>>

DiffDriveDynamics class. Describes the motion dynamics of a differential drive system. It implements the following equations.

Public Types

enum class DynamicVersion

The DynamicVersion enum. Helper enum to disambiguate the two supplied configurations.

Values:

enumerator V1
enumerator V2
enumerator V3
typedef MotionModelDynamicsBase<SysState<3>, DynamicsMatrixDescriptor, std::map<std::string, std::any>>::state_type state_type

The type of the state handled by this dynamics object.

typedef MotionModelDynamicsBase<SysState<3>, DynamicsMatrixDescriptor, std::map<std::string, std::any>>::input_type input_type

input_t The type of the input for solving the dynamics

typedef MotionModelDynamicsBase<SysState<3>, DynamicsMatrixDescriptor, std::map<std::string, std::any>>::matrix_type matrix_type

matrix_t Matrix type that describes the dynamics

typedef MotionModelDynamicsBase<SysState<3>, DynamicsMatrixDescriptor, std::map<std::string, std::any>>::vector_type vector_type

vector_t

Public Functions

explicit DiffDriveDynamics(DynamicVersion type = DynamicVersion::V1, bool update_description_matrices_on_evaluate = true)

Constructor.

explicit DiffDriveDynamics(state_type &&state)

Constructor.

virtual state_type &evaluate(const input_type &input) override

Evaluate the new state using the given input it also updates the various matrices if needed.

void integrate(const input_type &input)

Integrate the new state. It also uses error terms.

inline real_t get_x_position() const

Read the x-coordinate.

inline void set_x_position(real_t x)

Set the x-coordinate.

inline real_t get_y_position() const

Read the y-coordinate.

inline void set_y_position(real_t y)

Set the y-coordinate.

inline real_t get_orientation() const

Read the y-coordinate.

inline void set_orientation(real_t theta)

Set the orientation.

inline real_t get_velocity() const

get_velocity Returns the velocity used for integration

inline real_t get_angular_velocity() const

get_velocity Returns the angular velocity used for integration

void update_matrices(const input_type &input)

updates the matrices used to describe this motion model

void initialize_matrices(const input_type &input)

Initialize the matrices describing the the dynamics.

Public Static Functions

static SysState<3> integrate_state_v1(const SysState<3> &state, real_t tol, real_t dt, real_t v, real_t w, const std::array<real_t, 2> &errors)

integrate_state_v1

static SysState<3> integrate_state_v2(const SysState<3> &state, real_t dt, real_t v, real_t w, const std::array<real_t, 2> &errors)

integrate_state_v2

static SysState<3> integrate_state_v3(const SysState<3> &state, real_t r, real_t l, real_t dt, real_t w1, real_t w2, const std::array<real_t, 2> &errors)

integrate_state_v3

static SysState<3> integrate(const SysState<3> &state, const input_type &input, const DynamicVersion version)

integrate Factory method to apply the different integration methods