API¶
API¶
-
class
API
¶ The API class to communicate with MYNT® EYE device.
Public Types
-
using
stream_callback_t
= std::function<void(const api::StreamData &data)>¶ The api::StreamData callback.
-
using
motion_callback_t
= std::function<void(const api::MotionData &data)>¶ The api::MotionData callback.
Public Functions
-
bool
Supports
(const Capabilities &capability) const¶ Supports the capability or not.
-
StreamRequest
SelectStreamRequest
(bool *ok) const¶ Log all stream requests and prompt user to select one.
-
const std::vector<StreamRequest> &
GetStreamRequests
(const Capabilities &capability) const¶ Get all stream requests of the capability.
-
void
ConfigStreamRequest
(const Capabilities &capability, const StreamRequest &request)¶ Config the stream request to the capability.
-
const StreamRequest &
GetStreamRequest
(const Capabilities &capability) const¶ Get the config stream requests of the capability.
-
const std::vector<StreamRequest> &
GetStreamRequests
() const¶ Get all stream requests of the key stream capability.
-
void
ConfigStreamRequest
(const StreamRequest &request)¶ Config the stream request to the key stream capability.
-
const StreamRequest &
GetStreamRequest
() const¶ Get the config stream requests of the key stream capability.
-
std::shared_ptr<DeviceInfo>
GetInfo
() const¶ Get the device info.
-
std::string
GetSDKVersion
() const¶ Get the sdk version.
-
IntrinsicsPinhole
GetIntrinsics
(const Stream &stream) const¶
-
std::shared_ptr<IntrinsicsBase>
GetIntrinsicsBase
(const Stream &stream) const¶ Get the intrinsics base of stream.
-
Extrinsics
GetExtrinsics
(const Stream &from, const Stream &to) const¶ Get the extrinsics from one stream to another.
-
MotionIntrinsics
GetMotionIntrinsics
() const¶ Get the intrinsics of motion.
-
Extrinsics
GetMotionExtrinsics
(const Stream &from) const¶ Get the extrinsics from one stream to motion.
-
void
LogOptionInfos
() const¶ Log all option infos.
-
OptionInfo
GetOptionInfo
(const Option &option) const¶ Get the option info.
-
void
SetDisparityComputingMethodType
(const DisparityComputingMethod &MethodType)¶ Set the disparity computing method.
-
void
SetRectifyAlpha
(const double &alpha)¶ Set the rectify bord cut alpha.
-
void
setDuplicate
(bool isEnable)¶ Set if the duplicate frames is enable.
-
void
SetStreamCallback
(const Stream &stream, stream_callback_t callback)¶ Set the callback of stream.
-
void
SetMotionCallback
(motion_callback_t callback)¶ Set the callback of motion.
-
bool
HasMotionCallback
() const¶ Has the callback of motion.
-
void
WaitForStreams
()¶ Wait the streams are ready.
-
void
EnableStreamData
(const Stream &stream)¶ Enable the data of stream.
- Note
must enable the stream if it’s a synthetic one. This means the stream in not native, the device has the capability to provide this stream, but still support this stream.
-
void
EnableStreamData
(const Stream &stream, stream_switch_callback_t callback, bool try_tag = false)¶ Enable the data of stream.
callback function will call before the father processor enable. when try_tag is true, the function will do nothing except callback.
-
void
DisableStreamData
(const Stream &stream, stream_switch_callback_t callback, bool try_tag = false)¶ Disable the data of stream.
callback function will call before the children processor disable. when try_tag is true, the function will do nothing except callback.
-
api::StreamData
GetStreamData
(const Stream &stream)¶ Get the latest data of stream.
-
std::vector<api::StreamData>
GetStreamDatas
(const Stream &stream)¶ Get the datas of stream.
- Note
default cache 4 datas at most.
-
void
EnableMotionDatas
(std::size_t max_size = std::numeric_limits<std::size_t>::max())¶ Enable cache motion datas.
-
std::vector<api::MotionData>
GetMotionDatas
()¶ Get the motion datas.
-
void
EnableTimestampCorrespondence
(const Stream &stream, bool keep_accel_then_gyro = true)¶ Enable motion datas with timestamp correspondence of some stream.
-
void
EnablePlugin
(const std::string &path)¶ Enable the plugin.
-
void
EnableProcessMode
(const ProcessMode &mode)¶ Enable process mode, e.g.
imu assembly, temp_drift
-
void
EnableProcessMode
(const std::int32_t &mode)¶ Enable process mode, e.g.
imu assembly, temp_drift
-
std::shared_ptr<struct CameraROSMsgInfoPair>
GetCameraROSMsgInfoPair
()¶ Get ROS need camera info struct.
-
bool
ConfigDisparityFromFile
(const std::string &config_file)¶ Load disparity config from file.
Public Static Functions
-
static std::shared_ptr<API>
Create
(int argc, char *argv[])¶ Create the API instance.
- Return
the API instance.
- Note
This will init glog with args and call device::select() to select a device.
- Parameters
argc
: the arg count.argv
: the arg values.
-
using