![]() |
SLProject
4.3.020
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
#include <SENSSimulated.h>
Public Member Functions | |
| virtual | ~SENSSimulated () |
Public Member Functions inherited from SENSSimulatedBase | |
| virtual | ~SENSSimulatedBase () |
Protected Types | |
| using | StartSimCB = std::function< void(void)> |
| using | SensorSimStoppedCB = std::function< void(void)> |
Protected Member Functions | |
| SENSSimulated (const std::string name, StartSimCB startSimCB, SensorSimStoppedCB sensorSimStoppedCB, std::vector< std::pair< SENSTimePt, T >> &&data, const SENSSimClock &clock) | |
| void | startSim () |
| start the sensor simulation thread More... | |
| void | stopSim () |
| stop the sensor simulation thread More... | |
| bool | getErrorMsg (std::string &msg) override |
| get error msg (valid if function returns true) More... | |
| bool | isThreadRunning () const override |
| indicates if simulation thread is running More... | |
| virtual void | feedSensorData (const int counter)=0 |
| feed new sensor data to sensor More... | |
| virtual void | prepareSensorData (const int counter) |
| virtual void | onLatencyProblem (int &counter) |
| special treatment when there is latency (e.g. when feeding camera frames from cv::videocapture updating the frame pos may take ages) More... | |
Protected Attributes | |
| std::vector< std::pair< SENSTimePt, T > > | _data |
| SensorSimStoppedCB | _sensorSimStoppedCB |
| StartSimCB | _startSimCB |
| std::thread | _thread |
| std::condition_variable | _condVar |
| std::mutex | _mutex |
| bool | _stop = false |
| SENSTimePt | _commonSimStartTimePt |
| bool | _threadIsRunning = false |
| const SENSSimClock & | _clock |
| std::string | _name |
| std::mutex | _msgMutex |
| std::string | _errorMsg |
Private Member Functions | |
| void | feedSensor () |
| thread run routine to feed sensor with data. More... | |
SENSSimulated Implements the sensor simulation backend. SENSSimulated runs a thread (see feedSensor()) that calls feedSensorData() interface function which feeds the next data value to a sensor (e.g. SENSGps). The current simulation time is retrieved from the SENSSimulator clock and depending on this the next data value is selected and fed a the respective time. This class contains common functionality for SENSSimulated implementations.
Definition at line 39 of file SENSSimulated.h.
|
protected |
Definition at line 46 of file SENSSimulated.h.
|
protected |
Definition at line 45 of file SENSSimulated.h.
|
inlinevirtual |
Definition at line 42 of file SENSSimulated.h.
|
protected |
Transfer callbacks to SENSSimulator during construction. The SENSSimulator is informed by these if the SENSSimulated state changes (start, stop). We use callbacks to avoid circular dependencies.
Definition at line 6 of file SENSSimulated.cpp.
|
private |
thread run routine to feed sensor with data.
Definition at line 60 of file SENSSimulated.cpp.
|
protectedpure virtual |
feed new sensor data to sensor
Implemented in SENSSimulatedCamera, SENSSimulatedOrientation, and SENSSimulatedGps.
|
overrideprotectedvirtual |
get error msg (valid if function returns true)
Implements SENSSimulatedBase.
Definition at line 47 of file SENSSimulated.cpp.
|
inlineoverrideprotectedvirtual |
indicates if simulation thread is running
Implements SENSSimulatedBase.
Definition at line 64 of file SENSSimulated.h.
|
inlineprotectedvirtual |
special treatment when there is latency (e.g. when feeding camera frames from cv::videocapture updating the frame pos may take ages)
Reimplemented in SENSSimulatedCamera.
Definition at line 72 of file SENSSimulated.h.
|
inlineprotectedvirtual |
prepare things that may take some time for the next writing of sensor data (e.g. for video reading we can already read the frame and do decoding and maybe it also blocks for some reasons..)
Reimplemented in SENSSimulatedCamera.
Definition at line 70 of file SENSSimulated.h.
|
protected |
start the sensor simulation thread
Definition at line 20 of file SENSSimulated.cpp.
|
protected |
|
protected |
Definition at line 94 of file SENSSimulated.h.
|
protected |
Definition at line 90 of file SENSSimulated.h.
|
protected |
Definition at line 86 of file SENSSimulated.h.
|
protected |
Definition at line 79 of file SENSSimulated.h.
|
protected |
Definition at line 99 of file SENSSimulated.h.
|
protected |
Definition at line 98 of file SENSSimulated.h.
|
protected |
Definition at line 87 of file SENSSimulated.h.
|
protected |
Definition at line 96 of file SENSSimulated.h.
|
protected |
Definition at line 82 of file SENSSimulated.h.
|
protected |
Definition at line 83 of file SENSSimulated.h.
|
protected |
Definition at line 88 of file SENSSimulated.h.
|
protected |
Definition at line 85 of file SENSSimulated.h.
|
protected |
Definition at line 92 of file SENSSimulated.h.