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 
243  virtual ~ColorCamera(){}
244 };
245 
249 class TofCamera : virtual public Stream<DepthImage const &>, virtual public Camera {
250 public:
251  enum class StreamMode { DepthOnly = 0, CloudOnly, DepthAndCloud, None, CloudOnLeftHandSlam};
252  enum class DistanceMode { Short = 0, Middle, Long };
253  enum class SonyTofLibMode { IQMIX_DF ,IQMIX_SF, LABELIZE_DF ,LABELIZE_SF ,M2MIX_DF ,M2MIX_SF };
254  enum class Framerate{ FPS_5 ,FPS_10 ,FPS_15 ,FPS_20 ,FPS_25 ,FPS_30 };
255  enum class Resolution{ Unknown = -1,VGA = 0 ,QVGA ,HQVGA};
256  enum class Manufacturer {Unknown = -1, Pmd = 0, Sony};
257 
261  virtual int registerColorDepthImageCallback(std::function<void(const DepthColorImage&)>) = 0;
262  virtual bool unregisterColorDepthImageCallback(int callbackId) = 0;
263 
269  virtual std::shared_ptr<PointCloud> depthImageToPointCloud(DepthImage const &) const = 0;
270 
275  virtual std::shared_ptr<PointCloud> formatPmdCloudToPointCloudStruct(DepthImage const &) const = 0;
276 
280  virtual bool setStreamMode(StreamMode mode) = 0;
281 
292  virtual bool setDistanceMode(DistanceMode mode) = 0;
293 
298  virtual Resolution getResolution() = 0;
299 
304  virtual Manufacturer getManufacturer() = 0;
305 
316  virtual bool setLibWorkMode(SonyTofLibMode mode) = 0;
317 
321  virtual bool enableTofIr(bool enable) = 0;
322 
326  virtual bool setMode(int mode) = 0;
327 
331  virtual bool setSonyTofSetting(SonyTofLibMode mode, Resolution resolution, Framerate frameRate) = 0;
332 
333  virtual void setTofIrGamma(double gamma) = 0;
334 
338  virtual void setFilterFile(std::string filePath) = 0;
339 
340  virtual ~TofCamera() {}
341 };
342 
348 class Slam : virtual public Stream<Pose const&> {
349 
350 public:
351  enum class Mode { Edge = 0, Mixed, EdgeFusionOnHost };
352 
357  virtual Mode mode() const = 0;
358 
362  virtual bool start() override = 0;
363 
369  virtual bool start(Mode mode) = 0;
370 
375  virtual bool reset() = 0;
376 
381  virtual bool pause() = 0;
382 
387  virtual bool resume() = 0;
388 
399  virtual bool getPose(Pose& pose, double prediction = 0.) = 0;
400 
411  virtual bool getPoseAt(Pose& pose, double timestamp) = 0;
412 
417  virtual int registerVisualPoseCallback(std::function<void (const Pose&)> lostCallback) = 0;
418  virtual bool unregisterVisualPoseCallback(int callbackId) = 0;
419  #define XVSDK_HAS_SLAM_VISUAL_POSE_CALLBACK
420 
425  virtual int registerLostCallback(std::function<void ()> lostCallback) = 0;
426  virtual bool unregisterLostCallback(int callbackId) = 0;
427 
435  virtual int registerStereoPlanesCallback(std::function<void (std::shared_ptr<const std::vector<Plane>>)> planeCallback) = 0;
436  virtual bool unregisterStereoPlanesCallback(int callbackId) = 0;
437  virtual bool clearStereoPlanes() = 0;
438 
452  virtual int registerTofPlanesCallback(std::function<void (std::shared_ptr<const std::vector<Plane>>)> planeCallback) = 0;
453  virtual bool unregisterTofPlanesCallback(int callbackId) = 0;
454  virtual bool clearTofPlanes() = 0;
455 
456 
461  virtual int registerMapCallback(std::function<void (std::shared_ptr<const xv::SlamMap>)> mapCallback) = 0;
462  virtual bool unregisterMapCallback(int callbackId) = 0;
463 
474  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;
485  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;
486 
493  virtual Pose poseScaleCalibration(const Pose& pose) = 0;
494 
495  virtual ~Slam() {}
496 };
497 
501 class ObjectDetector : virtual public Stream<std::vector<Object> const&> {
502 public:
503  enum class Source { LEFT = 0, RIGHT, RGB, TOF };
504 
505  virtual bool setDescriptor( const std::string &filepath ) = 0;
506  virtual bool setModel( const std::string &filepath ) = 0;
507  virtual bool setSource( const Source &source ) = 0;
508  virtual xv::ObjectDetector::Source getSource() const = 0;
509  virtual xv::ObjectDescriptor getDescriptor() const = 0;
510 
511  virtual int registerCnnRawCallback(std::function<void (std::shared_ptr<CnnRawWrapper> const&)> poseCallback) = 0;
512  virtual bool unregisterCnnRawCallback(int callbackId) = 0;
513 
514  virtual ~ObjectDetector() {}
515 };
516 
520 class SgbmCamera : virtual public Stream<SgbmImage const &>, virtual public Camera {
521 public:
522  enum class Resolution {
523  SGBM_640x480 = 0,
524  SGBM_1280x720 = 1,
525  };
526  enum class Mode { Hardware = 0, Software };
530  virtual Mode mode() const = 0;
531 
532  virtual bool start(const std::string &sgbmConfig) = 0;
533  virtual bool start(const sgbm_config &sgbmConfig) = 0;
534  virtual bool setConfig(const std::string &sgbmConfig) = 0;
535  virtual bool setSgbmResolution(const xv::SgbmCamera::Resolution & resolution) = 0;
536  virtual xv::SgbmCamera::Resolution getSgbmResolution() = 0;
545  virtual std::shared_ptr<PointCloud> depthImageToPointCloud(SgbmImage const &sgbmImage) const = 0;
546  virtual ~SgbmCamera() {}
547 };
548 
552 class ThermalCamera : virtual public Stream<ThermalImage const &>, virtual public Camera {
553 public:
554 
555  enum class Mode { TEMPERATURE = 0, TEMPERTURE = 0, GREY };
556  virtual bool setMode( Mode mode ) = 0;
557  virtual ~ThermalCamera() {}
558 };
559 
563 class EyetrackingCamera : virtual public Stream<EyetrackingImage const &>, virtual public Camera {
564 public:
565 
574  virtual bool setExposure( int leftGain, float leftTimeMs, int rightGain, float rightTimeMs ) = 0;
575 
583  virtual bool setLedBrighness( int eye, int led, int brightness ) = 0;
584 
585  virtual ~EyetrackingCamera() {}
586 };
587 
591 class GazeStream : virtual public Stream<XV_ET_EYE_DATA_EX const &>{
592 public:
593 
599  virtual void setConfigPath(std::string config) = 0;
600 
601  virtual ~GazeStream() {}
602 };
603 
607 class IrisStream : virtual public Stream<XV_IRIS_DATA const &>{
608 public:
609 
610 #if defined( __ANDROID__ )
611  virtual bool start(JNIEnv* env, jobject thiz, std::string offlineS) = 0;
612 
613  virtual const char* onlineActive(JNIEnv *env, jobject context, const char* initLicense, const char* userId, const char* secret, int &activeResult) = 0;
614 #endif
615 
620  virtual void setUserName(std::string name) = 0;
621 
627  virtual int registerEnrollCallback(std::function<void (XV_IRIS_DATA const &)>) = 0;
628  virtual bool UnregisterEnrollCallback(int callbackID) = 0;
629 
635  virtual int registerIdentifyCallback(std::function<void (XV_IRIS_DATA const &)>) = 0;
636  virtual bool UnregisterIdentifyCallback(int callbackID) = 0;
637 
643  virtual bool loadIrisInfo(unsigned char* iris_features, int size) = 0;
644 
650  virtual void setConfigPath(std::string config) = 0;
651 
652  virtual ~IrisStream() {}
653 };
654 
658 class GestureStream : virtual public Stream<GestureData const &> {
659 public:
660 
666  virtual int registerDynamicGestureCallback(std::function<void (GestureData const &)>) = 0;
667  virtual bool UnregisterDynamicGestureCallback(int callbackID) = 0;
668 
676  virtual int registerKeypointsCallback(std::function<void (std::shared_ptr<const std::vector<keypoint>>)> callback) = 0;
677  virtual bool unregisterKeypointsCallback(int callbackId) = 0;
678 
686  virtual int registerSlamKeypointsCallback(std::function<void (std::shared_ptr<const std::vector<Pose>>)> callback) = 0;
687  virtual bool unregisterSlamKeypointsCallback(int callbackId) = 0;
688 
689  virtual ~GestureStream() {}
690 };
691 
695 class GPSStream : virtual public Stream<std::vector<unsigned char> const &>{
696 public:
697  virtual ~GPSStream() {}
698 };
699 
703 class GPSDistanceStream : virtual public Stream<GPSDistanceData const &>{
704 public:
705 
706  virtual ~GPSDistanceStream() {}
707 };
708 
712 class MicStream : virtual public Stream<MicData const &> {
713 public:
714 
715  virtual ~MicStream() {}
716 };
717 
721 class Speaker {
722 public:
723 
724  virtual bool enable() = 0;
725  virtual bool disable() = 0;
729  virtual int send(const std::uint8_t *data, int len) = 0;
730 
734  virtual bool play(const std::string &path) = 0;
738  virtual bool play(const std::uint8_t *data, int len) = 0;
742  virtual bool isPlaying() = 0;
746  virtual int registerPlayEndCallback( std::function<void ()> ) = 0;
747  virtual bool unregisterPlayEndCallback( int callbackId ) = 0;
748 
749  virtual ~Speaker() {}
750 };
751 
1078 class DeviceStatusStream : virtual public Stream<std::vector<unsigned char> const &> {
1079 public:
1080 
1081  virtual ~DeviceStatusStream(){}
1082 };
1083 
1084 
1102 class Device {
1103 
1104 public:
1105 
1106 
1111  virtual std::map<std::string, std::string> info() = 0;
1112 
1116  virtual std::shared_ptr<Slam> slam() = 0;
1117 
1121  virtual std::shared_ptr<ImuSensor> imuSensor() = 0;
1122 
1126  virtual std::shared_ptr<EventStream> eventStream() = 0;
1127 
1131  virtual std::shared_ptr<OrientationStream> orientationStream() = 0;
1132 
1136  virtual std::shared_ptr<FisheyeCameras> fisheyeCameras() = 0;
1137 
1141  virtual std::shared_ptr<ColorCamera> colorCamera() = 0;
1142 
1146  virtual std::shared_ptr<TofCamera> tofCamera() = 0;
1147 
1151  virtual std::shared_ptr<SgbmCamera> sgbmCamera() = 0;
1152 
1156  virtual std::shared_ptr<ThermalCamera> thermalCamera() = 0;
1157 
1161  virtual std::shared_ptr<EyetrackingCamera> eyetracking() = 0;
1162 
1166  virtual std::shared_ptr<GazeStream> gaze() = 0;
1167 
1171  virtual std::shared_ptr<IrisStream> iris() = 0;
1172 
1176  virtual std::shared_ptr<GestureStream> gesture() = 0;
1177 
1181  virtual std::shared_ptr<GPSStream> gpsModule() = 0;
1182 
1186  virtual std::shared_ptr<GPSDistanceStream> gpsDistanceModule() = 0;
1187 
1191  virtual std::shared_ptr<MicStream> mic() = 0;
1192 
1196  virtual std::shared_ptr<Speaker> speaker() = 0;
1197 
1201  virtual std::shared_ptr<Display> display() = 0;
1202 
1206  virtual std::shared_ptr<ObjectDetector> objectDetector() = 0;
1207 
1211  virtual std::shared_ptr<DeviceStatusStream> deviceStatus() = 0;
1212 
1216  virtual bool sleep(int level = 0) = 0;
1220  virtual bool wakeup() = 0;
1221 
1225  virtual bool control(const DeviceSetting &setting) = 0;
1226 
1640  virtual bool hidWriteAndRead(const std::vector<unsigned char> &command, std::vector<unsigned char> &result) = 0;
1644  virtual bool uvcWriteAndRead(const std::vector<unsigned char> &command, std::vector<unsigned char> &result) = 0;
1648  virtual bool vscWriteAndRead(const std::vector<unsigned char> &command, std::vector<unsigned char> &result) = 0;
1649 
1653  virtual bool enableSync(bool isEnable) = 0;
1654 
1658  virtual std::string id() const = 0;
1659 
1660  virtual ~Device(){}
1661 
1662 };
1663 
1664 
1673 Version version();
1674 
1683 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);
1684 
1688 void setLogLevel(LogLevel l);
1689 
1694 int registerPlugEventCallback(const std::function<void (std::shared_ptr<Device> device, PlugEventType type)> &Callback, const std::string& desc = "");
1698 bool unregisterHotplugCallback( int callbackID );
1699 
1714 std::shared_ptr<Device> getDevice(int fd);
1721 std::shared_ptr<Device> getDevice(int fd, std::string const& desc, xv::SlamStartMode slamStartMode = xv::SlamStartMode::Normal);
1722 
1726 bool detachDevice(int fd );
1727 
1731 std::string getDefaultDescription();
1732 
1736 void getUTCTIme(DateTime* utc);
1737 
1749 bool savePointCloudToPcd(const std::string &path, std::shared_ptr<PointCloud> const & point, int precision = 8, bool removeInvalidPoints = true);
1750 
1751 
1752 }
xv::Stream::registerCallback
virtual int registerCallback(std::function< void(T)>)=0
Register callback to receive data.
xv::TofCamera::enableTofIr
virtual bool enableTofIr(bool enable)=0
Enable tof ir.
xv::EyetrackingCamera::setExposure
virtual bool setExposure(int leftGain, float leftTimeMs, int rightGain, float rightTimeMs)=0
Set eyetracking exposure.
xv::Orientation
Orientation only (3dof) of the pose.
Definition: xv-types.h:852
xv::GazeStream
A class to handle callbacks of the gaze data.
Definition: xv-sdk.h:591
xv::Slam::mode
virtual Mode mode() const =0
Get #Mode.
xv::Device::imuSensor
virtual std::shared_ptr< ImuSensor > imuSensor()=0
Get the IMU sensor of the device.
xv::TofCamera::setMode
virtual bool setMode(int mode)=0
Set work mode.
xv::Stream::unregisterCallback
virtual bool unregisterCallback(int callbackId)=0
Unregister callback.
xv::Slam::registerVisualPoseCallback
virtual int registerVisualPoseCallback(std::function< void(const Pose &)> lostCallback)=0
Register a callback called when visual SLAM compute a new unfiltered pose.
xv::ColorCamera::Resolution::RGB_1920x1080
@ RGB_1920x1080
RGB 1080p.
xv::ColorCamera
A class to handle callbacks of the color image.
Definition: xv-sdk.h:213
xv::Device::gaze
virtual std::shared_ptr< GazeStream > gaze()=0
Get the gaze data of the device.
xv::Device
Class to get tracking results and raw outputs with a connected device.
Definition: xv-sdk.h:1102
xv::SgbmCamera::Resolution::SGBM_640x480
@ SGBM_640x480
SGBM 480p.
xv::SgbmCamera::Resolution::SGBM_1280x720
@ SGBM_1280x720
SGBM 720p.
xv::Speaker::registerPlayEndCallback
virtual int registerPlayEndCallback(std::function< void()>)=0
Rigster a callback for async play end.
xv::Stream::stop
virtual bool stop()=0
stop streaming.
xv::OrientationStream
The class to give access to 3dof data which converted from raw IMU data.
Definition: xv-sdk.h:137
xv::TofCamera::registerColorDepthImageCallback
virtual int registerColorDepthImageCallback(std::function< void(const DepthColorImage &)>)=0
Gives access to composed image with RBG color on depth images.
xv::Device::hidWriteAndRead
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:
xv::getUTCTIme
void getUTCTIme(DateTime *utc)
Get UTC time.
xv::IrisStream::setConfigPath
virtual void setConfigPath(std::string config)=0
Set coe configuration file path.
xv::Device::objectDetector
virtual std::shared_ptr< ObjectDetector > objectDetector()=0
Get the object detection component.
xv::Slam::start
virtual bool start() override=0
Start slam of current mode.
xv::Device::uvcWriteAndRead
virtual bool uvcWriteAndRead(const std::vector< unsigned char > &command, std::vector< unsigned char > &result)=0
Write UVC control command and read result.
xv::Device::gesture
virtual std::shared_ptr< GestureStream > gesture()=0
Get the gesture component.
xv::FisheyeCameras
The class to handle callbacks of the multi cameras for the visual SLAM.
Definition: xv-sdk.h:169
xv::getDevice
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.
xv::Version
The Version struct.
Definition: xv-types.h:126
xv::Device::thermalCamera
virtual std::shared_ptr< ThermalCamera > thermalCamera()=0
Get the thermal component of the device.
xv::Speaker::send
virtual int send(const std::uint8_t *data, int len)=0
Send a small time slice of sound data.
xv::setLogLevel
void setLogLevel(LogLevel l)
Change the log level.
xv::ColorCamera::Resolution::RGB_640x480
@ RGB_640x480
RGB 480p.
xv::GestureData
Gesture data.
Definition: xv-types.h:1249
xv::Speaker::isPlaying
virtual bool isPlaying()=0
If async playing.
xv::GestureStream
A class to handle gusture.
Definition: xv-sdk.h:658
xv::SgbmCamera::mode
virtual Mode mode() const =0
Must be called befor start.
xv::Slam::registerStereoPlanesCallback
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.
xv::Speaker
A class to handle speaker. Adjust the sound source(PCM) volume to adjust the volume.
Definition: xv-sdk.h:721
xv::GestureStream::registerSlamKeypointsCallback
virtual int registerSlamKeypointsCallback(std::function< void(std::shared_ptr< const std::vector< Pose >>)> callback)=0
Callback to get the keypoints 21Dof information based on slam position.
xv::TofCamera::setFilterFile
virtual void setFilterFile(std::string filePath)=0
set SonyTof filter file
xv::IrisStream::registerEnrollCallback
virtual int registerEnrollCallback(std::function< void(XV_IRIS_DATA const &)>)=0
Callback to get the enroll information.
xv::XV_IRIS_DATA
Definition: xv-types.h:1489
xv::ImuSensor
The class to give access to data provided by the IMU sensor.
Definition: xv-sdk.h:81
xv::GazeStream::setConfigPath
virtual void setConfigPath(std::string config)=0
Set coe configuration file path.
xv::TofCamera::depthImageToPointCloud
virtual std::shared_ptr< PointCloud > depthImageToPointCloud(DepthImage const &) const =0
Convert a depth image to point cloud for sony TOF.
xv::Camera::setBrightness
virtual bool setBrightness(int brightness)
Set output image brightness. Only valid in auto exposure mode.
xv::Slam::getPoseAt
virtual bool getPoseAt(Pose &pose, double timestamp)=0
Get the 6dof pose of the device at a given timestamp.
xv::DepthImage
An image provided by a TOF camera.
Definition: xv-types.h:1108
xv::GPSStream
A class to handle callbacks of the GPS data.
Definition: xv-sdk.h:695
xv::Device::iris
virtual std::shared_ptr< IrisStream > iris()=0
Get the iris data of the device.
xv::Slam::registerLostCallback
virtual int registerLostCallback(std::function< void()> lostCallback)=0
Register a callback called when SLAM is lost.
xv::Device::mic
virtual std::shared_ptr< MicStream > mic()=0
Get the MIC component of the device.
xv::Slam::resume
virtual bool resume()=0
Resume the 6dof tracker (SLAM)
xv::SgbmCamera
A class to handle callbacks of the SGBM.
Definition: xv-sdk.h:520
xv::EventStream
A class to handle callbacks of events.
Definition: xv-sdk.h:128
xv::GestureStream::registerKeypointsCallback
virtual int registerKeypointsCallback(std::function< void(std::shared_ptr< const std::vector< keypoint >>)> callback)=0
Callback to get the keypoints 21Dof information.
xv::Stream
Stream interface.
Definition: xv-sdk.h:19
xv::Camera::setExposure
virtual bool setExposure(int aecMode=0, int exposureGain=0, float exposureTimeMs=0.0)
Exposure setting.
xv::Display
The class to handle informations about the display (if device can display like a HMD)
Definition: xv-sdk.h:182
xv::ColorCamera::Resolution::RGB_2560x1920
@ RGB_2560x1920
RGB 5m (not supported now)
xv::Device::speaker
virtual std::shared_ptr< Speaker > speaker()=0
Get the speaker component of the device.
xv::ThermalCamera
A class to handle callbacks of the thermal camera.
Definition: xv-sdk.h:552
xv::Device::wakeup
virtual bool wakeup()=0
Wake up device.
xv::DeviceSetting
Device setting.
Definition: xv-types.h:85
xv::Display::open
virtual bool open()=0
Turn on the display.
xv::Camera::calibration
virtual const std::vector< Calibration > & calibration()
Get the camera calibration.
xv::GPSDistanceStream
A class to handle callbacks of the gaze data.
Definition: xv-sdk.h:703
xv::Display::close
virtual bool close()=0
Turn off the display.
xv::Device::info
virtual std::map< std::string, std::string > info()=0
Get informations (Serial Number, version ...) about the device.
xv::Device::control
virtual bool control(const DeviceSetting &setting)=0
Control device.
xv::Pose
Class representing a 6dof pose at a timestamp with a linear model for prediction.
Definition: xv-types.h:796
xv::IrisStream::loadIrisInfo
virtual bool loadIrisInfo(unsigned char *iris_features, int size)=0
Load the iris features the identify information.
xv::ColorCamera::Resolution::RGB_320x240
@ RGB_320x240
RGB QVGA (not supported now)
xv::EyetrackingCamera::setLedBrighness
virtual bool setLedBrighness(int eye, int led, int brightness)=0
Set eyetracking led brightness (in s)
xv::Device::sgbmCamera
virtual std::shared_ptr< SgbmCamera > sgbmCamera()=0
Get the SGBM component of the device.
xv::Device::display
virtual std::shared_ptr< Display > display()=0
Get the display component.
xv::registerPlugEventCallback
int registerPlugEventCallback(const std::function< void(std::shared_ptr< Device > device, PlugEventType type)> &Callback, const std::string &desc="")
Register the callback for hotplug.
xv::version
Version version()
Get xvsdk version.
xv::Device::enableSync
virtual bool enableSync(bool isEnable)=0
set enable camera synchronize.
xv::Device::orientationStream
virtual std::shared_ptr< OrientationStream > orientationStream()=0
Get the 3dof component.
xv::Device::gpsModule
virtual std::shared_ptr< GPSStream > gpsModule()=0
Get the GPS data of the device.
xv::Device::deviceStatus
virtual std::shared_ptr< DeviceStatusStream > deviceStatus()=0
Get the device status component.
xv::Stream::start
virtual bool start()=0
start streaming.
xv::getDefaultDescription
std::string getDefaultDescription()
Retrieve default device description.
xv::ObjectDetector
A class to handle callbacks of the object detector (CNN)
Definition: xv-sdk.h:501
xv::Display::setBrightnessLevel
virtual bool setBrightnessLevel(int level)=0
Set brightness level.
xv::EyetrackingCamera
A class to handle callbacks of the eyetracking camera.
Definition: xv-sdk.h:563
xv::Slam::registerTofPlanesCallback
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.
xv::Camera
Camera interface.
Definition: xv-sdk.h:47
xv::TofCamera::getResolution
virtual Resolution getResolution()=0
Get current resolution.
xv::TofCamera::getManufacturer
virtual Manufacturer getManufacturer()=0
Get tof Manufacturer.
xv::Slam::reset
virtual bool reset()=0
Reset the 6dof tracker (SLAM)
xv::TofCamera::formatPmdCloudToPointCloudStruct
virtual std::shared_ptr< PointCloud > formatPmdCloudToPointCloudStruct(DepthImage const &) const =0
format a depth image to point cloud for pmd TOF(Cloud Only).
xv::Device::eventStream
virtual std::shared_ptr< EventStream > eventStream()=0
Get the event component.
xv::SgbmCamera::Resolution
Resolution
Definition: xv-sdk.h:522
xv::FisheyeImages
Images coming from xv::FisheyeCameras sensor system used for visual SLAM.
Definition: xv-types.h:1027
xv::IrisStream::setUserName
virtual void setUserName(std::string name)=0
Set user name.
xv::TofCamera
A class to handle callbacks of the ToF camera.
Definition: xv-sdk.h:249
xv::Device::vscWriteAndRead
virtual bool vscWriteAndRead(const std::vector< unsigned char > &command, std::vector< unsigned char > &result)=0
Write VSC control command and read result.
xv::IrisStream::registerIdentifyCallback
virtual int registerIdentifyCallback(std::function< void(XV_IRIS_DATA const &)>)=0
Callback to get the identify information.
xv::Device::slam
virtual std::shared_ptr< Slam > slam()=0
Get the SLAM component.
xv::Slam
The class to represent the component doing the 6dof tracking with SLAM algorithm on host.
Definition: xv-sdk.h:348
xv::ColorCamera::Resolution::RGB_1280x720
@ RGB_1280x720
RGB 720p.
xv::Slam::getPose
virtual bool getPose(Pose &pose, double prediction=0.)=0
Get the current 6dof pose of the device.
xv::SgbmCamera::depthImageToPointCloud
virtual std::shared_ptr< PointCloud > depthImageToPointCloud(SgbmImage const &sgbmImage) const =0
convert DepthImage to pointCloud .
xv::Slam::registerMapCallback
virtual int registerMapCallback(std::function< void(std::shared_ptr< const xv::SlamMap >)> mapCallback)=0
Callback to get the SLAM map updates.
xv::MicStream
A class to handle MIC. Adjust volumn through source.
Definition: xv-sdk.h:712
xv::DateTime
Definition: xv-types.h:1501
xv::TofCamera::setSonyTofSetting
virtual bool setSonyTofSetting(SonyTofLibMode mode, Resolution resolution, Framerate frameRate)=0
SonyTof Settings.
xv::detachDevice
bool detachDevice(int fd)
Tell sdk device has disconnected. Only for Android.
xv::DepthColorImage
Definition: xv-types.h:1124
xv::Slam::loadMapAndSwitchToCslam
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.
xv::Device::id
virtual std::string id() const =0
Return the serial number of the device.
xv::Device::eyetracking
virtual std::shared_ptr< EyetrackingCamera > eyetracking()=0
Get the eyetracking component of the device.
xv::OrientationStream::get
virtual bool get(Orientation &pose, double prediction=0.)=0
Get the current orientation of the device.
xv::unregisterHotplugCallback
bool unregisterHotplugCallback(int callbackID)
Unregister a plug callback.
xv::Device::fisheyeCameras
virtual std::shared_ptr< FisheyeCameras > fisheyeCameras()=0
Get the stereo cameras component of the device.
xv::Device::gpsDistanceModule
virtual std::shared_ptr< GPSDistanceStream > gpsDistanceModule()=0
Get the GPS distance data of the device.
xv::OrientationStream::getAt
virtual bool getAt(Orientation &pose, double timestamp)=0
Get the orientation of the device at a given timestamp.
xv::ObjectDescriptor
Definition: xv-types.h:1171
xv::GestureStream::registerDynamicGestureCallback
virtual int registerDynamicGestureCallback(std::function< void(GestureData const &)>)=0
Callback to get the dynamic gesture information.
xv::DeviceStatusStream
A class to handle device status event stream.
Definition: xv-sdk.h:1078
xv::ColorCamera::Resolution
Resolution
Definition: xv-sdk.h:215
xv::TofCamera::setDistanceMode
virtual bool setDistanceMode(DistanceMode mode)=0
Set distance mode.
xv::Slam::pause
virtual bool pause()=0
Pause the 6dof tracker (SLAM)
xv::getDevices
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,...
xv::IrisStream
A class to handle callbacks of the Iris data.
Definition: xv-sdk.h:607
xv::TofCamera::setLibWorkMode
virtual bool setLibWorkMode(SonyTofLibMode mode)=0
Set lib mode.
xv::TofCamera::setStreamMode
virtual bool setStreamMode(StreamMode mode)=0
Set which stream will be reported. Not work with sony TOF.
xv::Slam::saveMapAndSwitchToCslam
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.
xv::Speaker::play
virtual bool play(const std::string &path)=0
Async play sound file in new thread.
xv::Device::colorCamera
virtual std::shared_ptr< ColorCamera > colorCamera()=0
Get the color camera component of the device.
xv::Device::sleep
virtual bool sleep(int level=0)=0
Let device sleep.
xv::Slam::poseScaleCalibration
virtual Pose poseScaleCalibration(const Pose &pose)=0
slam pose scale calibration.
xv::Device::tofCamera
virtual std::shared_ptr< TofCamera > tofCamera()=0
Get the ToF component of the device.
xv::Display::calibration
virtual const std::vector< Calibration > & calibration()=0
Get calibrations.