bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp > Class Template Referenceabstract

Base class for deriving motion models. Motion models describe the dynamics or kinematics of a rigid body. More...

#include <motion_model_base.h>

Inheritance diagram for bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >:
Collaboration diagram for bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >:

Public Types

using state_type = StateTp
using output_type = state_type
using input_type = InputTp
using matrix_descriptor_type = MatrixDescriptor
using matrix_type = typename matrix_descriptor_type::matrix_type
using vector_type = typename matrix_descriptor_type::vector_type

Public Member Functions

virtual ~MotionModelDynamicsBase ()=default
 Destructor.
virtual state_type & evaluate (const input_type &input)=0
 Updates and returns the value of the state given the input.
const state_type & get_state () const
 Read access to the state.
state_type & get_state ()
 Read/write access to the state.
std::vector< std::string_view > get_state_variables_names () const
 get_state_variables_names. Returns the name of the variables in the state
matrix_type & get_matrix (const std::string &name)
const matrix_type & get_matrix (const std::string &name) const
void set_matrix (const std::string &name, const matrix_type &mat)
vector_type & get_vector (const std::string &name)
const vector_type & get_vector (const std::string &name) const
void set_vector (const std::string &name, const vector_type &vec)
void set_matrix_update_flag (bool f)
 set the matrix update flag
bool allows_matrix_updates () const
 Set the flag for updating or not the matrices describing the model.
bool has_matrix (const std::string &name) const
 Returns true if the matrix with the given name already exists.
real_t get_state_property (const std::string &name) const
 Returns the state property with the given name.
void set_state_property (const std::string &name, real_t value)
 Set the name-th value of the state.
void set_state_name_value (uint_t i, const std::string &name, real_t val)
 Set the state names.
void set_state_name_value (uint_t i, const std::pair< std::string, real_t > &val)
 Set the state names.
void set_time_step (real_t dt)
 Set the time step.
real_t get_time_step () const
 get_time_step Returns the sampling time the dynamics model is using
real_t get_tolerance () const
 get_tolerance Returns the general tolerance used in the calculations
void set_tolerance (real_t tol)
 set_tolerance Set the general tolerance used in the calculations. Default is KernelConsts::tolerance()

Static Public Attributes

static const uint_t state_dimension = StateTp::dimension
 The dimension of the state.

Protected Member Functions

 MotionModelDynamicsBase (bool update_description_matrices_on_evaluate=true)
 Constructor.
 MotionModelDynamicsBase (const state_type &init_state, bool update_description_matrices_on_evaluate=true)
 Constructor.

Protected Attributes

state_type state_
 The object describing the state of the object of which its dynamics are described/modeled by this MotionModel.
matrix_descriptor_type matrix_description_
 matrix descriptor
bool update_description_matrices_on_evaluate_
 flag indicating the update of the matrices the model is using to describe itself
real_t dt_
 The time step the integrator uses.
real_t tol_
 tolerance

Detailed Description

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
class bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >

Base class for deriving motion models. Motion models describe the dynamics or kinematics of a rigid body.

Member Typedef Documentation

◆ input_type

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
using bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::input_type = InputTp

◆ matrix_descriptor_type

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
using bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::matrix_descriptor_type = MatrixDescriptor

◆ matrix_type

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
using bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::matrix_type = typename matrix_descriptor_type::matrix_type

◆ output_type

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
using bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::output_type = state_type

◆ state_type

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
using bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::state_type = StateTp

◆ vector_type

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
using bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::vector_type = typename matrix_descriptor_type::vector_type

Constructor & Destructor Documentation

◆ ~MotionModelDynamicsBase()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
virtual bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::~MotionModelDynamicsBase ( )
virtualdefault

Destructor.

◆ MotionModelDynamicsBase() [1/2]

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::MotionModelDynamicsBase ( bool update_description_matrices_on_evaluate = true)
explicitprotected

Constructor.

