1#ifndef BITSIM_SENSORS_ULTRASONIC_SENSOR_H
2#define BITSIM_SENSORS_ULTRASONIC_SENSOR_H
32 static std::shared_ptr<UltrasonicSensor>
create(
const std::string &backend_type,
33 const std::string &name);
41 std::shared_ptr<bitsim::sensors::backends::RangeSensorBackendBase> backend,
68 virtual std::shared_ptr<backends::SensorBackendBase>
backend_ptr()
const override
76 std::shared_ptr<backends::RangeSensorBackendBase>
range_backend() const noexcept
90 std::shared_ptr<bitsim::sensors::backends::RangeSensorBackendBase> backend_;
94 std::shared_ptr<bitsim::sensors::backends::RangeSensorBackendBase> backend,
95 const std::string name)
102 return backend_->backend_type_str();
The basic types of bitsim. Code outside this file names Eigen's matrix and vector types only through ...
std::vector< real_t > values_
The values last read by the sensor.
Definition sensor_base.h:110
SensorBase(const std::string &sensor_type, const std::string &sensor_name=bitsim::consts::INVALID_STR)
Definition sensor_base.h:134
real_t distance() const
Definition ultrasonic_sensor.h:84
UltrasonicSensor(std::shared_ptr< bitsim::sensors::backends::RangeSensorBackendBase > backend, const std::string name=bitsim::consts::INVALID_STR)
Constructor.
Definition ultrasonic_sensor.h:93
virtual void init()
Initialize the sensor. Set the is is_enabled_ flag to true. and performs any other initializations re...
Definition ultrasonic_sensor.cpp:26
virtual const std::vector< real_t > & read_values()
Reads the sensor values and updates the values held internally.
Definition ultrasonic_sensor.cpp:33
virtual std::string backend_type_str() const
Definition ultrasonic_sensor.h:100
virtual std::string sensor_units() const
Definition ultrasonic_sensor.h:105
virtual std::shared_ptr< backends::SensorBackendBase > backend_ptr() const override
Definition ultrasonic_sensor.h:68
std::shared_ptr< backends::RangeSensorBackendBase > range_backend() const noexcept
Definition ultrasonic_sensor.h:76
static std::shared_ptr< UltrasonicSensor > create(const std::string &backend_type, const std::string &name)
Definition ultrasonic_sensor.cpp:19
static const std::string SENSOR_TYPE
The type of the sensor.
Definition ultrasonic_sensor.h:26
const std::string INVALID_STR
Invalid string.
Definition bitsim_consts.h:21
Definition infrared_line_follower.h:9
Definition dc_motor_backend_base.h:9
double real_t
real_t
Definition bitsim_types.h:20