|
bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
|
DiffDriveDynamics class. Describes the motion dynamics of a differential drive system. It implements the following equations. More...
#include <diff_drive_dynamics.h>


Public Types | |
| enum class | DynamicVersion { V1 , V2 , V3 } |
| The DynamicVersion enum. Helper enum to disambiguate the two supplied configurations. More... | |
| 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 Types inherited from bitrl::dynamics::MotionModelDynamicsBase< SysState< 3 >, DynamicsMatrixDescriptor, std::map< std::string, std::any > > | |
| typedef SysState< 3 > | state_type |
| typedef state_type | output_type |
| typedef std::map< std::string, std::any > | input_type |
| typedef DynamicsMatrixDescriptor | matrix_descriptor_type |
| typedef matrix_descriptor_type::matrix_type | matrix_type |
| typedef matrix_descriptor_type::vector_type | vector_type |
Public Member Functions | |
| DiffDriveDynamics (DynamicVersion type=DynamicVersion::V1, bool update_description_matrices_on_evaluate=true) | |
| Constructor. | |
| 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. | |
| real_t | get_x_position () const |
| Read the x-coordinate. | |
| void | set_x_position (real_t x) |
| Set the x-coordinate. | |
| real_t | get_y_position () const |
| Read the y-coordinate. | |
| void | set_y_position (real_t y) |
| Set the y-coordinate. | |
| real_t | get_orientation () const |
| Read the y-coordinate. | |
| void | set_orientation (real_t theta) |
| Set the orientation. | |
| real_t | get_velocity () const |
| get_velocity Returns the velocity used for integration | |
| 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 Member Functions inherited from bitrl::dynamics::MotionModelDynamicsBase< SysState< 3 >, DynamicsMatrixDescriptor, std::map< std::string, std::any > > | |
| 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 Member 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 | |
Additional Inherited Members | |
Static Public Attributes inherited from bitrl::dynamics::MotionModelDynamicsBase< SysState< 3 >, DynamicsMatrixDescriptor, std::map< std::string, std::any > > | |
| static const uint_t | state_dimension |
| The dimension of the state. | |
Protected Member Functions inherited from bitrl::dynamics::MotionModelDynamicsBase< SysState< 3 >, DynamicsMatrixDescriptor, std::map< std::string, std::any > > | |
| 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 inherited from bitrl::dynamics::MotionModelDynamicsBase< SysState< 3 >, DynamicsMatrixDescriptor, std::map< std::string, std::any > > | |
| 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 | |
DiffDriveDynamics class. Describes the motion dynamics of a differential drive system. It implements the following equations.
| typedef MotionModelDynamicsBase<SysState<3>,DynamicsMatrixDescriptor,std::map<std::string,std::any>>::input_type bitrl::dynamics::DiffDriveDynamics::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 bitrl::dynamics::DiffDriveDynamics::matrix_type |
matrix_t Matrix type that describes the dynamics
| typedef MotionModelDynamicsBase<SysState<3>,DynamicsMatrixDescriptor,std::map<std::string,std::any>>::state_type bitrl::dynamics::DiffDriveDynamics::state_type |
The type of the state handled by this dynamics object.
| typedef MotionModelDynamicsBase<SysState<3>,DynamicsMatrixDescriptor,std::map<std::string,std::any>>::vector_type bitrl::dynamics::DiffDriveDynamics::vector_type |
vector_t
|
strong |
|
explicit |
Constructor.
|
explicit |
Constructor.
|
overridevirtual |
Evaluate the new state using the given input it also updates the various matrices if needed.
|
inline |
get_velocity Returns the angular velocity used for integration
|
inline |
Read the y-coordinate.
|
inline |
get_velocity Returns the velocity used for integration
|
inline |
Read the x-coordinate.
|
inline |
Read the y-coordinate.
| void bitrl::dynamics::DiffDriveDynamics::initialize_matrices | ( | const input_type & | input | ) |
Initialize the matrices describing the the dynamics.
| void bitrl::dynamics::DiffDriveDynamics::integrate | ( | const input_type & | input | ) |
Integrate the new state. It also uses error terms.
|
static |
integrate Factory method to apply the different integration methods
|
static |
integrate_state_v1
assume zero angular velocity
clip the value
|
static |
integrate_state_v2
|
static |
integrate_state_v3
|
inline |
Set the orientation.
|
inline |
Set the x-coordinate.
|
inline |
Set the y-coordinate.
| void bitrl::dynamics::DiffDriveDynamics::update_matrices | ( | const input_type & | input | ) |
updates the matrices used to describe this motion model