|
| 1 | +#pragma once |
| 2 | + |
| 3 | +#include <spectacularAI/depthai/plugin.hpp> |
| 4 | +#include "types.hpp" |
| 5 | +#include "mapping.hpp" |
| 6 | +#include "output.hpp" |
| 7 | + |
| 8 | +struct ConfigurationWrapper { |
| 9 | + bool useStereo=true; |
| 10 | + bool useSlam=false; |
| 11 | + bool useFeatureTracker=true; |
| 12 | + bool fastVio=false; |
| 13 | + bool useColorStereoCameras=false; |
| 14 | + const char* mapSavePath=""; |
| 15 | + const char* mapLoadPath=""; |
| 16 | + const char* aprilTagPath=""; |
| 17 | + uint32_t accFrequencyHz=500; |
| 18 | + uint32_t gyroFrequencyHz=400; |
| 19 | + int keyframeCandidateEveryNthFrame=6; |
| 20 | + const char* inputResolution="400p"; |
| 21 | + const char* recordingFolder=""; |
| 22 | + bool recordingOnly=false; |
| 23 | + bool fastImu=false; |
| 24 | + bool lowLatency=false; |
| 25 | +}; |
| 26 | + |
| 27 | +struct PipelineWrapper { |
| 28 | + PipelineWrapper( |
| 29 | + std::shared_ptr<spectacularAI::daiPlugin::Pipeline> handle, |
| 30 | + std::shared_ptr<dai::Pipeline> pipeline, |
| 31 | + std::shared_ptr<dai::Device> device) : _handle(handle), _pipeline(pipeline), _device(device) {}; |
| 32 | + const std::shared_ptr<spectacularAI::daiPlugin::Pipeline> getHandle() const { return _handle; } |
| 33 | + const std::shared_ptr<dai::Device> getDevice() const { return _device; } |
| 34 | + |
| 35 | +private: |
| 36 | + const std::shared_ptr<spectacularAI::daiPlugin::Pipeline> _handle; |
| 37 | + const std::shared_ptr<dai::Pipeline> _pipeline; |
| 38 | + const std::shared_ptr<dai::Device> _device; |
| 39 | +}; |
| 40 | + |
| 41 | +extern "C" |
| 42 | +{ |
| 43 | + /** Pipeline API */ |
| 44 | + EXPORT_API PipelineWrapper* sai_depthai_pipeline_build( |
| 45 | + ConfigurationWrapper* configuration, |
| 46 | + const char** internalParameters, |
| 47 | + int internalParametersCount, |
| 48 | + callback_t_mapper_output onMapperOutput); |
| 49 | + EXPORT_API spectacularAI::daiPlugin::Session* sai_depthai_pipeline_start_session(PipelineWrapper* pipelineHandle); |
| 50 | + EXPORT_API void sai_depthai_pipeline_release(PipelineWrapper* pipelineHandle); |
| 51 | + |
| 52 | + /** Session API */ |
| 53 | + EXPORT_API bool sai_depthai_session_has_output(const spectacularAI::daiPlugin::Session* sessionHandle); |
| 54 | + EXPORT_API VioOutputWrapper* sai_depthai_session_get_output(spectacularAI::daiPlugin::Session* sessionHandle); |
| 55 | + EXPORT_API VioOutputWrapper* sai_depthai_session_wait_for_output(spectacularAI::daiPlugin::Session* sessionHandle); |
| 56 | + EXPORT_API void sai_depthai_session_add_trigger( |
| 57 | + spectacularAI::daiPlugin::Session* sessionHandle, |
| 58 | + double t, |
| 59 | + int tag); |
| 60 | + EXPORT_API void sai_depthai_session_add_absolute_pose( |
| 61 | + spectacularAI::daiPlugin::Session* sessionHandle, |
| 62 | + spectacularAI::Pose pose, |
| 63 | + Matrix3dWrapper positionCovariance, |
| 64 | + double orientationVariance); |
| 65 | + EXPORT_API spectacularAI::CameraPose* sai_depthai_session_get_rgb_camera_pose( |
| 66 | + spectacularAI::daiPlugin::Session* sessionHandle, |
| 67 | + const VioOutputWrapper* vioOutputHandle); |
| 68 | + EXPORT_API void sai_depthai_session_release(spectacularAI::daiPlugin::Session* sessionHandle); |
| 69 | +} |
0 commit comments