1 #ifndef SENS_SIMULATED_H
2 #define SENS_SIMULATED_H
7 #include <condition_variable>
53 std::vector<std::pair<SENSTimePt, T>>&& data,
79 std::vector<std::pair<SENSTimePt, T>>
_data;
115 bool start()
override;
116 void stop()
override;
122 std::vector<std::pair<SENSTimePt, SENSGps::Location>>&& data,
141 bool start()
override;
142 void stop()
override;
147 std::vector<std::pair<SENSTimePt, SENSOrientation::Quat>>&& data,
168 bool provideIntrinsics =
true)
override;
170 void stop()
override;
177 std::vector<std::pair<SENSTimePt, int>>&& data,
178 std::string videoFileName,
std::chrono::high_resolution_clock::time_point SENSTimePt
typedef void(SL_STDCALL *cbOnImGuiBuild)(SLScene *s
Callback function typedef for ImGui build function.
Implementation of common functionality and members.
virtual ~SENSSimulatedBase()
virtual bool getErrorMsg(std::string &msg)=0
virtual bool isThreadRunning() const =0
indicates if simulation thread is running
void onLatencyProblem(int &counter) override
when feeding camera frames from cv::videocapture updating the frame pos may take ages....
std::string _videoFileName
const SENSCaptureProps & captureProperties() override
Get SENSCaptureProps which contains necessary information about all available camera devices and thei...
void prepareSensorData(const int counter) override
const SENSCameraConfig & start(std::string deviceId, const SENSCameraStreamConfig &streamConfig, bool provideIntrinsics=true) override
SENSSimulatedCamera(StartSimCB startSimCB, SensorSimStoppedCB sensorSimStoppedCB, std::vector< std::pair< SENSTimePt, int >> &&data, std::string videoFileName, SENSCameraConfig cameraConfig, const SENSSimClock &clock)
void stop() override
Stop a started camera device.
void feedSensorData(const int counter) override
feed new sensor data to sensor
void feedSensorData(const int counter) override
feed new sensor data to sensor
SENSSimulatedGps(StartSimCB startSimCB, SensorSimStoppedCB sensorSimStoppedCB, std::vector< std::pair< SENSTimePt, SENSGps::Location >> &&data, const SENSSimClock &clock)
SENSSimulated(const std::string name, StartSimCB startSimCB, SensorSimStoppedCB sensorSimStoppedCB, std::vector< std::pair< SENSTimePt, T >> &&data, const SENSSimClock &clock)
void stopSim()
stop the sensor simulation thread
bool isThreadRunning() const override
indicates if simulation thread is running
bool getErrorMsg(std::string &msg) override
get error msg (valid if function returns true)
std::function< void(void)> SensorSimStoppedCB
std::vector< std::pair< SENSTimePt, T > > _data
virtual void feedSensorData(const int counter)=0
feed new sensor data to sensor
void feedSensor()
thread run routine to feed sensor with data.
virtual void prepareSensorData(const int counter)
void startSim()
start the sensor simulation thread
const SENSSimClock & _clock
std::condition_variable _condVar
SensorSimStoppedCB _sensorSimStoppedCB
std::function< void(void)> StartSimCB
SENSTimePt _commonSimStartTimePt
virtual void onLatencyProblem(int &counter)
special treatment when there is latency (e.g. when feeding camera frames from cv::videocapture updati...
void feedSensorData(const int counter) override
feed new sensor data to sensor
SENSSimulatedOrientation(StartSimCB startSimCB, SensorSimStoppedCB sensorSimStoppedCB, std::vector< std::pair< SENSTimePt, SENSOrientation::Quat >> &&data, const SENSSimClock &clock)
~SENSSimulatedOrientation()