A filter that, when applied to a sensor, creates a GUI window to visualize the sensor (using GLFW).

This visualizes data as an image. Will only work on data that can be interpreted as image data.

#include <ChFilterVisualize.h>

Inheritance diagram for chrono::sensor::ChFilterVisualize:
Collaboration diagram for chrono::sensor::ChFilterVisualize:


struct  DestroyglfwWin
 Helper to allow GLFWwindow to be in a unique_ptr. More...

Public Member Functions

 ChFilterVisualize (int w, int h, std::string name="ChFilterVisualize", bool fullscreen=false)
 Class constructor. More...
virtual ~ChFilterVisualize ()
 Class destructor.
virtual void Apply ()
 Apply function. Visualizes data as an image.
virtual void Initialize (std::shared_ptr< ChSensor > pSensor, std::shared_ptr< SensorBuffer > &bufferInOut)
 Initializes all data needed by the filter access apply function. More...
- Public Member Functions inherited from chrono::sensor::ChFilter
virtual ~ChFilter ()
 Virtual class desctructor.
std::string & Name ()
 Accesses the name of the filter. More...

Protected Member Functions

void CreateGlfwWindow (std::string m_name)
 Creates a GLFW window for this filter.
- Protected Member Functions inherited from chrono::sensor::ChFilter
 ChFilter (std::string name)
 protected constructor for the filter which requires a name as input. More...
void InvalidFilterGraphNullBuffer (std::shared_ptr< ChSensor > pSensor)
 Error function for invalid filter graph: null buffer found.
void InvalidFilterGraphBufferTypeMismatch (std::shared_ptr< ChSensor > pSensor)
 Error function for invalid filter graph: type mismatch in graph.
void InvalidFilterGraphSensorTypeMismatch (std::shared_ptr< ChSensor > pSensor)
 Error function for invalid filter graph: type mismatch in graph.

Static Protected Member Functions

static void OnNewWindow ()
 Helper function for when new window is created.
static void OnCloseWindow ()
 Helper function for when window is closed.

Protected Attributes

std::shared_ptr< SensorDeviceR8Bufferm_bufferR8
std::shared_ptr< SensorDeviceRGBA8Bufferm_bufferRGBA8
std::shared_ptr< SensorDeviceSemanticBufferm_bufferSemantic
std::shared_ptr< SensorDeviceDIBufferm_bufferDI
std::shared_ptr< SensorDeviceRadarBufferm_bufferRadar
std::shared_ptr< SensorHostR8Bufferm_hostR8
std::shared_ptr< SensorHostRGBA8Bufferm_hostRGBA8
std::shared_ptr< SensorHostSemanticBufferm_hostSemantic
std::shared_ptr< SensorHostDIBufferm_hostDI
std::shared_ptr< SensorHostRadarBufferm_hostRadar
CUstream m_cuda_stream
 reference to the cuda stream
std::unique_ptr< GLFWwindow, DestroyglfwWinm_window
 pointer to the window
unsigned int m_gl_tex_id = 0
 reference data for the GL context and texture
bool m_window_disabled = false
 for checking if window is not allowed on sysmtem (e.g. headless rendering)
int m_w
 width of the window
int m_h
 height of the window
bool m_fullscreen
 toggle for fullscreen mode

Static Protected Attributes

static int s_windowCount = 0
 keeps track of the window count
static std::mutex s_glfwMutex
 mutex to prevent us making two windows at the exact same time

Constructor & Destructor Documentation

◆ ChFilterVisualize()

CH_SENSOR_API chrono::sensor::ChFilterVisualize::ChFilterVisualize ( int  w,
int  h,
std::string  name = "ChFilterVisualize",
bool  fullscreen = false 

Class constructor.

wWidth of the window to create
hHeight of the window to create
nameString name of the filter
fullscreenwhether the window should be spawned in full screen mode

Member Function Documentation

◆ Initialize()

CH_SENSOR_API void chrono::sensor::ChFilterVisualize::Initialize ( std::shared_ptr< ChSensor pSensor,
std::shared_ptr< SensorBuffer > &  bufferInOut 

Initializes all data needed by the filter access apply function.

pSensorA pointer to the sensor on which the filter is attached.
bufferInOutA buffer that is passed into the filter.

Implements chrono::sensor::ChFilter.

Reimplemented in chrono::sensor::ChFilterVisualizePointCloud.

The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono_sensor/filters/ChFilterVisualize.h
  • /builds/uwsbel/chrono/src/chrono_sensor/filters/ChFilterVisualize.cpp