◆ MotionModelDynamicsBase() [2/2]

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::MotionModelDynamicsBase ( const state_type & init_state,
bool update_description_matrices_on_evaluate = true )
protected

Constructor.

Member Function Documentation

◆ allows_matrix_updates()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
bool bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::allows_matrix_updates ( ) const
inline

Set the flag for updating or not the matrices describing the model.

◆ evaluate()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
virtual state_type & bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::evaluate ( const input_type & input)
pure virtual

Updates and returns the value of the state given the input.

Implemented in bitsim::dynamics::BicycleVehicleModelDynamics.

◆ get_matrix() [1/2]

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
matrix_type & bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::get_matrix ( const std::string & name)
inline

◆ get_matrix() [2/2]

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
const matrix_type & bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::get_matrix ( const std::string & name) const
inline

◆ get_state() [1/2]

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
state_type & bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::get_state ( )
inline

Read/write access to the state.

◆ get_state() [2/2]

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
const state_type & bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::get_state ( ) const
inline

Read access to the state.

◆ get_state_property()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
real_t bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::get_state_property ( const std::string & name) const
inline

Returns the state property with the given name.

◆ get_state_variables_names()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
std::vector< std::string_view > bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::get_state_variables_names ( ) const
inline

get_state_variables_names. Returns the name of the variables in the state

◆ get_time_step()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
real_t bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::get_time_step ( ) const
inline

get_time_step Returns the sampling time the dynamics model is using

◆ get_tolerance()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
real_t bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::get_tolerance ( ) const
inline

get_tolerance Returns the general tolerance used in the calculations

◆ get_vector() [1/2]

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
vector_type & bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::get_vector ( const std::string & name)
inline

◆ get_vector() [2/2]

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
const vector_type & bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::get_vector ( const std::string & name) const
inline

◆ has_matrix()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
bool bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::has_matrix ( const std::string & name) const
inline

Returns true if the matrix with the given name already exists.

◆ set_matrix()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
void bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::set_matrix ( const std::string & name,
const matrix_type & mat )
inline

◆ set_matrix_update_flag()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
void bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::set_matrix_update_flag ( bool f)
inline

set the matrix update flag

◆ set_state_name_value() [1/2]

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
void bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::set_state_name_value ( uint_t i,
const std::pair< std::string, real_t > & val )
inline

Set the state names.

◆ set_state_name_value() [2/2]

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
void bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::set_state_name_value ( uint_t i,
const std::string & name,
real_t val )
inline

Set the state names.

◆ set_state_property()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
void bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::set_state_property ( const std::string & name,
real_t value )
inline

Set the name-th value of the state.

◆ set_time_step()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
void bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::set_time_step ( real_t dt)
inline

Set the time step.

◆ set_tolerance()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
void bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::set_tolerance ( real_t tol)
inline

set_tolerance Set the general tolerance used in the calculations. Default is KernelConsts::tolerance()

◆ set_vector()

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
void bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::set_vector ( const std::string & name,
const vector_type & vec )
inline

Member Data Documentation

◆ dt_

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
real_t bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::dt_
protected

The time step the integrator uses.

◆ matrix_description_

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
matrix_descriptor_type bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::matrix_description_
protected

matrix descriptor

◆ state_

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
state_type bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::state_
protected

The object describing the state of the object of which its dynamics are described/modeled by this MotionModel.

◆ state_dimension

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
const uint_t bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::state_dimension = StateTp::dimension
static

The dimension of the state.

◆ tol_

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
real_t bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::tol_
protected

tolerance

◆ update_description_matrices_on_evaluate_

template<typename StateTp, typename MatrixDescriptor, typename InputTp>
bool bitsim::dynamics::MotionModelDynamicsBase< StateTp, MatrixDescriptor, InputTp >::update_description_matrices_on_evaluate_
protected

flag indicating the update of the matrices the model is using to describe itself


The documentation for this class was generated from the following file: