xvsdk  3.2.0
xv-sdk.h
1 #pragma once
2 
3 #include <map>
4 #include <functional>
5 #if defined( __ANDROID__ )
6 #include "jni.h"
7 #endif
8 #include "xv-types.h"
9 
10 namespace xv {
11 
12 class Device;
13 
14 
18 template <typename T>
19 class Stream {
20 public:
21 
22  using Data = T;
23 
27  virtual bool start() = 0;
31  virtual bool stop() = 0;
32 
36  virtual int registerCallback(std::function<void (T)>) = 0;
40  virtual bool unregisterCallback(int callbackId) = 0;
41 
42 };
43 
47 class Camera {
48 public:
49 
55  virtual const std::vector<Calibration>& calibration();
56 
57  // TODO add more settings like AWB in later release
58  virtual bool setResolution( int resolution );
59  virtual bool setFramerate( float framerate );
60  // aecMode 0:auto 1:manual
67  virtual bool setExposure( int aecMode = 0, int exposureGain = 0, float exposureTimeMs = 0.0 );
68 
73  virtual bool setBrightness( int brightness );
74 
75  virtual ~Camera(){}
76 };
77 
81 class ImuSensor : virtual public Stream<Imu const &> {
82 public:
83 
84  virtual ~ImuSensor(){}
85 };
86 
128 class EventStream : virtual public Stream<Event const &> {
129 public:
130 
131  virtual ~EventStream(){}
132 };
133 
137 class OrientationStream : virtual public Stream<Orientation const &> {
138 public:
139 
149  virtual bool get(Orientation& pose, double prediction = 0.) = 0;
150 
160  virtual bool getAt(Orientation& pose, double timestamp) = 0;
161  virtual ~OrientationStream(){}
162 };
163 
169 class FisheyeCameras : virtual public Stream<FisheyeImages const &>, virtual public Camera {
170 public:
171  virtual int registerAntiDistortionCallback(std::function<void (FisheyeImages const &)> cb ) = 0;
172  virtual bool unregisterAntiDistortionCallback( int callbackID ) = 0;
173 
174  virtual bool checkAntiDistortionSupport() = 0;
175 
176  virtual ~FisheyeCameras(){}
177 };
178 
182 class Display {
183 public:
184 
190  virtual const std::vector<Calibration>& calibration() = 0;
191 
195  virtual bool open() = 0;
196 
200  virtual bool close() = 0;
201 
207  virtual bool setBrightnessLevel( int level ) = 0;
208 };
209 
213 class ColorCamera : virtual public Stream<ColorImage const &>, virtual public Camera {
214 public:
215  enum class Resolution {
216  RGB_1920x1080 = 0,
217  RGB_1280x720 = 1,
218  RGB_640x480 = 2,
219  RGB_320x240 = 3,
220  RGB_2560x1920 = 4,
221  RGB_3840x2160 = 5,
222  };
223 
224  enum class Mode {
225  AF,
226  MF,
227  Unknown
228  };
229 
230  virtual bool setCompensation(int compensation) = 0;
231  virtual bool setAwb(int awb) = 0;
232  virtual bool setResolution( const Resolution &resolution ) = 0;
233  virtual bool isSupportAFRGB() = 0;
234  virtual bool setRGBMode(const Mode &mode) = 0;
235  virtual bool setRGBFocalDistance(unsigned char distance) = 0;
236  virtual bool startCameras(int camIndex = 1) = 0;
237  virtual bool stopCameras(int camIndex = 1) = 0;
238  virtual bool setCamsResolution(const xv::ColorCamera::Resolution & resolution, int camIndex = 1) = 0;
239  virtual bool setCamsFramerate(float framerate, int camIndex = 1) = 0;
240  virtual int registerCam2Callback(std::function<void (ColorImage const &)> c ) = 0;
241  virtual bool unregisterCam2Callback( int callbackID ) = 0;
242  virtual const std::vector<Calibration>& calibration2() = 0;
243  virtual bool checkCam2Support() = 0;
244 
245  virtual ~ColorCamera(){}
246 };
247 
251 class TofCamera : virtual public Stream<DepthImage const &>, virtual public Camera {
252 public:
253  enum class StreamMode { DepthOnly = 0, CloudOnly, DepthAndCloud, None, CloudOnLeftHandSlam};
254  enum class DistanceMode { Short = 0, Middle, Long };
255  enum class SonyTofLibMode { IQMIX_DF ,IQMIX_SF, LABELIZE_DF ,LABELIZE_SF ,M2MIX_DF ,M2MIX_SF };
256  enum class Framerate{ FPS_5 ,FPS_10 ,FPS_15 ,FPS_20 ,FPS_25 ,FPS_30 };
257  enum class Resolution{ Unknown = -1,VGA = 0 ,QVGA ,HQVGA};
258  enum class Manufacturer {Unknown = -1, Pmd = 0, Sony};
259  enum class ColorDepthBase { RGB = 0, TOF = 1 };
260 
261  virtual bool setColorDepthBase(ColorDepthBase base) = 0;
262  virtual ColorDepthBase getColoerDepthBase() = 0;
266  virtual int registerColorDepthImageCallback(std::function<void(const DepthColorImage&)>) = 0;
267  virtual bool unregisterColorDepthImageCallback(int callbackId) = 0;
268 
274  virtual std::shared_ptr<PointCloud> depthImageToPointCloud(DepthImage const &) const = 0;
275 
280  virtual std::shared_ptr<PointCloud> formatPmdCloudToPointCloudStruct(DepthImage const &) const = 0;
281 
285  virtual bool setStreamMode(StreamMode mode) = 0;
286 
297  virtual bool setDistanceMode(DistanceMode mode) = 0;
298 
303  virtual Resolution getResolution() = 0;
304 
309  virtual Manufacturer getManufacturer() = 0;
310 
321  virtual bool setLibWorkMode(SonyTofLibMode mode) = 0;
322 
326  virtual bool enableTofIr(bool enable) = 0;
327 
331  virtual bool setMode(int mode) = 0;
332 
336  virtual bool setSonyTofSetting(SonyTofLibMode mode, Resolution resolution, Framerate frameRate) = 0;
337 
338  virtual void setTofIrGamma(double gamma) = 0;
339 
343  virtual void setFilterFile(std::string filePath) = 0;
344 
345  virtual ~TofCamera() {}
346 };
347 
353 class Slam : virtual public Stream<Pose const&> {
354 
355 public:
356  enum class Mode { Edge = 0, Mixed, EdgeFusionOnHost };
357 
362  virtual Mode mode() const = 0;
363 
367  virtual bool start() override = 0;
368 
374  virtual bool start(Mode mode) = 0;
375 
380  virtual bool reset() = 0;
381 
386  virtual bool pause() = 0;
387 
392  virtual bool resume() = 0;
393 
404  virtual bool getPose(Pose& pose, double prediction = 0.) = 0;
405 
416  virtual bool getPoseAt(Pose& pose, double timestamp) = 0;
417 
422  virtual int registerVisualPoseCallback(std::function<void (const Pose&)> lostCallback) = 0;
423  virtual bool unregisterVisualPoseCallback(int callbackId) = 0;
424  #define XVSDK_HAS_SLAM_VISUAL_POSE_CALLBACK
425 
430  virtual int registerLostCallback(std::function<void ()> lostCallback) = 0;
431  virtual bool unregisterLostCallback(int callbackId) = 0;
432 
440  virtual int registerStereoPlanesCallback(std::function<void (std::shared_ptr<const std::vector<Plane>>)> planeCallback) = 0;
441  virtual bool unregisterStereoPlanesCallback(int callbackId) = 0;
442  virtual bool clearStereoPlanes() = 0;
443 
457  virtual int registerTofPlanesCallback(std::function<void (std::shared_ptr<const std::vector<Plane>>)> planeCallback) = 0;
458  virtual bool unregisterTofPlanesCallback(int callbackId) = 0;
459  virtual bool clearTofPlanes() = 0;
460 
461 
466  virtual int registerMapCallback(std::function<void (std::shared_ptr<const xv::SlamMap>)> mapCallback) = 0;
467  virtual bool unregisterMapCallback(int callbackId) = 0;
468 
479  virtual bool loadMapAndSwitchToCslam(std::streambuf& mapStream, std::function<void(int /* status of load map */)> done_callback, std::function<void(float)> localized_on_reference_map={}) = 0;
490  virtual bool saveMapAndSwitchToCslam(std::streambuf& mapStream, std::function<void(int /* status of save map */, int /* map quality */)> done_callback, std::function<void(float)> localized_on_reference_map={}) = 0;
491 
498  virtual Pose poseScaleCalibration(const Pose& pose) = 0;
499 
503  virtual void poseReset() = 0;
504 
505  virtual int registerSharedMapCallback(std::function<void (std::vector<uint8_t> const&)> cb) = 0;
506 
507  virtual bool unregisterSharedMapCallback(int callbackId) = 0;
508 
509  virtual const std::vector<uint8_t>& getFirstSharedMap() = 0;
510 
511  virtual ~Slam() {}
512 };
513 
517 class ObjectDetector : virtual public Stream<std::vector<Object> const&> {
518 public:
519  enum class Source { LEFT = 0, RIGHT, RGB, TOF };
520 
521  virtual bool setDescriptor( const std::string &filepath ) = 0;
522  virtual bool setModel( const std::string &filepath ) = 0;
523  virtual bool setSource( const Source &source ) = 0;
524  virtual xv::ObjectDetector::Source getSource() const = 0;
525  virtual xv::ObjectDescriptor getDescriptor() const = 0;
526 
527  virtual int registerCnnRawCallback(std::function<void (std::shared_ptr<CnnRawWrapper> const&)> poseCallback) = 0;
528  virtual bool unregisterCnnRawCallback(int callbackId) = 0;
529 
530  virtual ~ObjectDetector() {}
531 };
532 
536 class ObjectDetectorRKNN3588 : virtual public Stream<std::vector<Det2dObject> const&> {
537 public:
538  virtual bool setModel( const std::string &filepath ) = 0;
539  virtual ~ObjectDetectorRKNN3588() {}
540 };
541 
545 class SgbmCamera : virtual public Stream<SgbmImage const &>, virtual public Camera {
546 public:
547  enum class Resolution {
548  SGBM_640x480 = 0,
549  SGBM_1280x720 = 1,
550  };
551  enum class Mode { Hardware = 0, Software };
555  virtual Mode mode() const = 0;
556 
557  virtual bool start(const std::string &sgbmConfig) = 0;
558  virtual bool start(const sgbm_config &sgbmConfig) = 0;
559  virtual bool setConfig(const std::string &sgbmConfig) = 0;
560  virtual bool setSgbmResolution(const xv::SgbmCamera::Resolution & resolution) = 0;
561  virtual xv::SgbmCamera::Resolution getSgbmResolution() = 0;
570  virtual std::shared_ptr<PointCloud> depthImageToPointCloud(SgbmImage const &sgbmImage) const = 0;
571  virtual ~SgbmCamera() {}
572 };
573 
577 class ThermalCamera : virtual public Stream<ThermalImage const &>, virtual public Camera {
578 public:
579 
580  enum class Mode { TEMPERATURE = 0, TEMPERTURE = 0, GREY };
581  virtual bool setMode( Mode mode ) = 0;
582  virtual ~ThermalCamera() {}
583 };
584 
588 class EyetrackingCamera : virtual public Stream<EyetrackingImage const &>, virtual public Camera {
589 public:
590 
599  virtual bool setExposure( int leftGain, float leftTimeMs, int rightGain, float rightTimeMs ) = 0;
600 
608  virtual bool setLedBrighness( int eye, int led, int brightness ) = 0;
609 
610  virtual ~EyetrackingCamera() {}
611 };
612 
613 class BeiDouGPS : virtual public Stream<BeiDouGPSData const &>
614 {
615 public:
616  virtual bool setMode(BeiDouGPSMode mode) = 0;
617  virtual ~BeiDouGPS(){};
618 };
619 
620 
624 class GazeStream : virtual public Stream<XV_ET_EYE_DATA_EX const &>{
625 public:
626 
632  virtual void setConfigPath(std::string config) = 0;
633 
637  virtual void setUsrEyeReady() = 0;
638 
642  virtual void setGazeConfigs(GazeConfigs configs) = 0;
643 
647  virtual bool getGazeStatus() = 0;
648 
652  virtual void enableDump(bool enable) = 0;
653 
654  virtual ~GazeStream() {}
655 };
656 
660 class IrisStream : virtual public Stream<XV_IRIS_DATA const &>{
661 public:
662 
663 #if defined( __ANDROID__ )
664  virtual bool start(JNIEnv* env, jobject thiz, std::string offlineS) = 0;
665 
666  virtual const char* onlineActive(JNIEnv *env, jobject context, const char* initLicense, const char* userId, const char* secret, int &activeResult) = 0;
667 #endif
673  virtual void setUserName(std::string name) = 0;
674 
680  virtual int registerEnrollCallback(std::function<void (XV_IRIS_DATA const &)>) = 0;
681  virtual bool UnregisterEnrollCallback(int callbackID) = 0;
682 
688  virtual int registerIdentifyCallback(std::function<void (XV_IRIS_DATA const &)>) = 0;
689  virtual bool UnregisterIdentifyCallback(int callbackID) = 0;
690 
696  virtual bool loadIrisInfo(unsigned char* iris_features, int size) = 0;
697 
703  virtual void setConfigPath(std::string config) = 0;
704 
705  virtual ~IrisStream() {}
706 };
707 
711 class GestureStream : virtual public Stream<GestureData const &> {
712 public:
713 
719  virtual int registerDynamicGestureCallback(std::function<void (GestureData const &)>) = 0;
720  virtual bool UnregisterDynamicGestureCallback(int callbackID) = 0;
721 
729  virtual int registerKeypointsCallback(std::function<void (std::shared_ptr<const std::vector<keypoint>>)> callback) = 0;
730  virtual bool unregisterKeypointsCallback(int callbackId) = 0;
731 
739  virtual int registerSlamKeypointsCallback(std::function<void (std::shared_ptr<const xv::HandPose>)> callback) = 0;
740  virtual bool unregisterSlamKeypointsCallback(int callbackId) = 0;
741 
742  virtual ~GestureStream() {}
743 
744  virtual bool setPlatform( int platform , bool ego) = 0;
745 };
746 
750 class GPSStream : virtual public Stream<std::vector<unsigned char> const &>{
751 public:
752  virtual ~GPSStream() {}
753 };
754 
758 class GPSDistanceStream : virtual public Stream<GPSDistanceData const &>{
759 public:
760 
761  virtual ~GPSDistanceStream() {}
762 };
763 
767 class TerrestrialMagnetismStream : virtual public Stream<TerrestrialMagnetismData const &>{
768 public:
769 
770  virtual ~TerrestrialMagnetismStream() {}
771 };
772 
776 class ExternalStream : virtual public Stream<xv::Pose const &>{
777 public:
778 
779  virtual int registerRawCallback( std::function<void (xv::ExternalData const &)> rawExternalCallback) = 0;
780  virtual bool unregisterRawCallback( int callbackId ) = 0;
781 
782  virtual int registerFixedPoseCallback( std::function<void (xv::Pose const &)> fixedExternalCallback) = 0;
783  virtual bool unregisterFixedPoseCallback( int callbackId ) = 0;
784 
785  virtual int registerRuntimePoseCallback( std::function<void (xv::Pose const&)> runtimeExternalCallback) = 0;
786  virtual bool unregisterRuntimePoseCallback(int callbackId) = 0;
787 
788  virtual int registerScaledPoseCallback( std::function<void (xv::Pose const&)> scaledExternalCallback) = 0;
789  virtual bool unregisterScaledPoseCallback(int callbackId) = 0;
790 
791  virtual bool getPose(Pose& pose) = 0;
792 
793  virtual void SetScaleArrayRange(int range) = 0;
794  virtual void setScaleRange(double low, double high) = 0;
795 
796  virtual Vector3d rotationToEuler(Matrix3d const& rot) = 0;
797 
798  virtual void setResetStatus(bool status) = 0;
799  virtual void setDeviceStopStatus(bool status) = 0;
800 
801  virtual void setTransform(const xv::Transform& transform) = 0;
802 
803  virtual void resumeLastPose(xv::Pose pose) = 0;
804 
805  virtual ~ExternalStream() {}
806 };
807 
811 class MicStream : virtual public Stream<MicData const &> {
812 public:
813 
814  virtual ~MicStream() {}
815 };
816 
820 class Speaker {
821 public:
822 
823  virtual bool enable() = 0;
824  virtual bool disable() = 0;
828  virtual int send(const std::uint8_t *data, int len) = 0;
829 
833  virtual bool play(const std::string &path) = 0;
837  virtual bool play(const std::uint8_t *data, int len) = 0;
841  virtual bool isPlaying() = 0;
845  virtual int registerPlayEndCallback( std::function<void ()> ) = 0;
846  virtual bool unregisterPlayEndCallback( int callbackId ) = 0;
847 
848  virtual ~Speaker() {}
849 };
850 
1177 class DeviceStatusStream : virtual public Stream<std::vector<unsigned char> const &> {
1178 public:
1179 
1180  virtual ~DeviceStatusStream(){}
1181 };
1182 
1184 {
1185 public:
1186  WirelessController(){}
1187 
1188  virtual ~WirelessController(){}
1189 
1190  virtual void start() = 0;
1191 
1192  virtual void stop() = 0;
1193 
1194  virtual int registerWirelessControllerDataCallback(std::function<void (const WirelessControllerData&)> poseCallback) = 0;
1195 
1196  virtual bool unregisterWirelessControllerDataCallback( int callbackID ) = 0;
1197 
1198  virtual void scanBleDevices(std::function<void(std::map<std::string,std::string>)> scanCallback) = 0;
1199 
1200  virtual bool connectBleDevice(const std::string& name, const std::string& macAddr) = 0;
1201 
1202  virtual bool disconnectBleDevice(const std::string& name, const std::string& macAddr) = 0;
1203 
1204  virtual bool pairingLeftWirelessController(const std::string& name, const std::string&macAddr) = 0;
1205 
1206  virtual void pairingLeftWirelessController(std::function<void (bool result)> resultCallback) = 0;
1207 
1208  virtual bool pairingRightWirelessController(const std::string& name, const std::string&macAddr) = 0;
1209 
1210  virtual void pairingRightWirelessController(std::function<void (bool result)> resultCallback) = 0;
1211 
1212  virtual void setSerialPointName(const std::string& serialName) = 0;
1213 
1214  virtual bool uploadMap(const std::string& mapName, WirelessControllerDataType type,std::function<void (bool)> const &callback) = 0;
1215 
1216  virtual void controlTest(bool enable, const WirelessControllerDataType& type, std::function<void (float, WirelessControllerDataType)> const &callback = nullptr) = 0;
1217 
1218  virtual void putSharedMap(const std::vector<uint8_t>& buffer) = 0;
1219 
1220  virtual void putFirstSharedMap(const std::vector<uint8_t>& buffer) = 0;
1221 
1222  virtual bool changeSlamType(const WirelessControllerSlamType slamType, const WirelessControllerDataType deviceType) = 0;
1223 
1224  virtual void enableHeartBeat(bool enable) = 0;
1225 
1226  virtual bool registerSlam(const std::shared_ptr<Slam>& slam) = 0;
1227 
1228  virtual WirelessControllerSlamType getSlamType(const WirelessControllerDataType deviceType) = 0;
1229 
1230  virtual int registerWirelessControllerStateCallback(std::function<void (const WirelessControllerState &state)> callback) = 0;
1231 
1232  virtual bool unregisterWirelessControllerStateCallback( int callbackID ) = 0;
1233 
1234  virtual int testTransmissionTime(WirelessControllerDataType type) = 0;
1235 
1236  virtual void getWirelessControllerDeviceInformation(WirelessControllerDeviceInformation& information, const WirelessControllerDataType& deviceType) = 0;
1237 
1238  virtual void controlControllerVibration(int time, bool enable, const WirelessControllerDataType& deviceType) = 0;
1239 };
1240 
1258 class Device {
1259 
1260 public:
1261 
1262 
1267  virtual std::map<std::string, std::string> info() = 0;
1268 
1272  virtual std::shared_ptr<Slam> slam() = 0;
1273 
1277  virtual std::shared_ptr<ImuSensor> imuSensor() = 0;
1278 
1282  virtual std::shared_ptr<EventStream> eventStream() = 0;
1283 
1287  virtual std::shared_ptr<OrientationStream> orientationStream() = 0;
1288 
1292  virtual std::shared_ptr<FisheyeCameras> fisheyeCameras() = 0;
1293 
1297  virtual std::shared_ptr<ColorCamera> colorCamera() = 0;
1298 
1302  virtual std::shared_ptr<TofCamera> tofCamera() = 0;
1303 
1307  virtual std::shared_ptr<SgbmCamera> sgbmCamera() = 0;
1308 
1312  virtual std::shared_ptr<ThermalCamera> thermalCamera() = 0;
1313 
1317  virtual std::shared_ptr<EyetrackingCamera> eyetracking() = 0;
1318 
1322  virtual std::shared_ptr<GazeStream> gaze() = 0;
1323 
1327  virtual std::shared_ptr<IrisStream> iris() = 0;
1328 
1332  virtual std::shared_ptr<GestureStream> gesture() = 0;
1333 
1337  virtual std::shared_ptr<GPSStream> gpsModule() = 0;
1338 
1342  virtual std::shared_ptr<GPSDistanceStream> gpsDistanceModule() = 0;
1343 
1347  virtual std::shared_ptr<TerrestrialMagnetismStream> terrestrialMagnetismModule() = 0;
1348 
1352  virtual std::shared_ptr<ExternalStream> externalSensor() = 0;
1353 
1357  virtual std::shared_ptr<MicStream> mic() = 0;
1358 
1362  virtual std::shared_ptr<Speaker> speaker() = 0;
1363 
1367  virtual std::shared_ptr<Display> display() = 0;
1368 
1372  virtual std::shared_ptr<ObjectDetector> objectDetector() = 0;
1373 
1377  virtual std::shared_ptr<ObjectDetectorRKNN3588> objectDetectorRKNN3588() = 0;
1378 
1382  virtual std::shared_ptr<DeviceStatusStream> deviceStatus() = 0;
1383 
1387  virtual std::shared_ptr<WirelessController> wirelessController() = 0;
1388 
1389  virtual std::shared_ptr<BeiDouGPS> beiDouGPS() = 0;
1390 
1394  virtual bool sleep(int level = 0) = 0;
1398  virtual bool wakeup() = 0;
1399 
1403  virtual bool control(const DeviceSetting &setting) = 0;
1404 
1818  virtual bool hidWriteAndRead(const std::vector<unsigned char> &command, std::vector<unsigned char> &result) = 0;
1822  virtual bool uvcWriteAndRead(const std::vector<unsigned char> &command, std::vector<unsigned char> &result) = 0;
1826  virtual bool vscWriteAndRead(const std::vector<unsigned char> &command, std::vector<unsigned char> &result) = 0;
1827 
1831  virtual bool enableSync(bool isEnable) = 0;
1832 
1836  virtual std::string id() const = 0;
1837 
1838  virtual ~Device(){}
1839 
1840 };
1841 
1842 
1852 
1861 std::map<std::string,std::shared_ptr<Device>> getDevices(double timeOut = 0., const std::string& desc = "", bool* stopWaiting = nullptr, xv::SlamStartMode slamStartMode = xv::SlamStartMode::Normal, xv::DeviceSupport deviceSupport = xv::DeviceSupport ::ONLYUSB);
1862 
1870 std::map<std::string,std::shared_ptr<Device>> getDevicesUntilTimeout(double timeOut = 0., const std::string& desc = "", xv::SlamStartMode slamStartMode = xv::SlamStartMode::Normal, xv::DeviceSupport deviceSupport = xv::DeviceSupport ::ONLYUSB);
1871 
1875 void setLogLevel(LogLevel l);
1876 
1881 int registerPlugEventCallback(const std::function<void (std::shared_ptr<Device> device, PlugEventType type)> &Callback, const std::string& desc = "");
1885 bool unregisterHotplugCallback( int callbackID );
1886 
1901 std::shared_ptr<Device> getDevice(int fd);
1908 std::shared_ptr<Device> getDevice(int fd, std::string const& desc, xv::SlamStartMode slamStartMode = xv::SlamStartMode::Normal);
1909 
1913 bool detachDevice(int fd );
1914 
1919 
1924 
1936 bool savePointCloudToPcd(const std::string &path, std::shared_ptr<PointCloud> const & point, int precision = 8, bool removeInvalidPoints = true);
1937 
1938 
1939 }
Definition: xv-sdk.h:614
Camera interface.
Definition: xv-sdk.h:47
virtual const std::vector< Calibration > & calibration()
Get the camera calibration.
virtual bool setExposure(int aecMode=0, int exposureGain=0, float exposureTimeMs=0.0)
Exposure setting.
virtual bool setBrightness(int brightness)
Set output image brightness. Only valid in auto exposure mode.
A class to handle callbacks of the color image.
Definition: xv-sdk.h:213
Resolution
Definition: xv-sdk.h:215
@ RGB_320x240
RGB QVGA (not supported now)
@ RGB_2560x1920
RGB 5m (not supported now)
A class to handle device status event stream.
Definition: xv-sdk.h:1177
Class to get tracking results and raw outputs with a connected device.
Definition: xv-sdk.h:1258
virtual std::shared_ptr< Display > display()=0
Get the display component.
virtual std::shared_ptr< EyetrackingCamera > eyetracking()=0
Get the eyetracking component of the device.
virtual std::shared_ptr< ObjectDetector > objectDetector()=0
Get the object detection component.
virtual std::shared_ptr< FisheyeCameras > fisheyeCameras()=0
Get the stereo cameras component of the device.
virtual std::shared_ptr< Speaker > speaker()=0
Get the speaker component of the device.
virtual std::shared_ptr< ObjectDetectorRKNN3588 > objectDetectorRKNN3588()=0
Get the object detection component. in RKNN3588 platform.
virtual bool uvcWriteAndRead(const std::vector< unsigned char > &command, std::vector< unsigned char > &result)=0
Write UVC control command and read result.
virtual bool sleep(int level=0)=0
Let device sleep.
virtual std::shared_ptr< TerrestrialMagnetismStream > terrestrialMagnetismModule()=0
Get the terrestrial magnetism data of the device.
virtual bool control(const DeviceSetting &setting)=0
Control device.
virtual bool vscWriteAndRead(const std::vector< unsigned char > &command, std::vector< unsigned char > &result)=0
Write VSC control command and read result.
virtual std::shared_ptr< GestureStream > gesture()=0
Get the gesture component.
virtual std::map< std::string, std::string > info()=0
Get informations (Serial Number, version ...) about the device.
virtual std::shared_ptr< MicStream > mic()=0
Get the MIC component of the device.
virtual std::shared_ptr< DeviceStatusStream > deviceStatus()=0
Get the device status component.
virtual std::string id() const =0
Return the serial number of the device.
virtual bool wakeup()=0
Wake up device.
virtual std::shared_ptr< Slam > slam()=0
Get the SLAM component.
virtual std::shared_ptr< GPSDistanceStream > gpsDistanceModule()=0
Get the GPS distance data of the device.
virtual std::shared_ptr< ImuSensor > imuSensor()=0
Get the IMU sensor of the device.
virtual std::shared_ptr< OrientationStream > orientationStream()=0
Get the 3dof component.
virtual bool hidWriteAndRead(const std::vector< unsigned char > &command, std::vector< unsigned char > &result)=0
Write HID control command and read result. HID command list:
virtual std::shared_ptr< EventStream > eventStream()=0
Get the event component.
virtual std::shared_ptr< SgbmCamera > sgbmCamera()=0
Get the SGBM component of the device.
virtual std::shared_ptr< IrisStream > iris()=0
Get the iris data of the device.
virtual std::shared_ptr< GPSStream > gpsModule()=0
Get the GPS data of the device.
virtual bool enableSync(bool isEnable)=0
set enable camera synchronize.
virtual std::shared_ptr< WirelessController > wirelessController()=0
Get the device wireless controller.
virtual std::shared_ptr< TofCamera > tofCamera()=0
Get the ToF component of the device.
virtual std::shared_ptr< ColorCamera > colorCamera()=0
Get the color camera component of the device.
virtual std::shared_ptr< ExternalStream > externalSensor()=0
Get the external stream component.
virtual std::shared_ptr< GazeStream > gaze()=0
Get the gaze data of the device.
virtual std::shared_ptr< ThermalCamera > thermalCamera()=0
Get the thermal component of the device.
The class to handle informations about the display (if device can display like a HMD)
Definition: xv-sdk.h:182
virtual bool close()=0
Turn off the display.
virtual const std::vector< Calibration > & calibration()=0
Get calibrations.
virtual bool setBrightnessLevel(int level)=0
Set brightness level.
virtual bool open()=0
Turn on the display.
A class to handle callbacks of events.
Definition: xv-sdk.h:128
A class to handle external stream data. Only support in Arm now.
Definition: xv-sdk.h:776
A class to handle callbacks of the eyetracking camera.
Definition: xv-sdk.h:588
virtual bool setLedBrighness(int eye, int led, int brightness)=0
Set eyetracking led brightness (in s)
virtual bool setExposure(int leftGain, float leftTimeMs, int rightGain, float rightTimeMs)=0
Set eyetracking exposure.
The class to handle callbacks of the multi cameras for the visual SLAM.
Definition: xv-sdk.h:169
A class to handle callbacks of the GPS distance data.
Definition: xv-sdk.h:758
A class to handle callbacks of the GPS data.
Definition: xv-sdk.h:750
A class to handle callbacks of the gaze data.
Definition: xv-sdk.h:624
virtual void enableDump(bool enable)=0
enable dump eyetracking files.
virtual bool getGazeStatus()=0
get gaze status.
virtual void setConfigPath(std::string config)=0
Set coe configuration file path.
virtual void setUsrEyeReady()=0
Set eye ready status for gaze.
virtual void setGazeConfigs(GazeConfigs configs)=0
Set gaze configs.
A class to handle gusture.
Definition: xv-sdk.h:711
virtual int registerDynamicGestureCallback(std::function< void(GestureData const &)>)=0
Callback to get the dynamic gesture information.
virtual int registerSlamKeypointsCallback(std::function< void(std::shared_ptr< const xv::HandPose >)> callback)=0
Callback to get the keypoints 21Dof information based on slam position.
virtual int registerKeypointsCallback(std::function< void(std::shared_ptr< const std::vector< keypoint >>)> callback)=0
Callback to get the keypoints 21Dof information.
The class to give access to data provided by the IMU sensor.
Definition: xv-sdk.h:81
A class to handle callbacks of the Iris data.
Definition: xv-sdk.h:660
virtual bool loadIrisInfo(unsigned char *iris_features, int size)=0
Load the iris features the identify information.
virtual void setUserName(std::string name)=0
Set user name.
virtual void setConfigPath(std::string config)=0
Set coe configuration file path.
virtual int registerEnrollCallback(std::function< void(XV_IRIS_DATA const &)>)=0
Callback to get the enroll information.
virtual int registerIdentifyCallback(std::function< void(XV_IRIS_DATA const &)>)=0
Callback to get the identify information.
A class to handle MIC. Adjust volumn through source.
Definition: xv-sdk.h:811
A class to handle callbacks of the object detector (CNN) in RKNN3588 platform.
Definition: xv-sdk.h:536
A class to handle callbacks of the object detector (CNN)
Definition: xv-sdk.h:517
The class to give access to 3dof data which converted from raw IMU data.
Definition: xv-sdk.h:137
virtual bool getAt(Orientation &pose, double timestamp)=0
Get the orientation of the device at a given timestamp.
virtual bool get(Orientation &pose, double prediction=0.)=0
Get the current orientation of the device.
Orientation only (3dof) of the pose.
Definition: xv-types.h:853
A class to handle callbacks of the SGBM.
Definition: xv-sdk.h:545
virtual Mode mode() const =0
Must be called befor start.
Resolution
Definition: xv-sdk.h:547
virtual std::shared_ptr< PointCloud > depthImageToPointCloud(SgbmImage const &sgbmImage) const =0
convert DepthImage to pointCloud .
The class to represent the component doing the 6dof tracking with SLAM algorithm on host.
Definition: xv-sdk.h:353
virtual bool start(Mode mode)=0
Start slam of specific mode.
virtual int registerStereoPlanesCallback(std::function< void(std::shared_ptr< const std::vector< Plane >>)> planeCallback)=0
Callback to get the detected planes using stereo cameras and SLAM.
virtual bool getPoseAt(Pose &pose, double timestamp)=0
Get the 6dof pose of the device at a given timestamp.
virtual bool resume()=0
Resume the 6dof tracker (SLAM)
virtual int registerMapCallback(std::function< void(std::shared_ptr< const xv::SlamMap >)> mapCallback)=0
Callback to get the SLAM map updates.
virtual bool saveMapAndSwitchToCslam(std::streambuf &mapStream, std::function< void(int, int)> done_callback, std::function< void(float)> localized_on_reference_map={})=0
Save a SLAM map and use it as an immutable reference map.
virtual bool start() override=0
Start slam of current mode.
virtual int registerTofPlanesCallback(std::function< void(std::shared_ptr< const std::vector< Plane >>)> planeCallback)=0
Callback to get the detected planes using ToF camera and SLAM.
virtual Mode mode() const =0
Get #Mode.
virtual bool getPose(Pose &pose, double prediction=0.)=0
Get the current 6dof pose of the device.
virtual bool pause()=0
Pause the 6dof tracker (SLAM)
virtual int registerVisualPoseCallback(std::function< void(const Pose &)> lostCallback)=0
Register a callback called when visual SLAM compute a new unfiltered pose.
virtual Pose poseScaleCalibration(const Pose &pose)=0
slam pose scale calibration.
virtual void poseReset()=0
Reset the 6dof pose coordinate (SLAM)
virtual bool loadMapAndSwitchToCslam(std::streambuf &mapStream, std::function< void(int)> done_callback, std::function< void(float)> localized_on_reference_map={})=0
Load a SLAM map and use it as an immutable reference map.
virtual int registerLostCallback(std::function< void()> lostCallback)=0
Register a callback called when SLAM is lost.
virtual bool reset()=0
Reset the 6dof tracker (SLAM)
A class to handle speaker. Adjust the sound source(PCM) volume to adjust the volume.
Definition: xv-sdk.h:820
virtual bool play(const std::string &path)=0
Async play sound file in new thread.
virtual bool play(const std::uint8_t *data, int len)=0
Async play buffer in new thread.
virtual bool isPlaying()=0
If async playing.
virtual int registerPlayEndCallback(std::function< void()>)=0
Rigster a callback for async play end.
virtual int send(const std::uint8_t *data, int len)=0
Send a small time slice of sound data.
Stream interface.
Definition: xv-sdk.h:19
virtual bool unregisterCallback(int callbackId)=0
Unregister callback.
virtual bool start()=0
start streaming.
virtual int registerCallback(std::function< void(T)>)=0
Register callback to receive data.
virtual bool stop()=0
stop streaming.
A class to handle callbacks of the terrestrial magnetism data.
Definition: xv-sdk.h:767
A class to handle callbacks of the thermal camera.
Definition: xv-sdk.h:577
A class to handle callbacks of the ToF camera.
Definition: xv-sdk.h:251
virtual bool setDistanceMode(DistanceMode mode)=0
Set distance mode.
virtual bool setStreamMode(StreamMode mode)=0
Set which stream will be reported. Not work with sony TOF.
virtual std::shared_ptr< PointCloud > depthImageToPointCloud(DepthImage const &) const =0
Convert a depth image to point cloud for sony TOF.
virtual bool setMode(int mode)=0
Set work mode.
virtual int registerColorDepthImageCallback(std::function< void(const DepthColorImage &)>)=0
Gives access to composed image with RBG color on depth images.
virtual Resolution getResolution()=0
Get current resolution.
virtual Manufacturer getManufacturer()=0
Get tof Manufacturer.
virtual std::shared_ptr< PointCloud > formatPmdCloudToPointCloudStruct(DepthImage const &) const =0
format a depth image to point cloud for pmd TOF(Cloud Only).
virtual bool enableTofIr(bool enable)=0
Enable tof ir.
virtual bool setLibWorkMode(SonyTofLibMode mode)=0
Set lib mode.
virtual bool setSonyTofSetting(SonyTofLibMode mode, Resolution resolution, Framerate frameRate)=0
SonyTof Settings.
virtual void setFilterFile(std::string filePath)=0
set SonyTof filter file
Definition: xv-sdk.h:1184
std::shared_ptr< Device > getDevice(int fd, std::string const &desc, xv::SlamStartMode slamStartMode=xv::SlamStartMode::Normal)
Retrieve #Device by given descriptor. Only for Android.
bool detachDevice(int fd)
Tell sdk device has disconnected. Only for Android.
std::string getDefaultDescription()
Retrieve default device description.
void getUTCTIme(DateTime *utc)
Get UTC time.
bool unregisterHotplugCallback(int callbackID)
Unregister a plug callback.
int registerPlugEventCallback(const std::function< void(std::shared_ptr< Device > device, PlugEventType type)> &Callback, const std::string &desc="")
Register the callback for hotplug.
void setLogLevel(LogLevel l)
Change the log level.
std::map< std::string, std::shared_ptr< Device > > getDevices(double timeOut=0., const std::string &desc="", bool *stopWaiting=nullptr, xv::SlamStartMode slamStartMode=xv::SlamStartMode::Normal, xv::DeviceSupport deviceSupport=xv::DeviceSupport ::ONLYUSB)
Retrieve all the detected XVisio devices. If no device is found after the timeout is reached,...
Version version()
Get xvsdk version.
std::map< std::string, std::shared_ptr< Device > > getDevicesUntilTimeout(double timeOut=0., const std::string &desc="", xv::SlamStartMode slamStartMode=xv::SlamStartMode::Normal, xv::DeviceSupport deviceSupport=xv::DeviceSupport ::ONLYUSB)
Retrieve all the detected XVisio devices. If no device is found after the timeout is reached,...
Definition: xv-types.h:1555
Definition: xv-types.h:1125
An image provided by a TOF camera.
Definition: xv-types.h:1109
Device setting.
Definition: xv-types.h:87
Definition: xv-types.h:1602
Images coming from xv::FisheyeCameras sensor system used for visual SLAM.
Definition: xv-types.h:1028
Definition: xv-types.h:1654
Gesture data.
Definition: xv-types.h:1301
Definition: xv-types.h:1210
Class representing a 6dof pose at a timestamp with a linear model for prediction.
Definition: xv-types.h:797
SGBM data.
Definition: xv-types.h:1225
Represents a transformation (or pose) with translation and rotation matrix.
Definition: xv-types.h:640
The Version struct.
Definition: xv-types.h:127
Definition: xv-types.h:1623
Definition: xv-types.h:1648
Definition: xv-types.h:1641
Definition: xv-types.h:1544
SGBM CONFIG STRUCT.
Definition: xv-types.h:1067