bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
bitrl::sensors::backends::SensorBackendBase Class Referenceabstract

Base class for modelling sensors with different implementations. More...

#include <sensor_backend_base.h>

Inheritance diagram for bitrl::sensors::backends::SensorBackendBase:

Public Member Functions

virtual ~SensorBackendBase ()=default
 Destructor.
 
real_t sampling_period () const noexcept
 Returns the sampling period of the sensor.
 
void set_sampling_period (real_t period)
 Set the sampling period of the backend.
 
virtual std::vector< real_tread_values ()=0
 Read the sensor value.
 
virtual std::string sensor_units () const
 
virtual void load_from_json (const std::string &filename)=0
 Load robot and simulation parameters from a JSON file.
 
uint_t n_read_values () const noexcept
 
std::string backend_type_str () const noexcept
 

Protected Member Functions

 SensorBackendBase (const std::string &backend_type)
 Constructor.
 

Detailed Description

Base class for modelling sensors with different implementations.

Constructor & Destructor Documentation

◆ ~SensorBackendBase()

virtual bitrl::sensors::backends::SensorBackendBase::~SensorBackendBase ( )
virtualdefault

Destructor.

◆ SensorBackendBase()

bitrl::sensors::backends::SensorBackendBase::SensorBackendBase ( const std::string &  backend_type)
inlineprotected

Constructor.

Parameters
backend_type

Member Function Documentation

◆ backend_type_str()

std::string bitrl::sensors::backends::SensorBackendBase::backend_type_str ( ) const
inlinenoexcept

@bief Return a string that specifies the type of the backend

Returns

◆ load_from_json()

virtual void bitrl::sensors::backends::SensorBackendBase::load_from_json ( const std::string &  filename)
pure virtual

Load robot and simulation parameters from a JSON file.

This function initializes the robot and its associated Chrono simulation objects based on the contents of the provided JSON configuration file.

Typical parameters may include:

  • Physical dimensions
  • Mass and inertia properties
  • Wheel configuration
  • Simulation settings
Parameters
filenamePath to the JSON configuration file.
Exceptions
std::runtime_errorIf the file cannot be read or parsed.

◆ n_read_values()

uint_t bitrl::sensors::backends::SensorBackendBase::n_read_values ( ) const
inlinenoexcept
Returns
The number of values the implementation returns

◆ read_values()

virtual std::vector< real_t > bitrl::sensors::backends::SensorBackendBase::read_values ( )
pure virtual

Read the sensor value.

Returns

◆ sampling_period()

real_t bitrl::sensors::backends::SensorBackendBase::sampling_period ( ) const
inlinenoexcept

Returns the sampling period of the sensor.

Returns

◆ sensor_units()

virtual std::string bitrl::sensors::backends::SensorBackendBase::sensor_units ( ) const
inlinevirtual
Returns
An instance of std::string representing the units the sensor readings are assumed in

Reimplemented in bitrl::sensors::backends::RangeSensorBackendBase.

◆ set_sampling_period()

void bitrl::sensors::backends::SensorBackendBase::set_sampling_period ( real_t  period)
inline

Set the sampling period of the backend.

Parameters
period

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