Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
gazebo::CustomSensorPreloader Class Reference

Gazebo system plugin which allows using custom sensors. More...

#include <CustomSensorPreloader.h>

Inheritance diagram for gazebo::CustomSensorPreloader:
Inheritance graph
[legend]

Public Member Functions

 CustomSensorPreloader ()
 
void Init () override
 
void Load (int _argc, char **_argv) override
 
void Reset () override
 
 ~CustomSensorPreloader () override
 

Protected Types

typedef void(* registerFuncType) ()
 Type of the RegisterCustomSensor function generated by GZ_REGISTER_STATIC_SENSOR. More...
 
typedef std::tuple< registerFuncType, std::string, std::string, std::string > registerTuple
 Registration function, type, classname, fullname. More...
 

Protected Member Functions

virtual void DeferredPreloadSensors ()
 We need to register the sensors a little bit later, so we defer the calls to a separate thread. More...
 
virtual void ProcessCustomSensor (const std::string &_type, const std::string &_classname, const std::string &_fullname)
 Store one custom sensor registration function for deferred loading. More...
 

Protected Attributes

std::unique_ptr< std::thread > deferredLoadThread
 This thread performs the deferred preloading. More...
 
std::unordered_set< std::shared_ptr< registerTuple > > sensorsToRegister
 A set of sensors waiting for deferred registration. More...
 

Detailed Description

Gazebo system plugin which allows using custom sensors.

Definition at line 17 of file CustomSensorPreloader.h.

Member Typedef Documentation

◆ registerFuncType

typedef void(* gazebo::CustomSensorPreloader::registerFuncType) ()
protected

Type of the RegisterCustomSensor function generated by GZ_REGISTER_STATIC_SENSOR.

Definition at line 32 of file CustomSensorPreloader.h.

◆ registerTuple

typedef std::tuple<registerFuncType, std::string, std::string, std::string> gazebo::CustomSensorPreloader::registerTuple
protected

Registration function, type, classname, fullname.

Definition at line 49 of file CustomSensorPreloader.h.

Constructor & Destructor Documentation

◆ CustomSensorPreloader()

gazebo::CustomSensorPreloader::CustomSensorPreloader ( )
default

◆ ~CustomSensorPreloader()

gazebo::CustomSensorPreloader::~CustomSensorPreloader ( )
override

Definition at line 20 of file CustomSensorPreloader.cpp.

Member Function Documentation

◆ DeferredPreloadSensors()

void gazebo::CustomSensorPreloader::DeferredPreloadSensors ( )
protectedvirtual

We need to register the sensors a little bit later, so we defer the calls to a separate thread.

Definition at line 108 of file CustomSensorPreloader.cpp.

◆ Init()

void gazebo::CustomSensorPreloader::Init ( )
override

Definition at line 28 of file CustomSensorPreloader.cpp.

◆ Load()

void gazebo::CustomSensorPreloader::Load ( int  _argc,
char **  _argv 
)
override

Definition at line 218 of file CustomSensorPreloader.cpp.

◆ ProcessCustomSensor()

void gazebo::CustomSensorPreloader::ProcessCustomSensor ( const std::string &  _type,
const std::string &  _classname,
const std::string &  _fullname 
)
protectedvirtual

Store one custom sensor registration function for deferred loading.

Parameters
[in]_typeType of the sensor used in SDF to refer to it.
[in]_classnameName of the sensor's implementation class (without namespace).
[in]_fullnameAbsolute path to the dynamic library with the sensor.

Definition at line 152 of file CustomSensorPreloader.cpp.

◆ Reset()

void gazebo::CustomSensorPreloader::Reset ( )
override

Definition at line 224 of file CustomSensorPreloader.cpp.

Member Data Documentation

◆ deferredLoadThread

std::unique_ptr<std::thread> gazebo::CustomSensorPreloader::deferredLoadThread
protected

This thread performs the deferred preloading.

Definition at line 46 of file CustomSensorPreloader.h.

◆ sensorsToRegister

std::unordered_set<std::shared_ptr<registerTuple> > gazebo::CustomSensorPreloader::sensorsToRegister
protected

A set of sensors waiting for deferred registration.

Definition at line 51 of file CustomSensorPreloader.h.


The documentation for this class was generated from the following files:


gazebo_custom_sensor_preloader
Author(s): Martin Pecka
autogenerated on Sun Sep 3 2023 02:35:25