class
#include <esp/sensor/VisualSensor.h>
VisualSensor
Base classes
- class Sensor
Derived classes
- class CameraSensor
- class CubeMapSensorBase
Constructors, destructors, conversion operators
-
VisualSensor(scene::
SceneNode& node, VisualSensorSpec::ptr spec) explicit
Public functions
-
auto framebufferSize() const -> Magnum::
Vector2i - Return the size of the framebuffer corresponding to the sensor's resolution as a [W, H] Vector2i.
-
auto displayObservation(sim::
Simulator& sim) -> bool override - auto isVisualSensor() const -> bool override
- Return whether or not this Sensor is a VisualSensor.
-
auto depthUnprojection() const -> Corrade::
Containers:: Optional<Magnum:: Vector2> virtual - Returns the parameters needed to unproject depth for the sensor.
- auto hasRenderTarget() const -> bool
- Checks to see if this sensor has a RenderTarget bound or not.
-
void bindRenderTarget(std::
unique_ptr<gfx:: RenderTarget>&& tgt) - Binds the given given RenderTarget to the sensor. The sensor takes ownership of the RenderTarget.
-
auto renderTarget() -> gfx::
RenderTarget& - Returns a reference to the sensors render target.
-
auto drawObservation(sim::
Simulator& sim) -> bool pure virtual - Draw an observation to the frame buffer using simulator's renderer.
- void readObservation(Observation& obs) virtual
- Read the observation that was rendered by the simulator.
-
auto getObservation(sim::
Simulator& sim, Observation& obs) -> bool override - auto getObservationSpace(ObservationSpace& space) -> bool override
- 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.
- void setResolution(int height, int width)
- Sets resolution of Sensor's sensorSpec.
-
void setResolution(const Magnum::
Vector2i& resolution) - auto specification() const -> VisualSensorSpec::ptr
- Return a pointer to this visual sensor's SensorSpec.
-
auto getProjectionMatrix() const -> Mn::
Matrix4 pure virtual - Return this sensor's projection matrix.
-
auto getRenderCamera() const -> gfx::
RenderCamera* virtual - Returns RenderCamera.
- auto getNear() const -> float
- Gets near plane distance.
- auto getFar() const -> float
- Gets far plane distance.
-
auto getFOV() const -> Mn::
Deg - Returns the FOV of this Sensor.
- auto canUseHBAO() const -> bool override
- Return whether or not this Visual Sensor can use the HBAO effect.
Protected types
Protected variables
-
Mn::
Deg hfov_ - field of view
-
std::
unique_ptr<gfx:: RenderTarget> tgt_ - VisualSensorSpec::ptr visualSensorSpec_
Function documentation
bool esp:: sensor:: VisualSensor:: drawObservation(sim:: Simulator& sim) pure virtual
Draw an observation to the frame buffer using simulator's renderer.
Parameters | |
---|---|
sim in | Instance of Simulator class for which the observation needs to be drawn |
Returns | true if success, otherwise false (e.g., frame buffer is not set) |
void esp:: sensor:: VisualSensor:: readObservation(Observation& obs) virtual
Read the observation that was rendered by the simulator.
Parameters | |
---|---|
obs in/out | Instance of Observation class in which the observation will be stored |
bool esp:: sensor:: VisualSensor:: getObservationSpace(ObservationSpace& space) override
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 |