bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
bitrl::dynamics::BicycleVehicleModelDynamics Class Reference

The BicycleVehicleModelDynamics class. Implements the bicycle vehicle model dynamics. The implementation of the dynamics is taken from the paper: Deep Reinforcement Learning for Mobile Robot Path Planning by Hao Liu, Yi Shen, Shuangjiang Yu, Zijun Gao, Tong Wu The state of the model is described by the tuple (X, Y, Phi) where (X,Y) denotes the 2D position of the vehicle in the world coordinates and phi denotes the heading of the vehicle. More...

#include <bicycle_vehicle_model_dynamics.h>

Inheritance diagram for bitrl::dynamics::BicycleVehicleModelDynamics:
Collaboration diagram for bitrl::dynamics::BicycleVehicleModelDynamics:

Public Types

typedef MotionModelDynamicsBase< SysState< 3 >, DynamicsMatrixDescriptor, std::map< std::string, std::any > > base_type
 
typedef base_type::state_type state_type
 
typedef base_type::input_type input_type
 
typedef base_type::matrix_descriptor_type matrix_descriptor_type
 
typedef matrix_descriptor_type::matrix_type matrix_type
 
typedef matrix_descriptor_type::vector_type vector_type
 
- 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

 BicycleVehicleModelDynamics (const BicycleVehicleModelDynamicsConfig config, SysState< 3 > &init_state)
 Constructor.
 
void integrate (const input_type &input)
 integrate. Integrate the dynamics equations the model expects the following inputs the velocity of the vehicle v and the angle delta of the front wheel
 
state_typeevaluate (const input_type &input)
 evaluate
 
void initialize_matrices (const input_type &input)
 initialize_matrices. Initialize the matrix description of the dynamics
 
void update_matrices (const input_type &input)
 update_matrices. Update the matrix description of the dynamics
 
void load_from_json (const std::string &filename)
 load_from_json Load the description of the chassis from the given json file
 
- Public Member Functions inherited from bitrl::dynamics::MotionModelDynamicsBase< SysState< 3 >, DynamicsMatrixDescriptor, std::map< std::string, std::any > >
virtual ~MotionModelDynamicsBase ()=default
 Destructor.
 
virtual state_typeevaluate (const input_type &input)=0
 Updates and returns the value of the state given the input.
 
const state_typeget_state () const
 Read access to the state.
 
state_typeget_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_typeget_matrix (const std::string &name)
 
const matrix_typeget_matrix (const std::string &name) const
 
void set_matrix (const std::string &name, const matrix_type &mat)
 
vector_typeget_vector (const std::string &name)
 
const vector_typeget_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()
 

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
 

Detailed Description

The BicycleVehicleModelDynamics class. Implements the bicycle vehicle model dynamics. The implementation of the dynamics is taken from the paper: Deep Reinforcement Learning for Mobile Robot Path Planning by Hao Liu, Yi Shen, Shuangjiang Yu, Zijun Gao, Tong Wu The state of the model is described by the tuple (X, Y, Phi) where (X,Y) denotes the 2D position of the vehicle in the world coordinates and phi denotes the heading of the vehicle.

Member Typedef Documentation

◆ base_type

◆ input_type

◆ matrix_descriptor_type

◆ matrix_type

◆ state_type

◆ vector_type

Constructor & Destructor Documentation

◆ BicycleVehicleModelDynamics()

bitrl::dynamics::BicycleVehicleModelDynamics::BicycleVehicleModelDynamics ( const BicycleVehicleModelDynamicsConfig  config,
SysState< 3 > &  init_state 
)

Constructor.

Member Function Documentation

◆ evaluate()

BicycleVehicleModelDynamics::state_type & bitrl::dynamics::BicycleVehicleModelDynamics::evaluate ( const input_type input)

evaluate

Parameters
input
Returns

◆ initialize_matrices()

void bitrl::dynamics::BicycleVehicleModelDynamics::initialize_matrices ( const input_type input)

initialize_matrices. Initialize the matrix description of the dynamics

◆ integrate()

void bitrl::dynamics::BicycleVehicleModelDynamics::integrate ( const input_type input)

integrate. Integrate the dynamics equations the model expects the following inputs the velocity of the vehicle v and the angle delta of the front wheel

before we do the integration update the matrices

◆ load_from_json()

void bitrl::dynamics::BicycleVehicleModelDynamics::load_from_json ( const std::string &  filename)
inline

load_from_json Load the description of the chassis from the given json file

◆ update_matrices()

void bitrl::dynamics::BicycleVehicleModelDynamics::update_matrices ( const input_type input)

update_matrices. Update the matrix description of the dynamics


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