esp::sensor::Sensor class

Derived classes

class AudioSensor
class VisualSensor

Constructors, destructors, conversion operators

Sensor(scene::SceneNode& node, SensorSpec::ptr spec) explicit
~Sensor() override

Public functions

auto node() -> scene::SceneNode&
auto node() const -> const scene::SceneNode&
auto object() -> scene::SceneNode&
auto object() const -> const scene::SceneNode&
auto specification() const -> SensorSpec::ptr
Return a pointer to this Sensor's SensorSpec.
auto isVisualSensor() const -> bool virtual
Return whether or not this Sensor is a VisualSensor.
auto canUseHBAO() const -> bool virtual
Return whether or not this Sensor can use the HBAO effect.
void setTransformationFromSpec()
Sets node's position and orientation from Sensor's SensorSpec can be called ONLY when it is attached to a scene node.
auto getObservation(sim::Simulator& sim, Observation& obs) -> bool pure virtual
Draws an observation to the frame buffer using simulator's renderer, then reads the observation to the sensor's memory buffer.
auto getObservationSpace(ObservationSpace& space) -> bool pure virtual
Updates ObservationSpace space with spaceType, shape, and dataType of this sensor. The information in space is later used to resize the sensor's memory buffer if sensor is resized.
auto displayObservation(sim::Simulator& sim) -> bool pure virtual
Display next observation from Simulator on default frame buffer.

Protected variables

SensorSpec::ptr spec_
core::Buffer::ptr buffer_

Function documentation

bool esp::sensor::Sensor::getObservation(sim::Simulator& sim, Observation& obs) pure virtual

Draws an observation to the frame buffer using simulator's renderer, then reads the observation to the sensor's memory buffer.

Parameters
sim in Instance of Simulator class for which the observation needs to be drawn, obs Instance of Observation class in which the observation will be stored
obs
Returns true if success, otherwise false (e.g., failed to draw or read observation)

bool esp::sensor::Sensor::getObservationSpace(ObservationSpace& space) pure virtual

Updates ObservationSpace space with spaceType, shape, and dataType of this sensor. The information in space is later used to resize the sensor's memory buffer if sensor is resized.

Parameters
space in Instance of ObservationSpace class which will be updated with information from this sensor
Returns true if success, otherwise false

bool esp::sensor::Sensor::displayObservation(sim::Simulator& sim) pure virtual

Display next observation from Simulator on default frame buffer.

Parameters
sim in Instance of Simulator class for which the observation needs to be displayed
Returns Whether the display process was successful or not