A factory class for creating sensors This class instantiates sensor objects based on the sensor type and makes sure they're initialized correctly. More...
#include <SensorFactory.hh>
Public Member Functions | |
SensorFactory () | |
Constructor. | |
~SensorFactory () | |
Destructor. | |
template<typename SensorType > | |
std::unique_ptr< SensorType > | CreateSensor (const sdf::Sensor &_sdf) |
Create a sensor from a SDF DOM object with a known sensor type. | |
template<typename SensorType > | |
std::unique_ptr< SensorType > | CreateSensor (sdf::ElementPtr _sdf) |
Create a sensor from an SDF element with a known sensor type. | |
Detailed Description
A factory class for creating sensors This class instantiates sensor objects based on the sensor type and makes sure they're initialized correctly.
Constructor & Destructor Documentation
◆ SensorFactory()
SensorFactory | ( | ) |
Constructor.
◆ ~SensorFactory()
~SensorFactory | ( | ) |
Destructor.
Member Function Documentation
◆ CreateSensor() [1/2]
|
inline |
Create a sensor from a SDF DOM object with a known sensor type.
This creates sensors by looking at the given SDF DOM object. Sensors created with this API offer an gz-transport interface. If you need a direct C++ interface to the data, you must get the sensor pointer and cast to the correct type.
- See also
- Sensor()
- Parameters
-
[in] _sdf SDF Sensor DOM object.
- Template Parameters
-
SensorType Sensor type
- Returns
- A pointer to the created sensor. Null returned on error.
References std::endl().
Referenced by Manager::CreateSensor().
◆ CreateSensor() [2/2]
|
inline |
Create a sensor from an SDF element with a known sensor type.
- See also
- Sensor()
- Parameters
-
[in] _sdf pointer to the sdf element
- Template Parameters
-
SensorType Sensor type
- Returns
- A pointer to the created sensor. Null returned on error.
References std::endl().
The documentation for this class was generated from the following file: