bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
Loading...
Searching...
No Matches
bitrl::sensors::UltrasonicSensor Class Referencefinal

Class for modelling ultrasonic sensors. More...

#include <ultrasonic_sensor.h>

Inheritance diagram for bitrl::sensors::UltrasonicSensor:
Collaboration diagram for bitrl::sensors::UltrasonicSensor:

Public Member Functions

 UltrasonicSensor (std::shared_ptr< bitrl::sensors::backends::RangeSensorBackendBase > backend, const std::string name=bitrl::consts::INVALID_STR)
 Constructor.
 
virtual void init ()
 Initialize the sensor. Set the is is_enabled_ flag to true. and performs any other initializations required by the sensor.
 
virtual const std::vector< real_t > & read_values ()
 Reads the sensor values and updates the values held internally.
 
virtual std::string backend_type_str () const
 
virtual std::string sensor_units () const
 
- Public Member Functions inherited from bitrl::sensors::SensorBase
virtual ~SensorBase ()=default
 Destructor.
 
bool is_enabled () const noexcept
 Returns true if the sensor is enabled.
 
void enable () noexcept
 Set the is_enabled_ flag to true.
 
void disable () noexcept
 Disable the sensor.
 
const std::vector< real_t > & last_read_values () const noexcept
 
std::string sensor_name () const noexcept
 
void set_sensor_name (const std::string &sensor_name) noexcept
 Set the sensor name.
 
std::string sensor_type () const noexcept
 

Static Public Attributes

static const std::string SENSOR_TYPE = "UltrasonicSensor"
 The type of the sensor.
 

Additional Inherited Members

- Protected Member Functions inherited from bitrl::sensors::SensorBase
 SensorBase (const std::string &sensor_type, const std::string &sensor_name=bitrl::consts::INVALID_STR)
 
- Protected Attributes inherited from bitrl::sensors::SensorBase
std::vector< real_tvalues_
 The values last read by the sensor.
 

Detailed Description

Class for modelling ultrasonic sensors.

Constructor & Destructor Documentation

◆ UltrasonicSensor()

bitrl::sensors::UltrasonicSensor::UltrasonicSensor ( std::shared_ptr< bitrl::sensors::backends::RangeSensorBackendBase backend,
const std::string  name = bitrl::consts::INVALID_STR 
)
inlineexplicit

Constructor.

Parameters
backend

Member Function Documentation

◆ backend_type_str()

std::string bitrl::sensors::UltrasonicSensor::backend_type_str ( ) const
inlinevirtual
Returns
An instance of std::string of the backend type. If the implementation does not use a specific backend returns bitrl::consts::INVALID_STR

Implements bitrl::sensors::SensorBase.

◆ init()

void bitrl::sensors::UltrasonicSensor::init ( )
virtual

Initialize the sensor. Set the is is_enabled_ flag to true. and performs any other initializations required by the sensor.

Implements bitrl::sensors::SensorBase.

◆ read_values()

const std::vector< real_t > & bitrl::sensors::UltrasonicSensor::read_values ( )
virtual

Reads the sensor values and updates the values held internally.

Returns
An instance of str::vector<real_t>

Implements bitrl::sensors::SensorBase.

◆ sensor_units()

std::string bitrl::sensors::UltrasonicSensor::sensor_units ( ) const
inlinevirtual
Returns
An instance of std::string indicating the units the sensor is using. If units have not been established this returns bitrl::consts::INVALID_STR

Implements bitrl::sensors::SensorBase.

Member Data Documentation

◆ SENSOR_TYPE

const std::string bitrl::sensors::UltrasonicSensor::SENSOR_TYPE = "UltrasonicSensor"
static

The type of the sensor.


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