Base class for modelling range sensors.
More...
#include <range_sensor_backend_base.h>
|
| static std::shared_ptr< RangeSensorBackendBase > | create (const std::string &backend_type) |
| | Create a backend by the name a robot file gives it.
|
|
| std::shared_ptr< chrono::ChBody > | body_ {nullptr} |
| | The body on which the sensor sits.
|
Base class for modelling range sensors.
A range sensor measures the distance to the nearest obstacle in front of it, between min_distance() and max_distance(). Closer than min_distance() it reports min_distance(), and with nothing in range max_distance().
◆ RangeSensorBackendBase()
| bitsim::sensors::backends::RangeSensorBackendBase::RangeSensorBackendBase |
( |
const std::string & | backend_type | ) |
|
|
inlineexplicitprotected |
◆ add_visual_shape()
| void bitsim::sensors::backends::RangeSensorBackendBase::add_visual_shape |
( |
const std::unordered_map< std::string, std::any > & | shape_properties | ) |
|
|
overridevirtual |
Add a visual shape for the sensor in order to be visualized with Irrlicht. Concrete classes may choose not to implement this. In this case the sensor will not be visible.
Implements bitsim::sensors::backends::SensorBackendBase.
◆ clamp_distance()
| real_t bitsim::sensors::backends::RangeSensorBackendBase::clamp_distance |
( |
real_t | distance | ) |
const |
|
protectednoexcept |
◆ create()
| std::shared_ptr< RangeSensorBackendBase > bitsim::sensors::backends::RangeSensorBackendBase::create |
( |
const std::string & | backend_type | ) |
|
|
static |
Create a backend by the name a robot file gives it.
- Parameters
-
| backend_type | SIMULATION (or its old name CHRONO) for a sensor simulated with Chrono, MQTT for a real sensor on a board |
- Exceptions
-
| std::runtime_error | If the type is unknown, or bitsim was built without what the backend needs |
◆ load()
| void bitsim::sensors::backends::RangeSensorBackendBase::load |
( |
const nlohmann::json & | j | ) |
|
|
virtual |
◆ load_from_json()
| void bitsim::sensors::backends::RangeSensorBackendBase::load_from_json |
( |
const std::string & | filename | ) |
|
|
overridevirtual |
◆ max_distance()
| real_t bitsim::sensors::backends::RangeSensorBackendBase::max_distance |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- The maximum distance the range sensor can read
◆ min_distance()
| real_t bitsim::sensors::backends::RangeSensorBackendBase::min_distance |
( |
| ) |
const |
|
inlinenoexcept |
- Returns
- The minimum distance the range sensor can read
◆ sensor_units()
| virtual std::string bitsim::sensors::backends::RangeSensorBackendBase::sensor_units |
( |
| ) |
const |
|
inlinevirtual |
◆ set_max_distance()
| void bitsim::sensors::backends::RangeSensorBackendBase::set_max_distance |
( |
real_t | max_distance | ) |
|
|
inlinenoexcept |
Set the maximum distance the range sensor can read.
- Parameters
-
◆ set_min_distance()
| void bitsim::sensors::backends::RangeSensorBackendBase::set_min_distance |
( |
real_t | min_distance | ) |
|
|
inlinenoexcept |
Set the minimum distance the range sensor can read.
- Parameters
-
◆ set_sensor_units()
| void bitsim::sensors::backends::RangeSensorBackendBase::set_sensor_units |
( |
const std::string & | units | ) |
|
|
inline |
Set the sensor units.
- Parameters
-
| units | The string representing the sensor units |
The documentation for this class was generated from the following files: