<docs> update en doc
12
docs/api/contents.rst
Normal file
|
@ -0,0 +1,12 @@
|
|||
.. _api:
|
||||
|
||||
API DOC
|
||||
=========
|
||||
|
||||
.. toctree::
|
||||
|
||||
api
|
||||
device
|
||||
enums
|
||||
types
|
||||
utils
|
BIN
docs/images/firmware_update.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
docs/images/firmware_update_cypressUSB.png
Normal file
After Width: | Height: | Size: 172 KiB |
BIN
docs/images/firmware_update_dir.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
docs/images/firmware_update_driver.png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
docs/images/firmware_update_driver_install.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
docs/images/firmware_update_option.png
Normal file
After Width: | Height: | Size: 470 KiB |
BIN
docs/images/firmware_update_select.png
Normal file
After Width: | Height: | Size: 128 KiB |
BIN
docs/images/firmware_update_success.png
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
docs/images/firmware_update_warning.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
docs/images/firmware_update_westbridge.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
docs/images/imu_analytics.png
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
docs/images/mynteye_avatar_imu_coord.jpg
Normal file
After Width: | Height: | Size: 119 KiB |
BIN
docs/images/mynteye_avatar_surface_zh-Hans.jpg
Normal file
After Width: | Height: | Size: 147 KiB |
BIN
docs/images/mynteye_imu_coord.jpg
Normal file
After Width: | Height: | Size: 100 KiB |
BIN
docs/images/mynteye_surface_zh-Hans.jpg
Normal file
After Width: | Height: | Size: 193 KiB |
BIN
docs/images/stamp_analytics.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
docs/images/vs_cmd.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
docs/images/vs_cmd_menu.png
Normal file
After Width: | Height: | Size: 142 KiB |
BIN
docs/images/vs_cmd_test.png
Normal file
After Width: | Height: | Size: 44 KiB |
|
@ -7,14 +7,19 @@ MYNT® EYE S SDK
|
|||
===============
|
||||
|
||||
.. toctree::
|
||||
:caption: API REFERENCE
|
||||
|
||||
:maxdepth: 2
|
||||
|
||||
api/api
|
||||
api/device
|
||||
api/enums
|
||||
api/types
|
||||
api/utils
|
||||
src/mynteye/contents
|
||||
src/sdk/contents
|
||||
src/firmware/contents
|
||||
src/data/contents
|
||||
src/control/contents
|
||||
src/log/contents
|
||||
src/wrapper/contents
|
||||
src/analytics/contents
|
||||
src/slam/contents
|
||||
api/contents
|
||||
|
||||
..
|
||||
Indices and tables
|
||||
|
|
38
docs/src/analytics/analytics_imu.rst
Normal file
|
@ -0,0 +1,38 @@
|
|||
.. _analytics_imu:
|
||||
|
||||
Analyzing IMU
|
||||
==============
|
||||
|
||||
The SDK provides the script ``imu_analytics.py`` for IMU analysis. The tool details can be seen in `tools/README.md <https://github.com/slightech/MYNT-EYE-S-SDK/tree/master/tools>`_ .
|
||||
Refer to run commands and results on Linux:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ python tools/analytics/imu_analytics.py -i dataset -c tools/config/mynteye/mynteye_config.yaml -al=-1.2,1.2 -gl= -gdu=d -gsu=d -kl=
|
||||
imu analytics ...
|
||||
input: dataset
|
||||
outdir: dataset
|
||||
gyro_limits: None
|
||||
accel_limits: [(-1.2, 1.2), (-1.2, 1.2), (-1.2, 1.2), (-1.2, 1.2)]
|
||||
time_unit: None
|
||||
time_limits: None
|
||||
auto: False
|
||||
gyro_show_unit: d
|
||||
gyro_data_unit: d
|
||||
temp_limits: None
|
||||
open dataset ...
|
||||
imu: 20040, temp: 20040
|
||||
timebeg: 4.384450, timeend: 44.615550, duration: 40.231100
|
||||
save figure to:
|
||||
dataset/imu_analytics.png
|
||||
imu analytics done
|
||||
|
||||
The analysis result graph will be saved in the data set directory, as follows:
|
||||
|
||||
.. image:: ../../images/imu_analytics.png
|
||||
|
||||
In addition, the script specific options can be executed ``-h``:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ python tools/analytics/imu_analytics.py -h
|
55
docs/src/analytics/analytics_stamp.rst
Normal file
|
@ -0,0 +1,55 @@
|
|||
.. _analytics_stamp:
|
||||
|
||||
Analyze time stamps
|
||||
====================
|
||||
|
||||
SDK provides a script for timestamp analysis ``stamp_analytics.py`` . Tool details are visible in `tools/README.md <https://github.com/slightech/MYNT-EYE-S-SDK/tree/master/tools>`_ .
|
||||
|
||||
Reference run commands and results on Linux:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ python tools/analytics/stamp_analytics.py -i dataset -c tools/config/mynteye/mynteye_config.yaml
|
||||
stamp analytics ...
|
||||
input: dataset
|
||||
outdir: dataset
|
||||
open dataset ...
|
||||
save to binary files ...
|
||||
binimg: dataset/stamp_analytics_img.bin
|
||||
binimu: dataset/stamp_analytics_imu.bin
|
||||
img: 1007, imu: 20040
|
||||
|
||||
rate (Hz)
|
||||
img: 25, imu: 500
|
||||
sample period (s)
|
||||
img: 0.04, imu: 0.002
|
||||
|
||||
diff count
|
||||
imgs: 1007, imus: 20040
|
||||
imgs_t_diff: 1006, imus_t_diff: 20039
|
||||
|
||||
diff where (factor=0.1)
|
||||
imgs where diff > 0.04*1.1 (0)
|
||||
imgs where diff < 0.04*0.9 (0)
|
||||
imus where diff > 0.002*1.1 (0)
|
||||
imus where diff < 0.002*0.9 (0)
|
||||
|
||||
image timestamp duplicates: 0
|
||||
|
||||
save figure to:
|
||||
dataset/stamp_analytics.png
|
||||
stamp analytics done
|
||||
|
||||
The analysis result graph will be saved in the dataset directory, as follows:
|
||||
|
||||
.. image:: ../../images/stamp_analytics.png
|
||||
|
||||
In addition, the script specific options can be executed ``-h`` to understand:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ python tools/analytics/stamp_analytics.py -h
|
||||
|
||||
.. tip::
|
||||
|
||||
Suggestions when recording data sets ``record.cc`` annotation display image inside ``cv::imshow()``, ``dataset.cc`` annotation display image inside ``cv::imwrite()`` . Because these operations are time-consuming, they can cause images to be discarded. In other words, consumption can't keep up with production, so some images are discarded. ``GetStreamDatas()`` used in ``record.cc`` only caches the latest 4 images.
|
10
docs/src/analytics/contents.rst
Normal file
|
@ -0,0 +1,10 @@
|
|||
.. _analytics:
|
||||
|
||||
Data Analytics
|
||||
===============
|
||||
|
||||
.. toctree::
|
||||
|
||||
dataset
|
||||
analytics_imu
|
||||
analytics_stamp
|
58
docs/src/analytics/dataset.rst
Normal file
|
@ -0,0 +1,58 @@
|
|||
.. _dataset:
|
||||
|
||||
Recording data sets
|
||||
====================
|
||||
|
||||
The SDK provides the tool ``record`` for recording data sets. Tool details can be seen in `tools/README.md <https://github.com/slightech/MYNT-EYE-S-SDK/tree/master/tools>`_ .
|
||||
|
||||
Reference run command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./tools/_output/bin/dataset/record
|
||||
|
||||
# Windows
|
||||
.\tools\_output\bin\dataset\record.bat
|
||||
|
||||
Reference run results on Linux:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./tools/_output/bin/dataset/record
|
||||
I0513 21:28:57.128947 11487 utils.cc:26] Detecting MYNT EYE devices
|
||||
I0513 21:28:57.807116 11487 utils.cc:33] MYNT EYE devices:
|
||||
I0513 21:28:57.807155 11487 utils.cc:37] index: 0, name: MYNT-EYE-S1000
|
||||
I0513 21:28:57.807163 11487 utils.cc:43] Only one MYNT EYE device, select index: 0
|
||||
I0513 21:28:57.808437 11487 channels.cc:114] Option::GAIN: min=0, max=48, def=24, cur=24
|
||||
I0513 21:28:57.809999 11487 channels.cc:114] Option::BRIGHTNESS: min=0, max=240, def=120, cur=120
|
||||
I0513 21:28:57.818678 11487 channels.cc:114] Option::CONTRAST: min=0, max=255, def=127, cur=127
|
||||
I0513 21:28:57.831529 11487 channels.cc:114] Option::FRAME_RATE: min=10, max=60, def=25, cur=25
|
||||
I0513 21:28:57.848914 11487 channels.cc:114] Option::IMU_FREQUENCY: min=100, max=500, def=200, cur=500
|
||||
I0513 21:28:57.865185 11487 channels.cc:114] Option::EXPOSURE_MODE: min=0, max=1, def=0, cur=0
|
||||
I0513 21:28:57.881434 11487 channels.cc:114] Option::MAX_GAIN: min=0, max=48, def=48, cur=48
|
||||
I0513 21:28:57.897598 11487 channels.cc:114] Option::MAX_EXPOSURE_TIME: min=0, max=240, def=240, cur=240
|
||||
I0513 21:28:57.913918 11487 channels.cc:114] Option::DESIRED_BRIGHTNESS: min=0, max=255, def=192, cur=192
|
||||
I0513 21:28:57.930177 11487 channels.cc:114] Option::IR_CONTROL: min=0, max=160, def=0, cur=0
|
||||
I0513 21:28:57.946341 11487 channels.cc:114] Option::HDR_MODE: min=0, max=1, def=0, cur=0
|
||||
Saved 1007 imgs, 20040 imus to ./dataset
|
||||
I0513 21:29:38.608772 11487 record.cc:118] Time beg: 2018-05-13 21:28:58.255395, end: 2018-05-13 21:29:38.578696, cost: 40323.3ms
|
||||
I0513 21:29:38.608853 11487 record.cc:121] Img count: 1007, fps: 24.9732
|
||||
I0513 21:29:38.608873 11487 record.cc:123] Imu count: 20040, hz: 496.983
|
||||
|
||||
Results save into ``<workdir>/dataset`` by default. You can also add parameter, select other directory to save.
|
||||
|
||||
Record contents:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
<workdir>/
|
||||
└─dataset/
|
||||
├─left/
|
||||
│ ├─stream.txt # Image infomation
|
||||
│ ├─000000.png # Image,index 0
|
||||
│ └─...
|
||||
├─right/
|
||||
│ ├─stream.txt # Image information
|
||||
│ ├─000000.png # Image,index 0
|
||||
│ └─...
|
||||
└─motion.txt # IMU information
|
129
docs/src/control/auto_exposure.rst
Normal file
|
@ -0,0 +1,129 @@
|
|||
.. _auto_exposure:
|
||||
|
||||
Enable auto exposure and its adjustment function
|
||||
=================================================
|
||||
|
||||
Using the ``SetOptionValue()`` function of the API, you can set various control values of the current open device.
|
||||
|
||||
To enable auto exposure, set ``Option::EXPOSURE_MODE`` to ``0`` .
|
||||
|
||||
For mynteye s1030, the settings available for adjustment during auto exposure are:
|
||||
|
||||
* ``Option::MAX_GAIN`` Maximum gain.
|
||||
* ``Option::MAX_EXPOSURE_TIME`` Maximum exposure time.
|
||||
* ``Option::DESIRED_BRIGHTNESS`` Expected brightness.
|
||||
|
||||
For mynteye s2100/s210a, the settings available for adjustment during auto exposure are:
|
||||
|
||||
* ``Option::MAX_GAIN`` Maximum gain.
|
||||
* ``Option::MAX_EXPOSURE_TIME`` Maximum exposure time.
|
||||
* ``Option::DESIRED_BRIGHTNESS`` Expected brightness.
|
||||
* ``Option::MIN_EXPOSURE_TIME`` Minimum exposure time.
|
||||
|
||||
Reference Code:
|
||||
|
||||
s1030:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
// auto-exposure: 0
|
||||
api->SetOptionValue(Option::EXPOSURE_MODE, 0);
|
||||
|
||||
// max_gain: range [0,48], default 48
|
||||
api->SetOptionValue(Option::MAX_GAIN, 48);
|
||||
// max_exposure_time: range [0,240], default 240
|
||||
api->SetOptionValue(Option::MAX_EXPOSURE_TIME, 240);
|
||||
// desired_brightness: range [0,255], default 192
|
||||
api->SetOptionValue(Option::DESIRED_BRIGHTNESS, 192);
|
||||
|
||||
LOG(INFO) << "Enable auto-exposure";
|
||||
LOG(INFO) << "Set MAX_GAIN to " << api->GetOptionValue(Option::MAX_GAIN);
|
||||
LOG(INFO) << "Set MAX_EXPOSURE_TIME to "
|
||||
<< api->GetOptionValue(Option::MAX_EXPOSURE_TIME);
|
||||
LOG(INFO) << "Set DESIRED_BRIGHTNESS to "
|
||||
<< api->GetOptionValue(Option::DESIRED_BRIGHTNESS);
|
||||
|
||||
s2100/s210a:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
bool ok;
|
||||
auto &&request = api->SelectStreamRequest(&ok);
|
||||
if (!ok) return 1;
|
||||
api->ConfigStreamRequest(request);
|
||||
|
||||
// auto-exposure: 0
|
||||
api->SetOptionValue(Option::EXPOSURE_MODE, 0);
|
||||
|
||||
// max_gain: range [0,255], default 8
|
||||
api->SetOptionValue(Option::MAX_GAIN, 8);
|
||||
// max_exposure_time: range [0,1000], default 333
|
||||
api->SetOptionValue(Option::MAX_EXPOSURE_TIME, 333);
|
||||
// desired_brightness: range [1,255], default 122
|
||||
api->SetOptionValue(Option::DESIRED_BRIGHTNESS, 122);
|
||||
// min_exposure_time: range [0,1000], default 0
|
||||
api->SetOptionValue(Option::MIN_EXPOSURE_TIME, 0);
|
||||
|
||||
LOG(INFO) << "Enable auto-exposure";
|
||||
LOG(INFO) << "Set EXPOSURE_MODE to "
|
||||
<< api->GetOptionValue(Option::EXPOSURE_MODE);
|
||||
LOG(INFO) << "Set MAX_GAIN to " << api->GetOptionValue(Option::MAX_GAIN);
|
||||
LOG(INFO) << "Set MAX_EXPOSURE_TIME to "
|
||||
<< api->GetOptionValue(Option::MAX_EXPOSURE_TIME);
|
||||
LOG(INFO) << "Set DESIRED_BRIGHTNESS to "
|
||||
<< api->GetOptionValue(Option::DESIRED_BRIGHTNESS);
|
||||
LOG(INFO) << "Set MIN_EXPOSURE_TIME to "
|
||||
<< api->GetOptionValue(Option::MIN_EXPOSURE_TIME);
|
||||
|
||||
|
||||
Reference running results on Linux:
|
||||
|
||||
s1030:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/ctrl_auto_exposure
|
||||
I0513 14:07:57.963943 31845 utils.cc:26] Detecting MYNT EYE devices
|
||||
I0513 14:07:58.457536 31845 utils.cc:33] MYNT EYE devices:
|
||||
I0513 14:07:58.457563 31845 utils.cc:37] index: 0, name: MYNT-EYE-S1000
|
||||
I0513 14:07:58.457567 31845 utils.cc:43] Only one MYNT EYE device, select index: 0
|
||||
I0513 14:07:58.474916 31845 auto_exposure.cc:37] Enable auto-exposure
|
||||
I0513 14:07:58.491058 31845 auto_exposure.cc:38] Set MAX_GAIN to 48
|
||||
I0513 14:07:58.505131 31845 auto_exposure.cc:39] Set MAX_EXPOSURE_TIME to 240
|
||||
I0513 14:07:58.521375 31845 auto_exposure.cc:41] Set DESIRED_BRIGHTNESS to 192
|
||||
|
||||
|
||||
s2100/s210a:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/ctrl_auto_exposure
|
||||
I/utils.cc:30 Detecting MYNT EYE devices
|
||||
I/utils.cc:40 MYNT EYE devices:
|
||||
I/utils.cc:43 index: 0, name: MYNT-EYE-S210A, sn: 07C41A190009071F
|
||||
I/utils.cc:51 Only one MYNT EYE device, select index: 0
|
||||
I/utils.cc:79 MYNT EYE devices:
|
||||
I/utils.cc:82 index: 0, request: width: 1280, height: 400, format: Format::BGR888, fps: 10
|
||||
I/utils.cc:82 index: 1, request: width: 1280, height: 400, format: Format::BGR888, fps: 20
|
||||
I/utils.cc:82 index: 2, request: width: 1280, height: 400, format: Format::BGR888, fps: 30
|
||||
I/utils.cc:82 index: 3, request: width: 1280, height: 400, format: Format::BGR888, fps: 60
|
||||
I/utils.cc:82 index: 4, request: width: 2560, height: 800, format: Format::BGR888, fps: 10
|
||||
I/utils.cc:82 index: 5, request: width: 2560, height: 800, format: Format::BGR888, fps: 20
|
||||
I/utils.cc:82 index: 6, request: width: 2560, height: 800, format: Format::BGR888, fps: 30
|
||||
I/utils.cc:93 There are 7 stream requests, select index:
|
||||
3
|
||||
I/auto_exposure.cc:72 Enable auto-exposure
|
||||
I/auto_exposure.cc:73 Set EXPOSURE_MODE to 0
|
||||
I/auto_exposure.cc:75 Set MAX_GAIN to 8
|
||||
I/auto_exposure.cc:76 Set MAX_EXPOSURE_TIME to 333
|
||||
I/auto_exposure.cc:78 Set DESIRED_BRIGHTNESS to 122
|
||||
I/auto_exposure.cc:80 Set MIN_EXPOSURE_TIME to 0
|
||||
|
||||
|
||||
The sample program displays an image with a real exposure time in the upper left corner, in milliseconds.
|
||||
|
||||
Complete code examples, see `auto_exposure.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/control/auto_exposure.cc>`_ .
|
13
docs/src/control/contents.rst
Normal file
|
@ -0,0 +1,13 @@
|
|||
.. _ctrl:
|
||||
|
||||
MYNT® EYE Control
|
||||
=================
|
||||
|
||||
.. toctree::
|
||||
|
||||
framerate
|
||||
imu_range
|
||||
auto_exposure
|
||||
manual_exposure
|
||||
infrared
|
||||
imu_low_pass_filter
|
108
docs/src/control/framerate.rst
Normal file
|
@ -0,0 +1,108 @@
|
|||
.. _framerate:
|
||||
|
||||
Set the frame rate of image & IMU frequency
|
||||
============================================
|
||||
|
||||
Using the ``SetOptionValue()`` function in the API, you can set various control valuesfor the current device.
|
||||
|
||||
For mynteye s1030, to set the image frame rate and IMU frequency, set ``Option::FRAME_RATE`` and ``Option::IMU_FREQUENCY``.
|
||||
|
||||
.. Attention::
|
||||
|
||||
* The effective fps of the image: 10, 15, 20, 25, 30, 35, 40, 45, 50, 55.
|
||||
* The effective frequency of IMU: 100, 200, 250, 333, 500.
|
||||
|
||||
For mynteye s2100/s210a, the image frame rate should be selected when running the sample, and the frame rate and resolution are combined as follows:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
index: 0, request: width: 1280, height: 400, format: Format::BGR888, fps: 10
|
||||
index: 1, request: width: 1280, height: 400, format: Format::BGR888, fps: 20
|
||||
index: 2, request: width: 1280, height: 400, format: Format::BGR888, fps: 30
|
||||
index: 3, request: width: 1280, height: 400, format: Format::BGR888, fps: 60
|
||||
index: 4, request: width: 2560, height: 800, format: Format::BGR888, fps: 10
|
||||
index: 5, request: width: 2560, height: 800, format: Format::BGR888, fps: 20
|
||||
index: 6, request: width: 2560, height: 800, format: Format::BGR888, fps: 30
|
||||
|
||||
|
||||
Reference Code:
|
||||
|
||||
s1030:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
// Attention: must set FRAME_RATE and IMU_FREQUENCY together, otherwise won't
|
||||
// succeed.
|
||||
|
||||
// FRAME_RATE values: 10, 15, 20, 25, 30, 35, 40, 45, 50, 55
|
||||
api->SetOptionValue(Option::FRAME_RATE, 25);
|
||||
// IMU_FREQUENCY values: 100, 200, 250, 333, 500
|
||||
api->SetOptionValue(Option::IMU_FREQUENCY, 500);
|
||||
|
||||
LOG(INFO) << "Set FRAME_RATE to " << api->GetOptionValue(Option::FRAME_RATE);
|
||||
LOG(INFO) << "Set IMU_FREQUENCY to "
|
||||
<< api->GetOptionValue(Option::IMU_FREQUENCY);
|
||||
|
||||
s2100/s210a:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
if (!api) return 1;
|
||||
|
||||
bool ok;
|
||||
auto &&request = api->SelectStreamRequest(&ok);
|
||||
if (!ok) return 1;
|
||||
api->ConfigStreamRequest(request);
|
||||
|
||||
LOG(INFO) << "Please set frame rate by 'SelectStreamRequest()'";
|
||||
|
||||
|
||||
|
||||
Reference running results on Linux:
|
||||
|
||||
s1030:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/ctrl_framerate
|
||||
I0513 14:05:57.218222 31813 utils.cc:26] Detecting MYNT EYE devices
|
||||
I0513 14:05:57.899404 31813 utils.cc:33] MYNT EYE devices:
|
||||
I0513 14:05:57.899430 31813 utils.cc:37] index: 0, name: MYNT-EYE-S1000
|
||||
I0513 14:05:57.899435 31813 utils.cc:43] Only one MYNT EYE device, select index: 0
|
||||
I0513 14:05:58.076257 31813 framerate.cc:36] Set FRAME_RATE to 25
|
||||
I0513 14:05:58.076836 31813 framerate.cc:37] Set IMU_FREQUENCY to 500
|
||||
I0513 14:06:21.702361 31813 framerate.cc:82] Time beg: 2018-05-13 14:05:58.384967, end: 2018-05-13 14:06:21.666115, cost: 23281.1ms
|
||||
I0513 14:06:21.702388 31813 framerate.cc:85] Img count: 573, fps: 24.6122
|
||||
I0513 14:06:21.702404 31813 framerate.cc:87] Imu count: 11509, hz: 494.348
|
||||
|
||||
s2100/s210a:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/ctrl_framerate
|
||||
I/utils.cc:30 Detecting MYNT EYE devices
|
||||
I/utils.cc:40 MYNT EYE devices:
|
||||
I/utils.cc:43 index: 0, name: MYNT-EYE-S210A, sn: 07C41A190009071F
|
||||
I/utils.cc:51 Only one MYNT EYE device, select index: 0
|
||||
I/utils.cc:79 MYNT EYE devices:
|
||||
I/utils.cc:82 index: 0, request: width: 1280, height: 400, format: Format::BGR888, fps: 10
|
||||
I/utils.cc:82 index: 1, request: width: 1280, height: 400, format: Format::BGR888, fps: 20
|
||||
I/utils.cc:82 index: 2, request: width: 1280, height: 400, format: Format::BGR888, fps: 30
|
||||
I/utils.cc:82 index: 3, request: width: 1280, height: 400, format: Format::BGR888, fps: 60
|
||||
I/utils.cc:82 index: 4, request: width: 2560, height: 800, format: Format::BGR888, fps: 10
|
||||
I/utils.cc:82 index: 5, request: width: 2560, height: 800, format: Format::BGR888, fps: 20
|
||||
I/utils.cc:82 index: 6, request: width: 2560, height: 800, format: Format::BGR888, fps: 30
|
||||
I/utils.cc:93 There are 7 stream requests, select index:
|
||||
2
|
||||
I/framerate.cc:54 Please set frame rate by 'SelectStreamRequest()'
|
||||
I/framerate.cc:99 Time beg: 2018-12-29 10:05:08.203095, end: 2018-12-29 10:08:20.074969, cost: 191872ms
|
||||
I/framerate.cc:102 Img count: 5759, fps: 30.0148
|
||||
I/framerate.cc:104 Imu count: 77163, hz: 402.159
|
||||
|
||||
|
||||
After the sample program finishes running with ``ESC/Q``, it will output the calculated value of the frame rate of image & IMU frequency.
|
||||
|
||||
Complete code samples,please see `framerate.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/control/framerate.cc>`_ .
|
63
docs/src/control/imu_low_pass_filter.rst
Normal file
|
@ -0,0 +1,63 @@
|
|||
.. _imu_low_pass_filter:
|
||||
|
||||
Low-pass Filter
|
||||
===============
|
||||
|
||||
Using the ``SetOptionValue()`` function in the API, you can set various control values for the current device.
|
||||
|
||||
To set the value of accelerometer low-pass filter and gyroscope low-pass filter, set ``Option::ACCELEROMETER_LOW_PASS_FILTER`` and ``Option::GYROSCOPE_LOW_PASS_FILTER``.
|
||||
|
||||
.. Attention::
|
||||
* s1030 doesn't support this feature
|
||||
|
||||
Reference Code:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
if (!api) return 1;
|
||||
|
||||
bool ok;
|
||||
auto &&request = api->SelectStreamRequest(&ok);
|
||||
if (!ok) return 1;
|
||||
api->ConfigStreamRequest(request);
|
||||
|
||||
// ACCELEROMETER_RANGE values: 0, 1, 2
|
||||
api->SetOptionValue(Option::ACCELEROMETER_LOW_PASS_FILTER, 2);
|
||||
// GYROSCOPE_RANGE values: 23, 64
|
||||
api->SetOptionValue(Option::GYROSCOPE_LOW_PASS_FILTER, 64);
|
||||
|
||||
LOG(INFO) << "Set ACCELEROMETER_LOW_PASS_FILTER to "
|
||||
<< api->GetOptionValue(Option::ACCELEROMETER_LOW_PASS_FILTER);
|
||||
LOG(INFO) << "Set GYROSCOPE_LOW_PASS_FILTER to "
|
||||
<< api->GetOptionValue(Option::GYROSCOPE_LOW_PASS_FILTER);
|
||||
|
||||
|
||||
Reference running results on Linux:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/ctrl_imu_low_pass_filter
|
||||
I/utils.cc:30 Detecting MYNT EYE devices
|
||||
I/utils.cc:40 MYNT EYE devices:
|
||||
I/utils.cc:43 index: 0, name: MYNT-EYE-S210A, sn: 07C41A190009071F
|
||||
I/utils.cc:51 Only one MYNT EYE device, select index: 0
|
||||
I/utils.cc:79 MYNT EYE devices:
|
||||
I/utils.cc:82 index: 0, request: width: 1280, height: 400, format: Format::BGR888, fps: 10
|
||||
I/utils.cc:82 index: 1, request: width: 1280, height: 400, format: Format::BGR888, fps: 20
|
||||
I/utils.cc:82 index: 2, request: width: 1280, height: 400, format: Format::BGR888, fps: 30
|
||||
I/utils.cc:82 index: 3, request: width: 1280, height: 400, format: Format::BGR888, fps: 60
|
||||
I/utils.cc:82 index: 4, request: width: 2560, height: 800, format: Format::BGR888, fps: 10
|
||||
I/utils.cc:82 index: 5, request: width: 2560, height: 800, format: Format::BGR888, fps: 20
|
||||
I/utils.cc:82 index: 6, request: width: 2560, height: 800, format: Format::BGR888, fps: 30
|
||||
I/utils.cc:93 There are 7 stream requests, select index:
|
||||
1
|
||||
I/imu_low_pass_filter.cc:48 Set ACCELEROMETER_LOW_PASS_FILTER to 2
|
||||
I/imu_low_pass_filter.cc:50 Set GYROSCOPE_LOW_PASS_FILTER to 64
|
||||
I/imu_low_pass_filter.cc:96 Time beg: 2018-12-29 13:53:42.296299, end: 2018-12-29 14:06:33.295960, cost: 771000ms
|
||||
I/imu_low_pass_filter.cc:99 Img count: 15412, fps: 19.9896
|
||||
I/imu_low_pass_filter.cc:101 Imu count: 309891, hz: 401.934
|
||||
|
||||
After the sample program finishes running with ``ESC/Q``, the low-pass filter of imu setting is complete. The ranges will be kept inside the hardware and not affected by power off.
|
||||
|
||||
Complete code samples,please see `imu_low_pass_filter.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/control/imu_low_pass_filter.cc>`_ 。
|
108
docs/src/control/imu_range.rst
Normal file
|
@ -0,0 +1,108 @@
|
|||
.. _imu_range:
|
||||
|
||||
Set the range of accelerometer & gyroscope
|
||||
==========================================
|
||||
|
||||
Using the ``SetOptionValue()`` function in the API, you can set various control values for the current device.
|
||||
|
||||
To set the range of accelerometer and gyroscope, set ``Option::ACCELEROMETER_RANGE`` and ``Option::GYROSCOPE_RANGE``.
|
||||
|
||||
.. Attention::
|
||||
For mynteye s1030, the available settings are:
|
||||
|
||||
* The effective range of accelerometer(unit:g): 4, 8, 16, 32.
|
||||
* Gyroscope Range Valid value (unit: DEG/S): 500, 1000, 2000, 4000.
|
||||
|
||||
For mynteye s2100/s210a, the available settings are:
|
||||
|
||||
* The effective range of accelerometer(unit:g): 6, 12, 24, 32.
|
||||
* The effective range of gyroscope(unit:deg/s): 250, 500, 1000, 2000, 4000.
|
||||
|
||||
Reference Code:
|
||||
|
||||
s1030:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
if (!api)
|
||||
return 1;
|
||||
|
||||
// ACCELEROMETER_RANGE values: 4, 8, 16, 32
|
||||
api->SetOptionValue(Option::ACCELEROMETER_RANGE, 8);
|
||||
// GYROSCOPE_RANGE values: 500, 1000, 2000, 4000
|
||||
api->SetOptionValue(Option::GYROSCOPE_RANGE, 1000);
|
||||
|
||||
LOG(INFO) << "Set ACCELEROMETER_RANGE to "
|
||||
<< api->GetOptionValue(Option::ACCELEROMETER_RANGE);
|
||||
LOG(INFO) << "Set GYROSCOPE_RANGE to "
|
||||
<< api->GetOptionValue(Option::GYROSCOPE_RANGE);
|
||||
|
||||
s2100/s210a:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
if (!api) return 1;
|
||||
|
||||
bool ok;
|
||||
auto &&request = api->SelectStreamRequest(&ok);
|
||||
if (!ok) return 1;
|
||||
api->ConfigStreamRequest(request);
|
||||
|
||||
// ACCELEROMETER_RANGE values: 6, 12, 24, 32
|
||||
api->SetOptionValue(Option::ACCELEROMETER_RANGE, 6);
|
||||
// GYROSCOPE_RANGE values: 250, 500, 1000, 2000, 4000
|
||||
api->SetOptionValue(Option::GYROSCOPE_RANGE, 1000);
|
||||
|
||||
LOG(INFO) << "Set ACCELEROMETER_RANGE to "
|
||||
<< api->GetOptionValue(Option::ACCELEROMETER_RANGE);
|
||||
LOG(INFO) << "Set GYROSCOPE_RANGE to "
|
||||
<< api->GetOptionValue(Option::GYROSCOPE_RANGE);
|
||||
|
||||
|
||||
Reference running results on Linux:
|
||||
|
||||
s1030:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/ctrl_imu_range
|
||||
I/utils.cc:28 Detecting MYNT EYE devices
|
||||
I/utils.cc:38 MYNT EYE devices:
|
||||
I/utils.cc:41 index: 0, name: MYNT-EYE-S1030, sn: 4B4C1F1100090712
|
||||
I/utils.cc:49 Only one MYNT EYE device, select index: 0
|
||||
I/imu_range.cc:34 Set ACCELEROMETER_RANGE to 8
|
||||
I/imu_range.cc:36 Set GYROSCOPE_RANGE to 1000
|
||||
I/imu_range.cc:81 Time beg: 2018-11-21 15:34:57.726428, end: 2018-11-21 15:35:12.190478, cost: 14464ms
|
||||
I/imu_range.cc:84 Img count: 363, fps: 25.0967
|
||||
I/imu_range.cc:86 Imu count: 2825, hz: 195.312
|
||||
|
||||
s2100/s210a:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/ctrl_imu_range
|
||||
I/utils.cc:30 Detecting MYNT EYE devices
|
||||
I/utils.cc:40 MYNT EYE devices:
|
||||
I/utils.cc:43 index: 0, name: MYNT-EYE-S210A, sn: 07C41A190009071F
|
||||
I/utils.cc:51 Only one MYNT EYE device, select index: 0
|
||||
I/utils.cc:79 MYNT EYE devices:
|
||||
I/utils.cc:82 index: 0, request: width: 1280, height: 400, format: Format::BGR888, fps: 10
|
||||
I/utils.cc:82 index: 1, request: width: 1280, height: 400, format: Format::BGR888, fps: 20
|
||||
I/utils.cc:82 index: 2, request: width: 1280, height: 400, format: Format::BGR888, fps: 30
|
||||
I/utils.cc:82 index: 3, request: width: 1280, height: 400, format: Format::BGR888, fps: 60
|
||||
I/utils.cc:82 index: 4, request: width: 2560, height: 800, format: Format::BGR888, fps: 10
|
||||
I/utils.cc:82 index: 5, request: width: 2560, height: 800, format: Format::BGR888, fps: 20
|
||||
I/utils.cc:82 index: 6, request: width: 2560, height: 800, format: Format::BGR888, fps: 30
|
||||
I/utils.cc:93 There are 7 stream requests, select index:
|
||||
3
|
||||
I/imu_range.cc:51 Set ACCELEROMETER_RANGE to 6
|
||||
I/imu_range.cc:53 Set GYROSCOPE_RANGE to 1000
|
||||
I/imu_range.cc:98 Time beg: 2018-12-29 10:03:10.706211, end: 2018-12-29 10:04:12.497427, cost: 61791.2ms
|
||||
I/imu_range.cc:101 Img count: 3706, fps: 59.9762
|
||||
I/imu_range.cc:103 Imu count: 24873, hz: 402.533
|
||||
|
||||
After the sample program finishes running with ``ESC/Q``, the ranges of imu setting is complete. The ranges will be kept inside the hardware and not affected by power off.
|
||||
|
||||
Complete code samples,please see `imu_range.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/control/imu_range.cc>`_.
|
51
docs/src/control/infrared.rst
Normal file
|
@ -0,0 +1,51 @@
|
|||
.. _infrared:
|
||||
|
||||
Enable IR and its adjustments function
|
||||
=======================================
|
||||
|
||||
Using the ``SetOptionValue()`` function of the API, you can set various control values for the current open device.
|
||||
|
||||
Enabling IR is setting ``Option::IR_CONTROL`` greater than 0. The greater the value, the greater the IR's intensity.
|
||||
|
||||
.. Attention::
|
||||
* mynteye s2100/s210a doesn't support this feature.
|
||||
|
||||
Reference Code:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
// Detect infrared add-ons
|
||||
LOG(INFO) << "Support infrared: " << std::boolalpha
|
||||
<< api->Supports(AddOns::INFRARED);
|
||||
LOG(INFO) << "Support infrared2: " << std::boolalpha
|
||||
<< api->Supports(AddOns::INFRARED2);
|
||||
|
||||
// Get infrared intensity range
|
||||
auto &&info = api->GetOptionInfo(Option::IR_CONTROL);
|
||||
LOG(INFO) << Option::IR_CONTROL << ": {" << info << "}";
|
||||
|
||||
// Set infrared intensity value
|
||||
api->SetOptionValue(Option::IR_CONTROL, 80);
|
||||
|
||||
Reference running results on Linux:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/ctrl_infrared
|
||||
I0504 16:16:28.016624 25848 utils.cc:13] Detecting MYNT EYE devices
|
||||
I0504 16:16:28.512462 25848 utils.cc:20] MYNT EYE devices:
|
||||
I0504 16:16:28.512473 25848 utils.cc:24] index: 0, name: MYNT-EYE-S1000
|
||||
I0504 16:16:28.512477 25848 utils.cc:30] Only one MYNT EYE device, select index: 0
|
||||
I0504 16:16:28.520848 25848 infrared.cc:13] Support infrared: true
|
||||
I0504 16:16:28.520869 25848 infrared.cc:15] Support infrared2: true
|
||||
I0504 16:16:28.520889 25848 infrared.cc:20] Option::IR_CONTROL: {min: 0, max: 160, def: 0}
|
||||
|
||||
At this point, if the image is displayed, you can see IR speckle on the image.
|
||||
|
||||
.. attention::
|
||||
|
||||
The hardware will not record the IR value after being turned off. In order to keep IR enabled, you must set the IR value after turning on the device.
|
||||
|
||||
Complete code samples,see `infrared.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/control/infrared.cc>`_ .
|
110
docs/src/control/manual_exposure.rst
Normal file
|
@ -0,0 +1,110 @@
|
|||
.. _manual_exposure:
|
||||
|
||||
Enable manual exposure and its adjustment function
|
||||
===================================================
|
||||
|
||||
Using the ``SetOptionValue()`` function of the API, you can set various control values for the current open device.
|
||||
|
||||
To enabling manual exposure, set ``Option::EXPOSURE_MODE`` to ``1``.
|
||||
|
||||
For mynteye s1030, during manual exposure, the settings available for adjustment are:
|
||||
|
||||
* ``Option::GAIN`` Gain.
|
||||
* ``Option::BRIGHTNESS`` Brightness (Exposure time).
|
||||
* ``Option::CONTRAST`` Contrast (Black level calibration).
|
||||
|
||||
For mynteye s2100/s210a, during manual exposure, the settings available for adjustment are:
|
||||
|
||||
* ``Option::BRIGHTNESS`` Brightness (Exposure time).
|
||||
|
||||
|
||||
Reference Code:
|
||||
|
||||
s1030:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
// manual-exposure: 1
|
||||
api->SetOptionValue(Option::EXPOSURE_MODE, 1);
|
||||
|
||||
// gain: range [0,48], default 24
|
||||
api->SetOptionValue(Option::GAIN, 24);
|
||||
// brightness/exposure_time: range [0,240], default 120
|
||||
api->SetOptionValue(Option::BRIGHTNESS, 120);
|
||||
// contrast/black_level_calibration: range [0,255], default 127
|
||||
api->SetOptionValue(Option::CONTRAST, 127);
|
||||
|
||||
LOG(INFO) << "Enable manual-exposure";
|
||||
LOG(INFO) << "Set GAIN to " << api->GetOptionValue(Option::GAIN);
|
||||
LOG(INFO) << "Set BRIGHTNESS to " << api->GetOptionValue(Option::BRIGHTNESS);
|
||||
LOG(INFO) << "Set CONTRAST to " << api->GetOptionValue(Option::CONTRAST);
|
||||
|
||||
s2100/s210a:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
bool ok;
|
||||
auto &&request = api->SelectStreamRequest(&ok);
|
||||
if (!ok) return 1;
|
||||
api->ConfigStreamRequest(request);
|
||||
|
||||
// manual-exposure: 1
|
||||
api->SetOptionValue(Option::EXPOSURE_MODE, 1);
|
||||
|
||||
// brightness/exposure_time: range [0,240], default 120
|
||||
api->SetOptionValue(Option::BRIGHTNESS, 120);
|
||||
|
||||
LOG(INFO) << "Enable manual-exposure";
|
||||
LOG(INFO) << "Set EXPOSURE_MODE to "
|
||||
<< api->GetOptionValue(Option::EXPOSURE_MODE);
|
||||
LOG(INFO) << "Set BRIGHTNESS to "
|
||||
<< api->GetOptionValue(Option::BRIGHTNESS);
|
||||
|
||||
|
||||
Reference running results on Linux:
|
||||
|
||||
s1030:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/ctrl_manual_exposure
|
||||
I0513 14:09:17.104431 31908 utils.cc:26] Detecting MYNT EYE devices
|
||||
I0513 14:09:17.501519 31908 utils.cc:33] MYNT EYE devices:
|
||||
I0513 14:09:17.501551 31908 utils.cc:37] index: 0, name: MYNT-EYE-S1000
|
||||
I0513 14:09:17.501562 31908 utils.cc:43] Only one MYNT EYE device, select index: 0
|
||||
I0513 14:09:17.552918 31908 manual_exposure.cc:37] Enable manual-exposure
|
||||
I0513 14:09:17.552953 31908 manual_exposure.cc:38] Set GAIN to 24
|
||||
I0513 14:09:17.552958 31908 manual_exposure.cc:39] Set BRIGHTNESS to 120
|
||||
I0513 14:09:17.552963 31908 manual_exposure.cc:40] Set CONTRAST to 127
|
||||
|
||||
s2100/s210a:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/ctrl_manual_exposure
|
||||
I/utils.cc:30 Detecting MYNT EYE devices
|
||||
I/utils.cc:40 MYNT EYE devices:
|
||||
I/utils.cc:43 index: 0, name: MYNT-EYE-S210A, sn: 07C41A190009071F
|
||||
I/utils.cc:51 Only one MYNT EYE device, select index: 0
|
||||
I/utils.cc:79 MYNT EYE devices:
|
||||
I/utils.cc:82 index: 0, request: width: 1280, height: 400, format: Format::BGR888, fps: 10
|
||||
I/utils.cc:82 index: 1, request: width: 1280, height: 400, format: Format::BGR888, fps: 20
|
||||
I/utils.cc:82 index: 2, request: width: 1280, height: 400, format: Format::BGR888, fps: 30
|
||||
I/utils.cc:82 index: 3, request: width: 1280, height: 400, format: Format::BGR888, fps: 60
|
||||
I/utils.cc:82 index: 4, request: width: 2560, height: 800, format: Format::BGR888, fps: 10
|
||||
I/utils.cc:82 index: 5, request: width: 2560, height: 800, format: Format::BGR888, fps: 20
|
||||
I/utils.cc:82 index: 6, request: width: 2560, height: 800, format: Format::BGR888, fps: 30
|
||||
I/utils.cc:93 There are 7 stream requests, select index:
|
||||
3
|
||||
I/manual_exposure.cc:62 Enable manual-exposure
|
||||
I/manual_exposure.cc:63 Set EXPOSURE_MODE to 1
|
||||
I/manual_exposure.cc:65 Set BRIGHTNESS to 120
|
||||
|
||||
|
||||
The sample program displays an image with a real exposure time in the upper left corner, in milliseconds.
|
||||
|
||||
Complete code samples,see `manual_exposure.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/control/manual_exposure.cc>`_ .
|
22
docs/src/data/contents.rst
Normal file
|
@ -0,0 +1,22 @@
|
|||
.. _data:
|
||||
|
||||
MYNT® EYE Data
|
||||
==============
|
||||
|
||||
.. toctree::
|
||||
|
||||
get_device_info
|
||||
get_img_params
|
||||
get_imu_params
|
||||
get_stereo
|
||||
get_stereo_rectified
|
||||
get_disparity
|
||||
get_depth
|
||||
get_points
|
||||
get_imu
|
||||
get_imu_correspondence
|
||||
get_from_callbacks
|
||||
get_with_plugin
|
||||
save_params
|
||||
write_img_params
|
||||
write_imu_params
|
54
docs/src/data/get_depth.rst
Normal file
|
@ -0,0 +1,54 @@
|
|||
.. _get_depth:
|
||||
|
||||
Get depth image
|
||||
===============
|
||||
|
||||
Depth images belongs to the upper layer of synthetic data. You need to start the ``EnableStreamData()`` beforehand, to get it through ``GetStreamData()``. In addition, it should be check not be empty before use.
|
||||
|
||||
For detailed process description, please see :ref:`get_stereo` :ref:`get_stereo_rectified`.
|
||||
|
||||
In addition, it is recommended to use plugins to calculate depth: Depth images work better and operate faster. Please refer to :ref:`get_with_plugin`.
|
||||
|
||||
Reference code snippet:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
api->EnableStreamData(Stream::DEPTH);
|
||||
|
||||
api->Start(Source::VIDEO_STREAMING);
|
||||
|
||||
cv::namedWindow("frame");
|
||||
cv::namedWindow("depth");
|
||||
|
||||
while (true) {
|
||||
api->WaitForStreams();
|
||||
|
||||
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
||||
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
||||
|
||||
cv::Mat img;
|
||||
cv::hconcat(left_data.frame, right_data.frame, img);
|
||||
cv::imshow("frame", img);
|
||||
|
||||
auto &&depth_data = api->GetStreamData(Stream::DEPTH);
|
||||
if (!depth_data.frame.empty()) {
|
||||
cv::imshow("depth", depth_data.frame); // CV_16UC1
|
||||
}
|
||||
|
||||
char key = static_cast<char>(cv::waitKey(1));
|
||||
if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
api->Stop(Source::VIDEO_STREAMING);
|
||||
|
||||
The above code uses OpenCV to display the image. When the display window is selected, pressing ``ESC/Q`` will end the program.
|
||||
|
||||
Complete code examples, see `get_depth.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/get_depth.cc>`_ .
|
||||
|
||||
.. tip::
|
||||
|
||||
Preview the value of a region of the depth image, see `get_depth_with_region.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/api/get_depth_with_region.cc>`_ .
|
41
docs/src/data/get_device_info.rst
Normal file
|
@ -0,0 +1,41 @@
|
|||
.. _get_device_info:
|
||||
|
||||
Get device information
|
||||
======================
|
||||
|
||||
Use ``GetInfo()`` function to get various current information values.
|
||||
|
||||
Reference code snippet:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
LOG(INFO) << "Device name: " << api->GetInfo(Info::DEVICE_NAME);
|
||||
LOG(INFO) << "Serial number: " << api->GetInfo(Info::SERIAL_NUMBER);
|
||||
LOG(INFO) << "Firmware version: " << api->GetInfo(Info::FIRMWARE_VERSION);
|
||||
LOG(INFO) << "Hardware version: " << api->GetInfo(Info::HARDWARE_VERSION);
|
||||
LOG(INFO) << "Spec version: " << api->GetInfo(Info::SPEC_VERSION);
|
||||
LOG(INFO) << "Lens type: " << api->GetInfo(Info::LENS_TYPE);
|
||||
LOG(INFO) << "IMU type: " << api->GetInfo(Info::IMU_TYPE);
|
||||
LOG(INFO) << "Nominal baseline: " << api->GetInfo(Info::NOMINAL_BASELINE);
|
||||
|
||||
Reference result on Linux:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/get_device_info
|
||||
I0503 16:40:21.109391 32106 utils.cc:13] Detecting MYNT EYE devices
|
||||
I0503 16:40:21.604116 32106 utils.cc:20] MYNT EYE devices:
|
||||
I0503 16:40:21.604127 32106 utils.cc:24] index: 0, name: MYNT-EYE-S1000
|
||||
I0503 16:40:21.604142 32106 utils.cc:30] Only one MYNT EYE device, select index: 0
|
||||
I0503 16:40:21.615054 32106 get_device_info.cc:10] Device name: MYNT-EYE-S1000
|
||||
I0503 16:40:21.615113 32106 get_device_info.cc:11] Serial number: 0610243700090720
|
||||
I0503 16:40:21.615129 32106 get_device_info.cc:12] Firmware version: 2.0
|
||||
I0503 16:40:21.615139 32106 get_device_info.cc:13] Hardware version: 2.0
|
||||
I0503 16:40:21.615146 32106 get_device_info.cc:14] Spec version: 1.0
|
||||
I0503 16:40:21.615155 32106 get_device_info.cc:15] Lens type: 0000
|
||||
I0503 16:40:21.615164 32106 get_device_info.cc:16] IMU type: 0000
|
||||
I0503 16:40:21.615171 32106 get_device_info.cc:17] Nominal baseline: 120
|
||||
|
||||
Complete code examples, see `get_device_info.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/get_device_info.cc>`_ .
|
62
docs/src/data/get_disparity.rst
Normal file
|
@ -0,0 +1,62 @@
|
|||
.. _get_disparity:
|
||||
|
||||
Get disparity image
|
||||
===================
|
||||
|
||||
Disparity image belongs to the upper layer of synthetic data. You need to start the ``EnableStreamData()`` beforehand, to get it through ``GetStreamData()``. In addition, it should be check not be empty before use.
|
||||
|
||||
For detailed process description, please see :ref:`get_stereo` :ref:`get_stereo_rectified` .
|
||||
|
||||
It is recommended to use plugin to calculate depth: the depth map will be better with a higher frame rate. Please see :ref:`get_with_plugin` .
|
||||
|
||||
.. tip::
|
||||
The SetDisparityComputingMethodType method is used to change disparity computing method. Currently, BM and SGBM are available, and SGBM is used by default in sdk.
|
||||
|
||||
Reference code snippet:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
// api->EnableStreamData(Stream::DISPARITY);
|
||||
api->EnableStreamData(Stream::DISPARITY_NORMALIZED);
|
||||
|
||||
api->SetDisparityComputingMethodType(DisparityComputingMethod::BM);
|
||||
|
||||
api->Start(Source::VIDEO_STREAMING);
|
||||
|
||||
cv::namedWindow("frame");
|
||||
// cv::namedWindow("disparity");
|
||||
cv::namedWindow("disparity_normalized");
|
||||
|
||||
while (true) {
|
||||
api->WaitForStreams();
|
||||
|
||||
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
||||
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
||||
|
||||
cv::Mat img;
|
||||
cv::hconcat(left_data.frame, right_data.frame, img);
|
||||
cv::imshow("frame", img);
|
||||
|
||||
// auto &&disp_data = api->GetStreamData(Stream::DISPARITY);
|
||||
// if (!disp_data.frame.empty()) {
|
||||
// cv::imshow("disparity", disp_data.frame);
|
||||
// }
|
||||
|
||||
auto &&disp_norm_data = api->GetStreamData(Stream::DISPARITY_NORMALIZED);
|
||||
if (!disp_norm_data.frame.empty()) {
|
||||
cv::imshow("disparity_normalized", disp_norm_data.frame); // CV_8UC1
|
||||
}
|
||||
|
||||
char key = static_cast<char>(cv::waitKey(1));
|
||||
if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
api->Stop(Source::VIDEO_STREAMING);
|
||||
|
||||
The above code uses OpenCV to display the image. Select the display window, press ``ESC/Q`` to exit in the program.
|
||||
|
||||
Complete code examples, see `get_disparity.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/get_disparity.cc>`_ .
|
119
docs/src/data/get_from_callbacks.rst
Normal file
|
@ -0,0 +1,119 @@
|
|||
.. _get_from_callbacks:
|
||||
|
||||
Get data from callbacks
|
||||
========================
|
||||
|
||||
API offers function ``SetStreamCallback()`` and ``SetMotionCallback()`` to set callbacks for various data.
|
||||
|
||||
.. attention::
|
||||
|
||||
Make sure to not block callback. If the data processing time is too long, use the callback as a data producer.
|
||||
|
||||
Reference code snippet:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
// Attention: must not block the callbacks.
|
||||
|
||||
// Get left image from callback
|
||||
std::atomic_uint left_count(0);
|
||||
api->SetStreamCallback(
|
||||
Stream::LEFT, [&left_count](const api::StreamData &data) {
|
||||
CHECK_NOTNULL(data.img);
|
||||
++left_count;
|
||||
});
|
||||
|
||||
// Get depth image from callback
|
||||
api->EnableStreamData(Stream::DEPTH);
|
||||
std::atomic_uint depth_count(0);
|
||||
cv::Mat depth;
|
||||
std::mutex depth_mtx;
|
||||
api->SetStreamCallback(
|
||||
Stream::DEPTH,
|
||||
[&depth_count, &depth, &depth_mtx](const api::StreamData &data) {
|
||||
UNUSED(data)
|
||||
++depth_count;
|
||||
{
|
||||
std::lock_guard<std::mutex> _(depth_mtx);
|
||||
depth = data.frame;
|
||||
}
|
||||
});
|
||||
|
||||
// Get motion data from callback
|
||||
std::atomic_uint imu_count(0);
|
||||
std::shared_ptr<mynteye::ImuData> imu;
|
||||
std::mutex imu_mtx;
|
||||
api->SetMotionCallback(
|
||||
[&imu_count, &imu, &imu_mtx](const api::MotionData &data) {
|
||||
CHECK_NOTNULL(data.imu);
|
||||
++imu_count;
|
||||
{
|
||||
std::lock_guard<std::mutex> _(imu_mtx);
|
||||
imu = data.imu;
|
||||
}
|
||||
});
|
||||
|
||||
api->Start(Source::ALL);
|
||||
|
||||
CVPainter painter;
|
||||
|
||||
cv::namedWindow("frame");
|
||||
cv::namedWindow("depth");
|
||||
|
||||
unsigned int depth_num = 0;
|
||||
while (true) {
|
||||
api->WaitForStreams();
|
||||
|
||||
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
||||
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
||||
|
||||
// Concat left and right as img
|
||||
cv::Mat img;
|
||||
cv::hconcat(left_data.frame, right_data.frame, img);
|
||||
|
||||
// Draw img data and size
|
||||
painter.DrawImgData(img, *left_data.img);
|
||||
|
||||
// Draw imu data
|
||||
if (imu) {
|
||||
std::lock_guard<std::mutex> _(imu_mtx);
|
||||
painter.DrawImuData(img, *imu);
|
||||
}
|
||||
|
||||
// Draw counts
|
||||
std::ostringstream ss;
|
||||
ss << "left: " << left_count << ", depth: " << depth_count
|
||||
<< ", imu: " << imu_count;
|
||||
painter.DrawText(img, ss.str(), CVPainter::BOTTOM_RIGHT);
|
||||
|
||||
// Show img
|
||||
cv::imshow("frame", img);
|
||||
|
||||
// Show depth
|
||||
if (!depth.empty()) {
|
||||
// Is the depth a new one?
|
||||
if (depth_num != depth_count || depth_num == 0) {
|
||||
std::lock_guard<std::mutex> _(depth_mtx);
|
||||
depth_num = depth_count;
|
||||
// LOG(INFO) << "depth_num: " << depth_num;
|
||||
ss.str("");
|
||||
ss.clear();
|
||||
ss << "depth: " << depth_count;
|
||||
painter.DrawText(depth, ss.str());
|
||||
cv::imshow("depth", depth); // CV_16UC1
|
||||
}
|
||||
}
|
||||
|
||||
char key = static_cast<char>(cv::waitKey(1));
|
||||
if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
api->Stop(Source::ALL);
|
||||
|
||||
OpenCV is used to display images and data above. When the window is selected, pressing ``ESC/Q`` will exit program.
|
||||
|
||||
Complete code examples, see `get_from_callbacks.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/get_from_callbacks.cc>`_ .
|
34
docs/src/data/get_img_params.rst
Normal file
|
@ -0,0 +1,34 @@
|
|||
.. _get_img_params:
|
||||
|
||||
Get image calibration parameters
|
||||
================================
|
||||
|
||||
Use ``GetIntrinsics()`` & ``GetExtrinsics()`` to get image calibration parameters.
|
||||
|
||||
Reference code snippet:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
LOG(INFO) << "Intrinsics left: {" << *api->GetIntrinsicsBase(Stream::LEFT)
|
||||
<< "}";
|
||||
LOG(INFO) << "Intrinsics right: {" << *api->GetIntrinsicsBase(Stream::RIGHT)
|
||||
<< "}";
|
||||
LOG(INFO) << "Extrinsics right to left: {"
|
||||
<< api->GetExtrinsics(Stream::RIGHT, Stream::LEFT) << "}";
|
||||
|
||||
Reference result on Linux:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/get_img_params
|
||||
I0510 15:00:22.643263 6980 utils.cc:26] Detecting MYNT EYE devices
|
||||
I0510 15:00:23.138811 6980 utils.cc:33] MYNT EYE devices:
|
||||
I0510 15:00:23.138849 6980 utils.cc:37] index: 0, name: MYNT-EYE-S1000
|
||||
I0510 15:00:23.138855 6980 utils.cc:43] Only one MYNT EYE device, select index: 0
|
||||
I0510 15:00:23.210491 6980 get_img_params.cc:23] Intrinsics left: {width: 752, height: 480, fx: 736.38305001095545776, fy: 723.50066150722432212, cx: 356.91961817119693023, cy: 217.27271340923883258, model: 0, coeffs: [-0.54898645145016478, 0.52837141203888638, 0.00000000000000000, 0.00000000000000000, 0.00000000000000000]}
|
||||
I0510 15:00:23.210551 6980 get_img_params.cc:24] Intrinsics right: {width: 752, height: 480, fx: 736.38305001095545776, fy: 723.50066150722432212, cx: 456.68367112303980093, cy: 250.70083335536796199, model: 0, coeffs: [-0.51012886039889305, 0.38764476500996770, 0.00000000000000000, 0.00000000000000000, 0.00000000000000000]}
|
||||
I0510 15:00:23.210577 6980 get_img_params.cc:26] Extrinsics left to right: {rotation: [0.99701893306553813, -0.00095378124886237, -0.07715139279485062, 0.00144939967628305, 0.99997867219985104, 0.00636823256494144, 0.07714367342455503, -0.00646107164115277, 0.99699905125522237], translation: [-118.88991734400046596, -0.04560580387053091, -3.95313736911933855]}
|
||||
|
||||
Complete code examples, see `get_img_params.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/get_img_params.cc>`_ .
|
66
docs/src/data/get_imu.rst
Normal file
|
@ -0,0 +1,66 @@
|
|||
.. _get_imu_data:
|
||||
|
||||
Get IMU data
|
||||
=============
|
||||
|
||||
The API offers ``Start()`` / ``Stop()`` function to start/stop capturing data. You can set the argument to``Source::MOTION_TRACKING`` to capture IMU data only, or set it to ``Source::ALL`` to capture both image and IMU data.
|
||||
|
||||
During capturing data, you need ``EnableMotionDatas()`` to enable caching in order to get IMU data from ``GetMotionDatas()`` . Otherwise, IMU data is only available through the callback interface, see :ref:`get_from_callbacks` .
|
||||
|
||||
Sample code snippet:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
// Enable this will cache the motion datas until you get them.
|
||||
api->EnableMotionDatas();
|
||||
|
||||
api->Start(Source::ALL);
|
||||
|
||||
CVPainter painter;
|
||||
|
||||
cv::namedWindow("frame");
|
||||
|
||||
while (true) {
|
||||
api->WaitForStreams();
|
||||
|
||||
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
||||
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
||||
|
||||
cv::Mat img;
|
||||
cv::hconcat(left_data.frame, right_data.frame, img);
|
||||
|
||||
auto &&motion_datas = api->GetMotionDatas();
|
||||
/*
|
||||
for (auto &&data : motion_datas) {
|
||||
LOG(INFO) << "Imu frame_id: " << data.imu->frame_id
|
||||
<< ", timestamp: " << data.imu->timestamp
|
||||
<< ", accel_x: " << data.imu->accel[0]
|
||||
<< ", accel_y: " << data.imu->accel[1]
|
||||
<< ", accel_z: " << data.imu->accel[2]
|
||||
<< ", gyro_x: " << data.imu->gyro[0]
|
||||
<< ", gyro_y: " << data.imu->gyro[1]
|
||||
<< ", gyro_z: " << data.imu->gyro[2]
|
||||
<< ", temperature: " << data.imu->temperature;
|
||||
}
|
||||
*/
|
||||
|
||||
painter.DrawImgData(img, *left_data.img);
|
||||
if (!motion_datas.empty()) {
|
||||
painter.DrawImuData(img, *motion_datas[0].imu);
|
||||
}
|
||||
|
||||
cv::imshow("frame", img);
|
||||
|
||||
char key = static_cast<char>(cv::waitKey(1));
|
||||
if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
api->Stop(Source::ALL);
|
||||
|
||||
OpenCV is used to display image and data. When window is selected, press ``ESC/Q`` to exit program.
|
||||
|
||||
Complete code examples, see `get_imu.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/get_imu.cc>`_ .
|
109
docs/src/data/get_imu_correspondence.rst
Normal file
|
@ -0,0 +1,109 @@
|
|||
.. _get_imu_correspondence:
|
||||
|
||||
Get IMU data with timestamp correspondence
|
||||
===========================================
|
||||
|
||||
If wanna get image with timestamp in the middle of IMU datas, you could call `EnableTimestampCorrespondence()`` to enable this feature.
|
||||
|
||||
Reference code snippet:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
// Enable motion datas with timestamp correspondence of some stream
|
||||
api->EnableTimestampCorrespondence(Stream::LEFT);
|
||||
|
||||
api->Start(Source::ALL);
|
||||
|
||||
cv::namedWindow("frame");
|
||||
|
||||
while (true) {
|
||||
api->WaitForStreams();
|
||||
|
||||
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
||||
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
||||
|
||||
auto img_stamp = left_data.img->timestamp;
|
||||
LOG(INFO) << "Img timestamp: " << img_stamp
|
||||
<< ", diff_prev=" << (img_stamp - prev_img_stamp);
|
||||
prev_img_stamp = img_stamp;
|
||||
|
||||
cv::Mat img;
|
||||
cv::hconcat(left_data.frame, right_data.frame, img);
|
||||
|
||||
auto &&motion_datas = api->GetMotionDatas();
|
||||
LOG(INFO) << "Imu count: " << motion_datas.size();
|
||||
for (auto &&data : motion_datas) {
|
||||
auto imu_stamp = data.imu->timestamp;
|
||||
LOG(INFO) << "Imu timestamp: " << imu_stamp
|
||||
<< ", diff_prev=" << (imu_stamp - prev_imu_stamp)
|
||||
<< ", diff_img=" << (1.f + imu_stamp - img_stamp);
|
||||
prev_imu_stamp = imu_stamp;
|
||||
}
|
||||
LOG(INFO);
|
||||
|
||||
cv::imshow("frame", img);
|
||||
|
||||
char key = static_cast<char>(cv::waitKey(1));
|
||||
if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
api->Stop(Source::ALL);
|
||||
|
||||
Reference result on Linux:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./samples/_output/bin/tutorials/get_imu_correspondence
|
||||
I/utils.cc:30 Detecting MYNT EYE devices
|
||||
I/utils.cc:40 MYNT EYE devices:
|
||||
I/utils.cc:43 index: 0, name: MYNT-EYE-S1030, sn: 0281351000090807
|
||||
I/utils.cc:51 Only one MYNT EYE device, select index: 0
|
||||
I/synthetic.cc:126 camera calib model: kannala_brandt
|
||||
I/utils.cc:79 MYNT EYE devices:
|
||||
I/utils.cc:82 index: 0, request: width: 752, height: 480, format: Format::YUYV, fps: 60
|
||||
I/utils.cc:87 Only one stream request, select index: 0
|
||||
I/get_imu_correspondence.cc:50 Img timestamp: 171323050, diff_prev=39990
|
||||
I/get_imu_correspondence.cc:58 Imu count: 13
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171318710, diff_prev=171318710, diff_img=-4352
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171320730, diff_prev=2020, diff_img=-2320
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171322750, diff_prev=2020, diff_img=-304
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171324770, diff_prev=2020, diff_img=1712
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171326790, diff_prev=2020, diff_img=3728
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171328800, diff_prev=2010, diff_img=5744
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171330810, diff_prev=2010, diff_img=7760
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171332840, diff_prev=2030, diff_img=9776
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171334860, diff_prev=2020, diff_img=11808
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171336880, diff_prev=2020, diff_img=13824
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171338900, diff_prev=2020, diff_img=15840
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171340920, diff_prev=2020, diff_img=17872
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171342930, diff_prev=2010, diff_img=19872
|
||||
I/get_imu_correspondence.cc:66
|
||||
I/get_imu_correspondence.cc:50 Img timestamp: 171403040, diff_prev=79990
|
||||
I/get_imu_correspondence.cc:58 Imu count: 20
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171383310, diff_prev=40380, diff_img=-19728
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171385330, diff_prev=2020, diff_img=-17712
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171387350, diff_prev=2020, diff_img=-15696
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171389370, diff_prev=2020, diff_img=-13664
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171391380, diff_prev=2010, diff_img=-11664
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171393390, diff_prev=2010, diff_img=-9648
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171395420, diff_prev=2030, diff_img=-7616
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171397440, diff_prev=2020, diff_img=-5600
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171399460, diff_prev=2020, diff_img=-3584
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171401480, diff_prev=2020, diff_img=-1568
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171403500, diff_prev=2020, diff_img=464
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171405510, diff_prev=2010, diff_img=2464
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171407520, diff_prev=2010, diff_img=4480
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171409540, diff_prev=2020, diff_img=6496
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171411570, diff_prev=2030, diff_img=8528
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171413590, diff_prev=2020, diff_img=10544
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171415610, diff_prev=2020, diff_img=12576
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171417630, diff_prev=2020, diff_img=14592
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171419650, diff_prev=2020, diff_img=16608
|
||||
I/get_imu_correspondence.cc:61 Imu timestamp: 171421660, diff_prev=2010, diff_img=18624
|
||||
|
||||
Complete code examples, see `get_imu_correspondence.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/get_imu_correspondence.cc>`_ .
|
18
docs/src/data/get_imu_params.rst
Normal file
|
@ -0,0 +1,18 @@
|
|||
.. _get_imu_params:
|
||||
|
||||
Get IMU calibration parameters
|
||||
==============================
|
||||
|
||||
Use ``GetMotionIntrinsics()`` & ``GetMotionExtrinsics()`` to get current IMU calibration parameters.
|
||||
|
||||
Reference commands:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
LOG(INFO) << "Motion intrinsics: {" << api->GetMotionIntrinsics() << "}";
|
||||
LOG(INFO) << "Motion extrinsics left to imu: {"
|
||||
<< api->GetMotionExtrinsics(Stream::LEFT) << "}";
|
||||
|
||||
Complete code examples, see `get_imu_params.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/get_imu_params.cc>`_ .
|
57
docs/src/data/get_points.rst
Normal file
|
@ -0,0 +1,57 @@
|
|||
.. _get_points:
|
||||
|
||||
Get point image
|
||||
================
|
||||
|
||||
Point images belongs to upper layer of synthetic data. To get this kind of data through ``GetStreamData()``, you need to start the ``EnableStreamData()`` beforehand. It should be check not empty before use.
|
||||
|
||||
For detail process description, please see :ref:`get_stereo` :ref:`get_stereo_rectified` .
|
||||
|
||||
It is recommended to use plugin to calculate depth: the depth map will be better with a higher frame rate. Please see :ref:`get_with_plugin` for detail.
|
||||
|
||||
Sample code snippet:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
api->EnableStreamData(Stream::POINTS);
|
||||
|
||||
api->Start(Source::VIDEO_STREAMING);
|
||||
|
||||
cv::namedWindow("frame");
|
||||
PCViewer pcviewer;
|
||||
|
||||
while (true) {
|
||||
api->WaitForStreams();
|
||||
|
||||
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
||||
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
||||
|
||||
cv::Mat img;
|
||||
cv::hconcat(left_data.frame, right_data.frame, img);
|
||||
cv::imshow("frame", img);
|
||||
|
||||
auto &&points_data = api->GetStreamData(Stream::POINTS);
|
||||
if (!points_data.frame.empty()) {
|
||||
pcviewer.Update(points_data.frame);
|
||||
}
|
||||
|
||||
char key = static_cast<char>(cv::waitKey(1));
|
||||
if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q
|
||||
break;
|
||||
}
|
||||
if (pcviewer.WasStopped()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
api->Stop(Source::VIDEO_STREAMING);
|
||||
|
||||
`PCL <https://github.com/PointCloudLibrary/pcl>`_ is used to display point images above. Program will close when point image window is closed.
|
||||
|
||||
Complete code examples, see `get_points.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/get_points.cc>`_ .
|
||||
|
||||
.. attention::
|
||||
|
||||
Sample code only compiles when `PCL <https://github.com/PointCloudLibrary/pcl>`_ is ready. If your PCL was installed in a different directory, please set ``CMAKE_PREFIX_PATH`` in `tutorials/CMakeLists.txt <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/CMakeLists.txt>`_ to the path of ``PCLConfig.cmake`` . You can find ``CMAKE_PREFIX_PATH`` near ``find_package(PCL)`` .
|
40
docs/src/data/get_stereo.rst
Normal file
|
@ -0,0 +1,40 @@
|
|||
.. _get_stereo:
|
||||
|
||||
Get original binocular image
|
||||
=============================
|
||||
|
||||
Use ``Start()`` or ``Stop()`` , to start or stop data capturing. If you only need the image data, use ``Source::VIDEO_STREAMING`` .
|
||||
|
||||
When data capturing starts, call ``WaitForStreams()`` function. Once data capturing begins, use ``GetStreamData()`` to get your data.
|
||||
|
||||
Reference commands:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
api->Start(Source::VIDEO_STREAMING);
|
||||
|
||||
cv::namedWindow("frame");
|
||||
|
||||
while (true) {
|
||||
api->WaitForStreams();
|
||||
|
||||
auto &&left_data = api->GetStreamData(Stream::LEFT);
|
||||
auto &&right_data = api->GetStreamData(Stream::RIGHT);
|
||||
|
||||
cv::Mat img;
|
||||
cv::hconcat(left_data.frame, right_data.frame, img);
|
||||
cv::imshow("frame", img);
|
||||
|
||||
char key = static_cast<char>(cv::waitKey(1));
|
||||
if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
api->Stop(Source::VIDEO_STREAMING);
|
||||
|
||||
The above code uses OpenCV to display the image. When the display window is selected, pressing ``ESC/Q`` will end the program.
|
||||
|
||||
Complete code examples, see `get_stereo.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/get_stereo.cc>`_ .
|
51
docs/src/data/get_stereo_rectified.rst
Normal file
|
@ -0,0 +1,51 @@
|
|||
.. _get_stereo_rectified:
|
||||
|
||||
Get stereo camera correction image
|
||||
==================================
|
||||
|
||||
The ``GetStreamData()`` API provided can only get the raw data of the hardware, for example, the stereo camera raw image.
|
||||
|
||||
The stereo camera correction image belongs to the upper layer of synthetic data. For such data, you need to enable ``EnableStreamData()`` before you can get ``GetStreamData()``.
|
||||
|
||||
In addition, ``WaitForStreams()`` waits for the key of the raw data. At the beginning when the synthetic data may still being processed, the value taken out will be null, so it needs to check not empty.
|
||||
|
||||
.. tip::
|
||||
|
||||
If you want the synthetic data once it is generated, see :ref:`get_from_callbacks`.
|
||||
|
||||
Reference code snippet:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
api->EnableStreamData(Stream::LEFT_RECTIFIED);
|
||||
api->EnableStreamData(Stream::RIGHT_RECTIFIED);
|
||||
|
||||
api->Start(Source::VIDEO_STREAMING);
|
||||
|
||||
cv::namedWindow("frame");
|
||||
|
||||
while (true) {
|
||||
api->WaitForStreams();
|
||||
|
||||
auto &&left_data = api->GetStreamData(Stream::LEFT_RECTIFIED);
|
||||
auto &&right_data = api->GetStreamData(Stream::RIGHT_RECTIFIED);
|
||||
|
||||
if (!left_data.frame.empty() && !right_data.frame.empty()) {
|
||||
cv::Mat img;
|
||||
cv::hconcat(left_data.frame, right_data.frame, img);
|
||||
cv::imshow("frame", img);
|
||||
}
|
||||
|
||||
char key = static_cast<char>(cv::waitKey(1));
|
||||
if (key == 27 || key == 'q' || key == 'Q') { // ESC/Q
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
api->Stop(Source::VIDEO_STREAMING);
|
||||
|
||||
OpenCV is used to display the image above. Select the display window, press ``ESC/Q`` to exit the program.
|
||||
|
||||
Complete code examples, see `get_stereo_rectified.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/get_stereo_rectified.cc>`_ .
|
96
docs/src/data/get_with_plugin.rst
Normal file
|
@ -0,0 +1,96 @@
|
|||
.. _get_with_plugin:
|
||||
|
||||
Using the plugin to get data
|
||||
============================
|
||||
|
||||
API provides a ``EnablePlugin()`` function to enable plugins under a path.
|
||||
|
||||
Official provided plugins for calculating binocular parallax are now available in the `MYNTEYE_BOX <http://www.myntai.com/mynteye/s/download>`_ located in the ``Plugins`` directory.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
Plugins/
|
||||
├─linux-x86_64/
|
||||
│ ├─libplugin_b_ocl1.2_opencv3.4.0.so
|
||||
│ ├─libplugin_g_cuda9.1_opencv2.4.13.5.so
|
||||
│ ├─libplugin_g_cuda9.1_opencv3.3.1.so
|
||||
│ └─libplugin_g_cuda9.1_opencv3.4.0.so
|
||||
├─tegra-armv8/
|
||||
└─win-x86_64/
|
||||
|
||||
* The ``linux-x86_64`` directory shows the system and architecture.
|
||||
|
||||
* You can find your CPU architecture from system information or ``uname -a``.
|
||||
|
||||
* The library name ``libplugin_*`` shows the plugin identity and the third party dependency.
|
||||
|
||||
* ``b`` ``g`` is a plugin identifier, indicating that different algorithms are used.
|
||||
* ``ocl1.2`` shows it dependence on ``OpenCL 1.2``, if it exists.
|
||||
* ``cuda9.1`` shows it dependence on ``CUDA 9.1``, if it exists.
|
||||
* ``opencv3.4.0`` shows it dependence on ``OpenCV 3.4.0``, if it exists.
|
||||
* ``mynteye2.0.0`` shows it dependency on ``MYNT EYE SDK 2.0.0``, if it exists.
|
||||
|
||||
First, select the plugins that you are going to use depending on your situation. If you relying on third parties, please install a corresponding version.
|
||||
|
||||
Then, enable the plugin with the following code:
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
auto &&api = API::Create(argc, argv);
|
||||
|
||||
api->EnablePlugin("plugins/linux-x86_64/libplugin_g_cuda9.1_opencv3.4.0.so");
|
||||
|
||||
The path can be an absolute path or a relative path (relative to the current working directory).
|
||||
|
||||
Finally, just call the API to get the data as before.
|
||||
|
||||
.. tip::
|
||||
|
||||
If the plugin is not enabled, ``api->Start(Source::VIDEO_STREAMING);`` will automatically find the appropriate plug-in in the ``<sdk>/plugins/<platform>`` directory to load.
|
||||
|
||||
In other words, you can move the plug-in directory of the current platform into the ``< SDK > / plugins`` directory. To automatically load the official plugin, install the corresponding ``CUDA`` ``OpenCV`` plugin dependency, recompiling and then run ``API`` layer interface program.
|
||||
|
||||
Before running, please execute the following commands to ensure that the plugin's dependency library can be searched:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Linux
|
||||
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
|
||||
# /usr/local/lib means the path of dependency library
|
||||
|
||||
# macOS
|
||||
export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH
|
||||
# /usr/local/lib means the path of dependency library
|
||||
|
||||
# Windows
|
||||
set PATH=C:\opencv\x64\vc14\bin;%PATH%
|
||||
# add to PATH of system environment
|
||||
|
||||
In addition, the following command can be executed to check whether the dependency Library of the plug-in can be searched:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Linux
|
||||
ldd *.so
|
||||
# *.so means plugin path
|
||||
|
||||
# macOS
|
||||
otool -L *.dylib
|
||||
# *.dylib means plugin path
|
||||
|
||||
# Windows
|
||||
# please download Dependency Walker ,open DLL .
|
||||
|
||||
If the plugin's dependent library is not found, it will report an error \"Open plugin failed\" when loading.
|
||||
|
||||
Complete code sample, see `get_with_plugin.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/tutorials/data/get_with_plugin.cc>`_ .
|
||||
|
||||
.. tip::
|
||||
|
||||
Linux can also add a dependency library path to the system environment, so that the compiled program can run directly. (does not require ``export LD_LIBRARY_PATH`` in the terminal then run again).
|
||||
|
||||
* Create a ``/etc/ld.so.conf.d/libmynteye.conf`` file and write the dependent library path.
|
||||
* Execute the ``sudo /sbin/ldconfig`` command in the terminal and refresh the cache.
|
||||
|
||||
.. literalinclude:: ../../files/libmynteye.conf
|
||||
:caption: e.g. libmynteye.conf
|
39
docs/src/data/save_params.rst
Normal file
|
@ -0,0 +1,39 @@
|
|||
.. _save_params:
|
||||
|
||||
Save device infomation and parameters
|
||||
=====================================
|
||||
|
||||
The SDK provides a tool ``save_all_infos`` for save information and parameters. For more information, please read `tools/README.md <https://github.com/slightech/MYNT-EYE-S-SDK/tree/master/tools>`_ .
|
||||
|
||||
Reference commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./tools/_output/bin/writer/save_all_infos
|
||||
|
||||
# Windows
|
||||
.\tools\_output\bin\writer\save_all_infos.bat
|
||||
|
||||
Reference result on Linux:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./tools/_output/bin/writer/save_all_infos
|
||||
I0512 21:40:08.687088 4092 utils.cc:26] Detecting MYNT EYE devices
|
||||
I0512 21:40:09.366693 4092 utils.cc:33] MYNT EYE devices:
|
||||
I0512 21:40:09.366734 4092 utils.cc:37] index: 0, name: MYNT-EYE-S1000
|
||||
I0512 21:40:09.366757 4092 utils.cc:43] Only one MYNT EYE device, select index: 0
|
||||
I0512 21:40:09.367609 4092 save_all_infos.cc:38] Save all infos to "config/SN0610243700090720"
|
||||
|
||||
Result save into ``<workdir>/config`` by default. You can also add parameters to select other directory for save.
|
||||
|
||||
Saved contents:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
<workdir>/
|
||||
└─config/
|
||||
└─SN0610243700090720/
|
||||
├─device.info
|
||||
├─img.params
|
||||
└─imu.params
|
27
docs/src/data/write_img_params.rst
Normal file
|
@ -0,0 +1,27 @@
|
|||
.. _write_img_params:
|
||||
|
||||
Write image parameters
|
||||
=======================
|
||||
|
||||
The SDK provides a tool ``img_params_writer`` for writing image parameters. For details, read `tools/README.md <https://github.com/slightech/MYNT-EYE-S-SDK/tree/master/tools>`_ .
|
||||
|
||||
For getting image parameters, please read :ref:`get_img_params`. This is used to calculate the deviation.
|
||||
|
||||
Reference commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./tools/_output/bin/writer/img_params_writer tools/writer/config/img.params
|
||||
|
||||
# Windows
|
||||
.\tools\_output\bin\writer\img_params_writer.bat tools\writer\config\img.params
|
||||
|
||||
And, `tools/writer/config/img.params <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/tools/writer/config/img.params>`_ is the path of parameters file. If you calibrated parameters yourself, you can edit it and run previous commands to write them into the devices.
|
||||
|
||||
.. tip::
|
||||
|
||||
You can also write into devices with ``SN*.conf`` provided by old SDK.
|
||||
|
||||
.. warning::
|
||||
|
||||
Please don't override parameters, you can use ``save_all_infos`` to backup parameters.
|
23
docs/src/data/write_imu_params.rst
Normal file
|
@ -0,0 +1,23 @@
|
|||
.. _write_imu_params:
|
||||
|
||||
Write IMU parameters
|
||||
=====================
|
||||
|
||||
SDK provides the tool ``imu_params_writer`` to write IMU parameters. For deltail, please read `tools/README.md <https://github.com/slightech/MYNT-EYE-S-SDK/tree/master/tools>`_ .
|
||||
|
||||
Information about how to get IMU parameters, please read :ref:`get_imu_params` .
|
||||
|
||||
Reference commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./tools/_output/bin/writer/imu_params_writer tools/writer/config/imu.params
|
||||
|
||||
# Windows
|
||||
.\tools\_output\bin\writer\imu_params_writer.bat tools\writer\config\imu.params
|
||||
|
||||
The path of parameters file can be found in `tools/writer/config/img.params <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/tools/writer/config/img.params>`_ . If you calibrated the parameters yourself, you can edit the file and run above commands to write them into the device.
|
||||
|
||||
.. warning::
|
||||
|
||||
Please don't override parameters, you can use ``save_all_infos`` to backup parameters.
|
25
docs/src/firmware/applicable.rst
Normal file
|
@ -0,0 +1,25 @@
|
|||
.. _firmware_applicable:
|
||||
|
||||
Firmware and SDK compatibility
|
||||
==============================
|
||||
|
||||
============================ ========================
|
||||
Firmwares SDK Version
|
||||
============================ ========================
|
||||
MYNTEYE_S_2.0.0_rc.img 2.0.0-rc (2.0.0-rc ~ 2.0.0-rc2)
|
||||
MYNTEYE_S_2.0.0_rc2.img 2.0.0-rc2 (2.0.0-rc ~ 2.0.0-rc2)
|
||||
MYNTEYE_S_2.0.0_rc1.img 2.0.0-rc1
|
||||
MYNTEYE_S_2.0.0_rc0.img 2.0.0-rc0 (2.0.0-rc1 ~ 2.0.0-alpha1)
|
||||
MYNTEYE_S_2.0.0_alpha1.1.img 2.0.0-alpha1 (2.0.0-rc1 ~ 2.0.0-alpha1)
|
||||
MYNTEYE_S_2.0.0_alpha1.img 2.0.0-alpha1 (2.0.0-rc1 ~ 2.0.0-alpha1)
|
||||
MYNTEYE_S_2.0.0_alpha0.img 2.0.0-alpha0
|
||||
MYNTEYE_S_2.2.2.img 2.3.0 (2.2.2-rc1 ~ 2.3.0)
|
||||
MYNTEYE_S_2.3.0.img 2.3.0 (2.2.2-rc1 ~ 2.3.3)
|
||||
============================ ========================
|
||||
|
||||
.. attention::
|
||||
This firmware doesn't support S2100/S210A, please do not upgrade when you use S2100/S210A.
|
||||
|
||||
``Firmwares`` indicates the firmware file name. It's in `MYNTEYE_BOX <http://doc.myntai.com/mynteye/s/download>`_ in the ``Firmwares`` directory.
|
||||
|
||||
``SDK Version`` indicates the version of the SDK that the firmware is adapted to, and the range of available versions are indicated in parentheses.
|
10
docs/src/firmware/contents.rst
Normal file
|
@ -0,0 +1,10 @@
|
|||
.. _firmware:
|
||||
|
||||
MYNT® EYE Firmware
|
||||
==================
|
||||
|
||||
.. toctree::
|
||||
|
||||
applicable
|
||||
upgrade
|
||||
from_v1.rst
|
12
docs/src/firmware/from_v1.rst
Normal file
|
@ -0,0 +1,12 @@
|
|||
.. _sdk_from_v1:
|
||||
|
||||
Change from SDK 1.x to 2.x
|
||||
===========================
|
||||
|
||||
To replace the SDK version 1.x to 2.x, need to:
|
||||
|
||||
1) Install SDK 2, Check the :ref:`sdk` .
|
||||
|
||||
2) Upgrade firmware to 2.x version,Check the :ref:`firmware` .
|
||||
|
||||
3) After launch the SDK 1.x , the image calibration parameters will be saved in ``<MYNTEYE_SDK_ROOT>/settings/SN*.conf`` .Please check the :ref:`write_img_params` and write ``SN*.conf`` into the devices.
|
104
docs/src/firmware/upgrade.rst
Normal file
|
@ -0,0 +1,104 @@
|
|||
.. _firmware_upgrade:
|
||||
|
||||
How to upgrade the firmware
|
||||
============================
|
||||
|
||||
Please use the MYNT EYE TOOL to upgrade the firmware.
|
||||
|
||||
You can download the firmware and MYNT EYE TOOL installation package in the ``Firmwares`` folder of `MYNTEYE_BOX <http://www.myntai.com/mynteye/s/download>`_ . The file structure is as follows:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
Firmwares/
|
||||
├─Checksum.txt # file checksum
|
||||
├─MYNTEYE_S_2.3.0.img # firmware
|
||||
├─...
|
||||
└─setup.zip # MYNTEYE TOOL zip
|
||||
|
||||
The firmware upgrade program currently only supports Windows, so you need to operate under Windows. Proceed as follows:
|
||||
|
||||
Download preparation
|
||||
---------------------
|
||||
|
||||
* Download and unzip ``setup.zip``
|
||||
* Download firmware, such as ``MYNTEYE_S_2.3.0_rc0.img``
|
||||
|
||||
* Please refer to :ref:`firmware_applicable` to select the firmware suitable for the SDK version
|
||||
* Please refer to ``Checksum.txt`` to find the firmware check code as follows:
|
||||
|
||||
* Run the command in CMD ``certutil -hashfile <*.img> MD5`` .
|
||||
* If the check code is incorrect, it means that the download went wrong. Please download it again!
|
||||
|
||||
Install MYNT EYE TOOL
|
||||
---------------------
|
||||
|
||||
* Double click on ``setup.msi`` and install the application.
|
||||
|
||||
Update Firmware
|
||||
---------------
|
||||
|
||||
* Plug in the MYNT® EYE camera into a USB3.0 port
|
||||
|
||||
* Open MYNT EYE TOOL and select ``Options/FirmwareUpdate`` .
|
||||
|
||||
.. image:: ../../images/firmware_update_option.png
|
||||
|
||||
* Click ``Update`` .
|
||||
|
||||
.. image:: ../../images/firmware_update.png
|
||||
:width: 60%
|
||||
|
||||
* A warning dialog box will pop up, click ``yes`` .
|
||||
|
||||
* This operation will erase the firmware, for details see README.
|
||||
|
||||
* Usually, the MYNT EYE TOOL automatically installs the driver during the upgrade process.
|
||||
* If the upgrade fails, refer to README.
|
||||
|
||||
.. image:: ../../images/firmware_update_warning.png
|
||||
:width: 60%
|
||||
|
||||
.. image:: ../../images/firmware_update_dir.png
|
||||
:width: 60%
|
||||
|
||||
* In the open file selection box, select the firmware you want to upgrade and start upgrading.
|
||||
|
||||
.. image:: ../../images/firmware_update_select.png
|
||||
|
||||
* Once the upgrade is complete, the status will changes to ``Succeeded``.
|
||||
|
||||
.. image:: ../../images/firmware_update_success.png
|
||||
:width: 60%
|
||||
|
||||
* Close the MYNT EYE TOOL,finish.
|
||||
|
||||
|
||||
.. attention::
|
||||
If you can't find MYNT image device, ``WestBridge_driver``, and ``Cypress USB BootLoader`` at the same time in the device manager, try another computer to perform the above operation. If you can not upgrade successfully, please contact us in time.
|
||||
|
||||
|
||||
Manually update drivers
|
||||
------------------------
|
||||
|
||||
* If the application indicates that you failed to update, you may fail to install the driver automatically. You can try to install the driver manually and then update it. The following is the manual installation of the driver.
|
||||
|
||||
* Open device manager, locate ``WestBridge_driver`` device, and right click Update Driver,select ``[application directory]WestBridge_driver\\[corresponding system folders](If it is more than win7, choose wlh)\\[system bits]`` .
|
||||
|
||||
.. image:: ../../images/firmware_update_westbridge.png
|
||||
|
||||
* For example,if it is the win10 64 bit system computer,and the application is installed under the default path,you should select ``C:\\Program Files (x86)\\slightech\\MYNT EYE Camera Tool\\wlh\\x64``.
|
||||
|
||||
* After the installation driver is successful, you can find the ``Cypress USB BootLoader`` device in the device manager.
|
||||
|
||||
.. image:: ../../images/firmware_update_cypressUSB.png
|
||||
|
||||
* Then plug in the camera and open the application again to update.
|
||||
|
||||
.. warning::
|
||||
|
||||
During the first time you open the MYNT® EYE camera after a firmware update, please hold the camera steadily for 3 seconds, for a zero drift compensation process. You can also call the API ``RunOptionAction(Option::ZERO_DRIFT_CALIBRATION)`` for zero drift correction.
|
||||
|
||||
.. ::
|
||||
|
||||
.. image:: ../../images/firmware_update_driver.png
|
||||
.. image:: ../../images/firmware_update_driver_install.png
|
9
docs/src/log/contents.rst
Normal file
|
@ -0,0 +1,9 @@
|
|||
.. _log:
|
||||
|
||||
Running log
|
||||
===========
|
||||
|
||||
.. toctree::
|
||||
|
||||
log_file
|
||||
log_verbose
|
28
docs/src/log/log_file.rst
Normal file
|
@ -0,0 +1,28 @@
|
|||
.. _log_file:
|
||||
|
||||
Enable log file
|
||||
================
|
||||
|
||||
.. tip::
|
||||
|
||||
If import glog to build.
|
||||
|
||||
The general configuration of the log in the head file `logger.h <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/include/mynteye/logger.h>`_ .
|
||||
|
||||
Uncomment ``FLAGS_log_dir = \".\";`` recompile and save to current work directory. Run ``camera_a`` log file as follows:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
<workdir>/
|
||||
├─camera_a.ERROR
|
||||
├─camera_a.FATAL
|
||||
├─camera_a.INFO
|
||||
├─camera_a.WARNING
|
||||
├─camera_a.john-ubuntu.john.log.ERROR.20180513-141833.519
|
||||
├─camera_a.john-ubuntu.john.log.FATAL.20180513-141833.519
|
||||
├─camera_a.john-ubuntu.john.log.INFO.20180513-141832.519
|
||||
└─camera_a.john-ubuntu.john.log.WARNING.20180513-141833.519
|
||||
|
||||
``camera_a.INFO`` shows the program and levers of log it is running. The link to the real log file is ``camera_a.john-ubuntu.john.log.INFO.20180513-141832.519``. Even if it ran several times, ``camera_a.INFO`` still leaves the link to last log file.
|
||||
|
||||
Excute `make cleanlog` to clean all log files.
|
18
docs/src/log/log_verbose.rst
Normal file
|
@ -0,0 +1,18 @@
|
|||
.. _log_verbose:
|
||||
|
||||
Enabled detailed level
|
||||
=======================
|
||||
|
||||
.. tip::
|
||||
|
||||
If import glog to build.
|
||||
|
||||
The general configuration of the log is in the head file `logger.h <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/include/mynteye/logger.h>`_ .
|
||||
|
||||
Uncomment ``FLAGS_v = 2`` ; and recompile to enable the detail levels, the log is printed by ``VLOG(n)``
|
||||
|
||||
For information on how to use the log library, such as how to configure, print, etc., please open its document and learn more:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ ./scripts/open.sh third_party/glog/doc/glog.html
|
12
docs/src/mynteye/contents.rst
Normal file
|
@ -0,0 +1,12 @@
|
|||
.. _mynteye:
|
||||
|
||||
MYNT® EYE
|
||||
=========
|
||||
|
||||
.. toctree::
|
||||
|
||||
intro
|
||||
surface_s1030
|
||||
imu_coord_s1030
|
||||
surface_s2100
|
||||
imu_coord_s2100
|
8
docs/src/mynteye/imu_coord_s1030.rst
Normal file
|
@ -0,0 +1,8 @@
|
|||
.. _mynteye_imu_coord_s1030:
|
||||
|
||||
MYNTEYE-S1030 IMU coordinata system
|
||||
====================================
|
||||
|
||||
IMU coordinate system is right-handed,the axis directions are as follows:
|
||||
|
||||
.. image:: ../../images/mynteye_imu_coord.jpg
|
8
docs/src/mynteye/imu_coord_s2100.rst
Normal file
|
@ -0,0 +1,8 @@
|
|||
.. _mynteye_imu_coord_s2100:
|
||||
|
||||
MYNTEYE-S2100 IMU coordinata system
|
||||
====================================
|
||||
|
||||
IMU coordinate system is right-handed,the axis directions are as follows:
|
||||
|
||||
.. image:: ../../images/mynteye_avatar_imu_coord.jpg
|
12
docs/src/mynteye/intro.rst
Normal file
|
@ -0,0 +1,12 @@
|
|||
.. _mynteye_intro:
|
||||
|
||||
Product description
|
||||
====================
|
||||
|
||||
MYNT® EYE S Series includes MYNT EYE S, MYNT EYE SE and MYNT EYE SC. The “Binocular + IMU” inertial navigation solution for MYNT® EYE S Series provides accurate six-axis complementary data for vSLAM applications and is more accurate and robust than other single solutions.
|
||||
|
||||
Combined with self-developed camera synchronization, auto exposure, and white balance control camera technology, MYNT® EYE S Series provides a CUDA-based GPU real-time acceleration solution that outputs high-precision, synchronized image sources to help reduce the difficulty of algorithm development and speed up the efficiency of algorithm research and development. At the same time, MYNT EYE S is equipped with a six-axis sensor (IMU) and an infrared active light (IR). Among them, six-axis sensor (IMU) can provide data complementation and correction for the research of visual positioning algorithm, suitable for algorithm research of visual inertial odometer (VIO), help improve positioning accuracy; infrared active light (IR) can help solve the problem of identifying indoor white walls and non-textured objects, and improve the recognition accuracy of image sources. The difference between MYNT EYE SE and MYNT EYE S is that MYNT EYE SE does not include IR and offers customers with lower cost hardware. MYNT EYE SC provides 8cm/12cm optional baseline solution, super wide angle 146°FOV, providing a wider depth recognition range and accuracy level, with color image sensor, upgraded brand new BMI088 six-axis IMU, IR active light, I2C time synchronization Chip, global shutter, etc., with resolutions up to 1280x800/60fps and accuracy is up to centimeters. In addition, MYNT EYE S Series also provides a rich SDK interface and VSLAM open source project support, which can help customers quickly integrate solutions, accelerate the product development process, and achieve rapid productization and implementation.
|
||||
|
||||
As a hardware product for research and development of stereo vision computing applications, MYNT® EYE S Series can be widely used in a field of visual positioning navigation (vSLAM), including visual real-time positioning navigation system of driverless vehicle and robots, visual positioning system of UAV, obstacle avoidance navigation system for driverless Vehicle, Augmented Reality (AR), Virtual Reality (VR), etc. At the same time, it can be used in a field of visual recognition, including Stereoscopic face recognition, three-dimensional object recognition, space motion tracking, three-dimensional gestures, and somatosensory recognition. And of course, you can use it for measurement which includes assisted driving system (ADAS), binocular volume calculation, industrial visual screening, etc. At present, MYNTAI has carried out service and cooperation with more than 500 domestic and foreign enterprise clients.
|
||||
|
||||
In order to ensure the quality of the output data of the camera products, we have calibrated the binocular and IMU. The product has passed various hardware stability tests, such as high- temperature and humidity continuous work and operation, low-temperature dynamic aging, high-temperature operation, low-temperature storage, whole-machine thermal shock, sinusoidal vibration and random vibration tests to ensure the stability and reliability of the product. In addition to the research and development of products and technologies, it can also be directly applied to mass production, accelerating the process from R&D to productization.
|
17
docs/src/mynteye/surface_s1030.rst
Normal file
|
@ -0,0 +1,17 @@
|
|||
.. _mynteye_surface_s1030:
|
||||
|
||||
MYNTEYE-S1030 Size and structure
|
||||
=================================
|
||||
|
||||
============= ==============
|
||||
Shell(mm) PCBA board(mm)
|
||||
============= ==============
|
||||
165x31.5x29.6 149x24
|
||||
============= ===========
|
||||
|
||||
.. image:: ../../images/mynteye_surface_zh-Hans.jpg
|
||||
|
||||
A. Camera:please pay attention to protect the camera sensor lenses, to avoid imaging quality degradation.
|
||||
B. Infrared structured-light transmitter and outlet: the infrared structured-light can effectively solve the problem associated with the visual positioning calculations of white wall non-textured object(For non-IR version, the outlet is reserved but there is no internal structured-light emitter).
|
||||
C. USB Micro-B interface and set screw holes: during usage, plug in the USB Micro-B cable and secure it by fastening the set screws to avoid damage to the interface and to ensure stability in connection.
|
||||
D. ¼ inch standardized set screw hole: for fixing the stereo camera to tripods or other devices.
|
15
docs/src/mynteye/surface_s2100.rst
Normal file
|
@ -0,0 +1,15 @@
|
|||
.. _mynteye_surface_s2100:
|
||||
|
||||
MYNTEYE-S2100 Size and structure
|
||||
================================
|
||||
|
||||
============= ==============
|
||||
Shell(mm) PCBA board(mm)
|
||||
============= ==============
|
||||
125x47x40 100x15
|
||||
============= ===========
|
||||
|
||||
.. image:: ../../images/mynteye_avatar_surface_zh-Hans.jpg
|
||||
|
||||
A. Camera:please pay attention to protect the camera sensor lenses, to avoid imaging quality degradation.
|
||||
B. USB Micro-B interface and set screw holes: during usage, plug in the USB Micro-B cable and secure it by fastening the set screws to avoid damage to the interface and to ensure stability in connection.
|
15
docs/src/sdk/contents.rst
Normal file
|
@ -0,0 +1,15 @@
|
|||
.. _sdk:
|
||||
|
||||
MYNT® EYE SDK
|
||||
=============
|
||||
|
||||
.. toctree::
|
||||
|
||||
platform
|
||||
ppa_install_ubuntu
|
||||
exe_install_windows
|
||||
source_install_ubuntu
|
||||
source_install_windows
|
||||
install_macos
|
||||
install_ros
|
||||
without_opencv
|
47
docs/src/sdk/exe_install_windows.rst
Normal file
|
@ -0,0 +1,47 @@
|
|||
.. _sdk_exe_install_windows:
|
||||
|
||||
Windows SDK exe Installation
|
||||
=============================
|
||||
|
||||
.. only:: html
|
||||
|
||||
+-----------------+
|
||||
| Windows 10 |
|
||||
+=================+
|
||||
| |build_passing| |
|
||||
+-----------------+
|
||||
|
||||
.. |build_passing| image:: https://img.shields.io/badge/build-passing-brightgreen.svg?style=flat
|
||||
|
||||
.. only:: latex
|
||||
|
||||
+-----------------+
|
||||
| Windows 10 |
|
||||
+=================+
|
||||
| ✓ |
|
||||
+-----------------+
|
||||
|
||||
Download and install SDK
|
||||
-------------------------
|
||||
|
||||
.. tip::
|
||||
|
||||
Download here: mynteye-s-2.3.3-win-x64-opencv-3.4.3.exe `Google Drive <https://drive.google.com/open?id=1PYC_5Mh2pzLFVXkYlkllEzPnr50EbKht>`_ `Baidu Pan <https://pan.baidu.com/s/1s4KIcuYkO5i_9E1pG5blQA>`_ .
|
||||
|
||||
After you install the win pack of SDK, there will be a shortcut to the SDK root directory on your desktop.
|
||||
|
||||
Goto the ``<SDK_ROOT_DIR>\\bin\\samples\\tutorials`` directory and click ``get_stereo.exe`` to run.
|
||||
|
||||
Generate samples project
|
||||
-------------------------
|
||||
|
||||
First, you should install `Visual Studio 2017 <https://visualstudio.microsoft.com/>`_ and `CMake <https://cmake.org/>`_ .
|
||||
|
||||
Second, goto the ``<SDK_ROOT_DIR>\\samples`` directory and click ``generate.bat`` to generate project.
|
||||
|
||||
The tutorials of samples are here: https://slightech.github.io/MYNT-EYE-S-SDK-Guide/src/data/contents.html.
|
||||
|
||||
Start using SDK with Visual Studio 2017
|
||||
----------------------------------------
|
||||
|
||||
Goto the ``<SDK_ROOT_DIR>\\projects\\vs2017``, see the ``README.md``.
|
6
docs/src/sdk/install_macos.rst
Normal file
|
@ -0,0 +1,6 @@
|
|||
.. _sdk_install_macos:
|
||||
|
||||
MacOS Installation x
|
||||
====================
|
||||
|
||||
TODO
|
117
docs/src/sdk/install_ros.rst
Normal file
|
@ -0,0 +1,117 @@
|
|||
.. _sdk_install_ros:
|
||||
|
||||
ROS Installation
|
||||
================
|
||||
|
||||
.. only:: html
|
||||
|
||||
=============== ===============
|
||||
ROS Kinetic ROS Indigo
|
||||
=============== ===============
|
||||
|build_passing| |build_passing|
|
||||
=============== ===============
|
||||
|
||||
.. |build_passing| image:: https://img.shields.io/badge/build-passing-brightgreen.svg?style=flat
|
||||
|
||||
.. only:: latex
|
||||
|
||||
=============== ===============
|
||||
ROS Kinetic ROS Indigo
|
||||
=============== ===============
|
||||
✓ ✓
|
||||
=============== ===============
|
||||
|
||||
Prepare Environment
|
||||
--------------------
|
||||
|
||||
* `ROS <http://www.ros.org/>`_
|
||||
|
||||
ROS Kinetic (Ubuntu 16.04)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
wget https://raw.githubusercontent.com/oroca/oroca-ros-pkg/master/ros_install.sh && \
|
||||
chmod 755 ./ros_install.sh && bash ./ros_install.sh catkin_ws kinetic
|
||||
|
||||
ROS Indigo (Ubuntu 14.04)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
wget https://raw.githubusercontent.com/oroca/oroca-ros-pkg/master/ros_install.sh && \
|
||||
chmod 755 ./ros_install.sh && bash ./ros_install.sh catkin_ws indigo
|
||||
|
||||
Compiling Code
|
||||
--------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd <sdk>
|
||||
make ros
|
||||
|
||||
Running node
|
||||
------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
source wrappers/ros/devel/setup.bash
|
||||
roslaunch mynt_eye_ros_wrapper mynteye.launch
|
||||
|
||||
Run the node, and preview by RViz:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
source wrappers/ros/devel/setup.bash
|
||||
roslaunch mynt_eye_ros_wrapper display.launch
|
||||
|
||||
Testing Services
|
||||
-----------------
|
||||
|
||||
Run the node as follows, provide device information getting service, see follows:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ source wrappers/ros/devel/setup.bash
|
||||
$ rosrun mynt_eye_ros_wrapper get_device_info.py
|
||||
LENS_TYPE: 0000
|
||||
SPEC_VERSION: 1.0
|
||||
NOMINAL_BASELINE: 120
|
||||
HARDWARE_VERSION: 2.0
|
||||
IMU_TYPE: 0000
|
||||
SERIAL_NUMBER: 0610243700090720
|
||||
FIRMWARE_VERSION: 2.0
|
||||
DEVICE_NAME: MYNT-EYE-S1000
|
||||
|
||||
Common issues - ROS Indigo
|
||||
--------------------------
|
||||
|
||||
Cannot find ``libopencv`` while ``make ros``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
::
|
||||
|
||||
make[3]: *** No rule to make target `/usr/lib/x86_64-linux-gnu/libopencv_videostab.so.2.4.8', needed by `/home/john/Workspace/MYNT-EYE-S-SDK/wrappers/ros/devel/lib/libmynteye_wrapper.so'. Stop.
|
||||
|
||||
**Solution 1)** Install OpenCV 2:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt-get update
|
||||
sudo apt-get install libcv-dev
|
||||
|
||||
**Solution 2)** Install OpenCV 3 & re-compiled ``cv_bridge``:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt-get install ros-indigo-opencv3
|
||||
|
||||
git clone https://github.com/ros-perception/vision_opencv.git
|
||||
mv vision_opencv/cv_bridge/ MYNT-EYE-S-SDK/wrappers/ros/src/
|
||||
|
||||
Then run ``make ros`` again
|
||||
|
||||
Conclusion
|
||||
-----------
|
||||
|
||||
About more details, check the :ref:`wrapper_ros` .
|
16
docs/src/sdk/platform.rst
Normal file
|
@ -0,0 +1,16 @@
|
|||
.. _sdk_platform:
|
||||
|
||||
Supported platforms
|
||||
====================
|
||||
|
||||
SDK is built on CMake and can be used cross multiple platforms such as "Linux, Windows, macOS, etc. We provides two installation: Download and install, and Compile and install from source code.
|
||||
|
||||
These are the platforms that can be used:
|
||||
|
||||
* Windows 10
|
||||
* Ubuntu 18.04/ 16.04 / 14.04
|
||||
* Jetson TX2
|
||||
|
||||
.. warning::
|
||||
|
||||
Due to the requirement of hardware transmission rate, please use the USB 3 interface. In addition, virtual machines have USB driver compatibility problems, thus they are not recommended.
|
43
docs/src/sdk/ppa_install_ubuntu.rst
Normal file
|
@ -0,0 +1,43 @@
|
|||
.. _sdk_ppa_install_ubuntu:
|
||||
|
||||
Ubuntu SDK PPA Installation
|
||||
============================
|
||||
|
||||
.. only:: html
|
||||
|
||||
=============== =============== ===============
|
||||
Ubuntu 14.04 Ubuntu 16.04 Ubuntu 18.04
|
||||
=============== =============== ===============
|
||||
|build_passing| |build_passing| |build_passing|
|
||||
=============== =============== ===============
|
||||
|
||||
.. |build_passing| image:: https://img.shields.io/badge/build-passing-brightgreen.svg?style=flat
|
||||
|
||||
.. only:: latex
|
||||
|
||||
=============== =============== ===============
|
||||
Ubuntu 14.04 Ubuntu 16.04 Ubuntu 18.04
|
||||
=============== =============== ===============
|
||||
✓ ✓ ✓
|
||||
=============== =============== ===============
|
||||
|
||||
PPA installation
|
||||
-----------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ sudo add-apt-repository ppa:slightech/mynt-eye-s-sdk
|
||||
$ sudo apt-get update
|
||||
$ sudo apt-get install mynt-eye-s-sdk
|
||||
|
||||
Run samples
|
||||
------------
|
||||
|
||||
.. tip::
|
||||
|
||||
samples path: /opt/mynt-eye-s-sdk/samples; tools path:/opt/mynt-eye-s-sdk/tools
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ cd /opt/mynt-eye-s-sdk/samples
|
||||
$ ./api/camera_a
|
149
docs/src/sdk/source_install_ubuntu.rst
Normal file
|
@ -0,0 +1,149 @@
|
|||
.. _sdk_source_install_ubuntu:
|
||||
|
||||
Ubuntu SDK Source Installation
|
||||
==============================
|
||||
|
||||
.. only:: html
|
||||
|
||||
=============== =============== ===============
|
||||
Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
|
||||
=============== =============== ===============
|
||||
|build_passing| |build_passing| |build_passing|
|
||||
=============== =============== ===============
|
||||
|
||||
.. |build_passing| image:: https://img.shields.io/badge/build-passing-brightgreen.svg?style=flat
|
||||
|
||||
.. only:: latex
|
||||
|
||||
=============== =============== ===============
|
||||
Ubuntu 18.04 Ubuntu 16.04 Ubuntu 14.04
|
||||
=============== =============== ===============
|
||||
✓ ✓ ✓
|
||||
=============== =============== ===============
|
||||
|
||||
.. tip::
|
||||
|
||||
If you used any other Linux distributions without apt-get package manager, you need to install required packages manaully instead of using ``make init``.
|
||||
|
||||
============= =====================================================================
|
||||
Linux How to install required packages
|
||||
============= =====================================================================
|
||||
Debian based sudo apt-get install build-essential cmake git libv4l-dev
|
||||
Red Hat based sudo yum install make gcc gcc-c++ kernel-devel cmake git libv4l-devel
|
||||
Arch Linux sudo pacman -S base-devel cmake git v4l-utils
|
||||
============= =====================================================================
|
||||
|
||||
.. ::
|
||||
|
||||
`Installation of System Dependencies <https://github.com/LuaDist/Repository/wiki/Installation-of-System-Dependencies>`_
|
||||
|
||||
Getting Source Code
|
||||
--------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
sudo apt-get install git
|
||||
git clone https://github.com/slightech/MYNT-EYE-S-SDK.git
|
||||
|
||||
Required Packages
|
||||
------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd <sdk>
|
||||
make init
|
||||
|
||||
* `OpenCV <https://opencv.org/>`_
|
||||
|
||||
.. tip::
|
||||
|
||||
To build and install Opencv, Please refer to `Installation in Linux <https://docs.opencv.org/master/d7/d9f/tutorial_linux_install.html>`_ . Alternatively, refer to the command below:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
[compiler] sudo apt-get install build-essential
|
||||
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
|
||||
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev
|
||||
|
||||
$ git clone https://github.com/opencv/opencv.git
|
||||
$ cd opencv/
|
||||
$ git checkout tags/3.4.1
|
||||
|
||||
$ mkdir _build
|
||||
$ cd _build/
|
||||
|
||||
$ cmake \
|
||||
-DCMAKE_BUILD_TYPE=RELEASE \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr/local \
|
||||
\
|
||||
-DWITH_CUDA=OFF \
|
||||
\
|
||||
-DBUILD_DOCS=OFF \
|
||||
-DBUILD_EXAMPLES=OFF \
|
||||
-DBUILD_TESTS=OFF \
|
||||
-DBUILD_PERF_TESTS=OFF \
|
||||
..
|
||||
|
||||
$ make -j4
|
||||
$ sudo make install
|
||||
|
||||
Building code
|
||||
--------------
|
||||
|
||||
.. tip::
|
||||
|
||||
If opencv is installed in custom directory or if you want to specify a version, you should set the path before building:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# OpenCV_DIR is the directory where your OpenCVConfig.cmake exists
|
||||
export OpenCV_DIR=~/opencv
|
||||
|
||||
Otherwise, CMake will prompt cannot find OpenCV. If you need sdk without OpenCV, please read :ref:`sdk_without_opencv` .
|
||||
|
||||
Build and install:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd <sdk>
|
||||
make install
|
||||
|
||||
Finally, sdk will install in ``/usr/local`` by default.
|
||||
|
||||
Building samples
|
||||
----------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd <sdk>
|
||||
make samples
|
||||
|
||||
Run samples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./samples/_output/bin/api/camera_a
|
||||
|
||||
Tutorial samples, please read :ref:`data` and :ref:`ctrl` .
|
||||
|
||||
Building tools
|
||||
---------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd <sdk>
|
||||
make tools
|
||||
|
||||
Installation requirement:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd <sdk>/tools/
|
||||
sudo pip install -r requirements.txt
|
||||
|
||||
The usage of tools and scripts will be introduced later.
|
||||
|
||||
Conclusion
|
||||
-----------
|
||||
|
||||
If your project will use SDK, you can refer to the settings in ``samples/CMakeLists.txt`` for CMake. Alternatively, import the head file and dynamic library in the installation directory.
|
260
docs/src/sdk/source_install_windows.rst
Normal file
|
@ -0,0 +1,260 @@
|
|||
.. _sdk_source_install_windows:
|
||||
|
||||
Windows SDK Source Installation
|
||||
================================
|
||||
|
||||
.. only:: html
|
||||
|
||||
+-----------------+
|
||||
| Windows 10 |
|
||||
+=================+
|
||||
| |build_passing| |
|
||||
+-----------------+
|
||||
|
||||
.. |build_passing| image:: https://img.shields.io/badge/build-passing-brightgreen.svg?style=flat
|
||||
|
||||
.. only:: latex
|
||||
|
||||
+-----------------+
|
||||
| Windows 10 |
|
||||
+=================+
|
||||
| ✓ |
|
||||
+-----------------+
|
||||
|
||||
.. tip::
|
||||
|
||||
Windows does not provide Visual Studio ``*.sln`` file directly and requires CMake to build. Firstly, CMake can be used across multiple platforms, it is easy to configure and can be maintained in a sustainable way. Secondly, the third-party codes (Glog, OpenCV) are built using CMake.
|
||||
|
||||
.. tip::
|
||||
|
||||
There is currently no binary installer available, which requires you to compile from source. It is also the process of configuring the development environment.
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
CMake (provide build)
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* `CMake <https://cmake.org/download/>`_,used to build and compile (necessary).
|
||||
* `Git <https://git-scm.com/downloads>`_, used to get code (optional).
|
||||
* `Doxygen <http://www.stack.nl/~dimitri/doxygen/download.html>`_, used to generate documents (optional).
|
||||
|
||||
After you install the above tools, confirm that you can run this command in CMD (Command Prompt):
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
>cmake --version
|
||||
cmake version 3.10.1
|
||||
|
||||
>git --version
|
||||
git version 2.11.1.windows.1
|
||||
|
||||
>doxygen --version
|
||||
1.8.13
|
||||
|
||||
Visual Studio (provide compilation)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* `Visual Studio <https://www.visualstudio.com/>`_
|
||||
|
||||
* `Visual Studio 2017 <https://my.visualstudio.com/Downloads?q=Visual Studio 2017>`_
|
||||
* `Visual Studio 2015 <https://my.visualstudio.com/Downloads?q=Visual Studio 2015>`_
|
||||
|
||||
* `Windows 10 SDK <https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk>`_
|
||||
|
||||
After installing Visual Studio, confirm that the following command can run in the Visual Studio Command Prompt:
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
>cl
|
||||
Microsoft (R) C/C++ Optimizing Compiler Version 19.14.26429.4 for x86
|
||||
|
||||
>msbuild
|
||||
Microsoft (R) 生成引擎版本 15.7.179.6572
|
||||
|
||||
.. tip::
|
||||
|
||||
Visual Studio Command Prompt can be opened from the Start menu,
|
||||
|
||||
.. image:: ../../images/vs_cmd_menu.png
|
||||
:width: 30%
|
||||
|
||||
You can also open it from the Visual Studio Tools menu.
|
||||
|
||||
.. image:: ../../images/vs_cmd.png
|
||||
:width: 40%
|
||||
|
||||
However, if you do not have the Visual Studio 2015 Tools menu, you can add one yourself.
|
||||
|
||||
Open Tools's External Tools... and Add the following:
|
||||
|
||||
================= =======================================================================================
|
||||
Field Value
|
||||
================= =======================================================================================
|
||||
Title Visual Studio Command Prompt
|
||||
Command ``C:\Windows\System32\cmd.exe``
|
||||
Arguments ``/k "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat"``
|
||||
Initial Directory ``$(SolutionDir)``
|
||||
================= =======================================================================================
|
||||
|
||||
In Visual Studio command Prompt, you can use the compile command ``cl`` ``link`` ``lib`` ``msbuild``, etc.
|
||||
|
||||
.. image:: ../../images/vs_cmd_test.png
|
||||
|
||||
MSYS2 (provide Linux command)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* `MSYS2 <http://www.msys2.org/>`_
|
||||
|
||||
* `mirror <https://lug.ustc.edu.cn/wiki/mirrors/help/msys2>`_
|
||||
* `pacman <https://wiki.archlinux.org/index.php/pacman>`_
|
||||
|
||||
After installation, verify that the following path has been added to the system environment variable PATH:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
C:\msys64\usr\bin
|
||||
|
||||
Then, open MSYS2 MSYS, perform the update and install ``make``:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ pacman -Syu
|
||||
$ pacman -S make
|
||||
|
||||
Finally, the CMD (Command Prompt) can run the following command:
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
>make --version
|
||||
GNU Make 4.2.1
|
||||
|
||||
Getting Source Code
|
||||
--------------------
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
git clone https://github.com/slightech/MYNT-EYE-S-SDK.git
|
||||
|
||||
Required Packages
|
||||
-----------------
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
>cd <sdk>
|
||||
>make init
|
||||
Make init
|
||||
Init deps
|
||||
Install cmd: pacman -S
|
||||
Install deps: git clang-format
|
||||
pacman -S clang-format (not exists)
|
||||
error: target not found: clang-format
|
||||
pip install --upgrade autopep8 cpplint pylint requests
|
||||
...
|
||||
Init git hooks
|
||||
ERROR: clang-format-diff is not installed!
|
||||
Expect cmake version >= 3.0
|
||||
cmake version 3.10.1
|
||||
|
||||
* `OpenCV <https://opencv.org/>`_
|
||||
|
||||
.. tip::
|
||||
|
||||
The official OpenCV provides the ``exe`` for installation. If you want to compile from the source code, see the Official document `Installation in Windows <https://docs.opencv.org/master/d3/d52/tutorial_windows_install.html>`_ . or refer to the following command:
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
>git clone https://github.com/opencv/opencv.git
|
||||
>cd opencv
|
||||
>git checkout tags/3.4.1
|
||||
|
||||
>cd opencv
|
||||
>mkdir _build
|
||||
>cd _build
|
||||
|
||||
>cmake ^
|
||||
-D CMAKE_BUILD_TYPE=RELEASE ^
|
||||
-D CMAKE_INSTALL_PREFIX=C:/opencv ^
|
||||
-D WITH_CUDA=OFF ^
|
||||
-D BUILD_DOCS=OFF ^
|
||||
-D BUILD_EXAMPLES=OFF ^
|
||||
-D BUILD_TESTS=OFF ^
|
||||
-D BUILD_PERF_TESTS=OFF ^
|
||||
-G "Visual Studio 15 2017 Win64" ^
|
||||
..
|
||||
|
||||
>msbuild ALL_BUILD.vcxproj /property:Configuration=Release
|
||||
>msbuild INSTALL.vcxproj /property:Configuration=Release
|
||||
|
||||
Building Code
|
||||
--------------
|
||||
|
||||
.. tip::
|
||||
|
||||
If OpenCV is installed in a custom directory or wants to specify a version, you can set the path as follows before compiling:
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
# OpenCV_DIR is hte path where OpenCVConfig.cmake in
|
||||
set OpenCV_DIR=C:\opencv
|
||||
|
||||
Otherwise, CMake will prompt that OpenCV could not be found. If you don't want to rely on OpenCV, read :ref:`sdk_without_opencv` .
|
||||
|
||||
Build and install:
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
cd <sdk>
|
||||
make install
|
||||
|
||||
Finally, the SDK will install in ``<sdk>/_install`` by default.
|
||||
|
||||
Building samples
|
||||
----------------
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
cd <sdk>
|
||||
make samples
|
||||
|
||||
Run samples:
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
.\samples\_output\bin\api\camera_a.bat
|
||||
|
||||
For tutorial samples, please read :ref:`data` and :ref:`ctrl` .
|
||||
|
||||
.. tip::
|
||||
|
||||
All compiled sample programs ``exe`` will have a corresponding ``bat``. ``bat`` will temporarily set system environment variables and then run ``exe``. So it is recommended to run ``bat``.
|
||||
|
||||
If you run``exe`` directly, it may prompt that cannot find ``dll``. Then you should add ``<sdk>\\_install\\bin`` ``%OPENCV_DIR%\\bin`` to ``PATH`` in system environment variable.
|
||||
|
||||
How to set the environment variable for OpenCV, refer to the official document `Set the OpenCV environment variable and add it to the systems path <https://docs.opencv.org/master/d3/d52/tutorial_windows_install.html#tutorial_windows_install_path>`_ .
|
||||
|
||||
Building tools
|
||||
---------------
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
cd <sdk>
|
||||
make tools
|
||||
|
||||
The usage of tools and scripts will be introduced later.
|
||||
|
||||
.. tip::
|
||||
|
||||
The script is based on Python. You need to install Python and its package management tool pip first, and then install the dependencies as follows:
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
cd <sdk>\tools
|
||||
pip install -r requirements.txt
|
||||
|
||||
Note: Python is also in MSYS2, but fail install Matplotlib in test.
|
||||
|
||||
Conclusion
|
||||
-----------
|
||||
|
||||
If your project will use SDK, you can refer to the settings in ``samples/CMakeLists.txt`` for CMake. Or just import the head file and dynamic library in the installation directory.
|
18
docs/src/sdk/without_opencv.rst
Normal file
|
@ -0,0 +1,18 @@
|
|||
.. _sdk_without_opencv:
|
||||
|
||||
OpenCV independency
|
||||
===================
|
||||
|
||||
SDK provides a three-tier interface with OpenCV dependencies:
|
||||
|
||||
* ``api``, upper interface, with OpenCV dependencies
|
||||
* ``device``, interlayer interface, without OpenCV dependencies
|
||||
* ``uvc``, bottom interface, without OpenCV dependencies
|
||||
|
||||
If you don't want to use OpenCV, edit ``<sdk>/cmake/Option.cmake`` , set ``WITH_API`` to ``OFF``. This will stop the compilation of the interface api:
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
option(WITH_API "Build with API layer, need OpenCV" ON)
|
||||
|
||||
For samples for the interface ``device``, please refer to `device/camera.cc <https://github.com/slightech/MYNT-EYE-S-SDK/blob/master/samples/device/camera.cc>`_ .
|
13
docs/src/slam/contents.rst
Normal file
|
@ -0,0 +1,13 @@
|
|||
.. _slam:
|
||||
|
||||
SLAM
|
||||
====
|
||||
|
||||
.. toctree::
|
||||
|
||||
how_to_use_kalibr
|
||||
vins
|
||||
orb_slam2
|
||||
okvis
|
||||
viorb
|
||||
maplab
|
300
docs/src/slam/how_to_use_kalibr.rst
Normal file
|
@ -0,0 +1,300 @@
|
|||
.. _how_to_use_kalibr:
|
||||
|
||||
How to calibrate MYNTEYE by kalibr
|
||||
===================================
|
||||
|
||||
Target
|
||||
------------
|
||||
|
||||
* Calibrate the pose relationship between left and right camera
|
||||
|
||||
* Calibrate the pose relationship left camera between and IMU
|
||||
|
||||
|
||||
Preparation
|
||||
------------
|
||||
|
||||
* **Install kalibr**:Refer to `kalibr wiki <https://github.com/ethz-asl/kalibr/wiki/installation>`_ and follow the steps to install
|
||||
|
||||
* **Calibration board**: kalibr supports ``chessbord`` , ``circlegrid`` , ``aprilgrid`` ,choose ``aprilgrid`` here Calibration board file can be directly `download <https://github.com/ethz-asl/kalibr/wiki/downloads>`_ , Or you can also generate calibration board by Kalibr tool.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ kalibr_create_target_pdf --type 'apriltag' --nx 6 --ny 6 --tsize 0.08 --tspace 0.3
|
||||
|
||||
View parameters' meanings by kalibr_create)target_pdf command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ kalibr_create_target_pdf --h
|
||||
usage:
|
||||
Example Aprilgrid:
|
||||
kalibr_create_target_pdf --type apriltag --nx 6 --ny 6 --tsize 0.08 --tspace 0.3
|
||||
Example Checkerboard:
|
||||
kalibr_create_target_pdf --type checkerboard --nx 6 --ny 6 -csx 0.05 --csy 0.1
|
||||
|
||||
|
||||
Generate PDFs of calibration patterns.
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
|
||||
Output options:
|
||||
output Output filename
|
||||
--eps Also output an EPS file
|
||||
|
||||
Generic grid options:
|
||||
--type GRIDTYPE The grid pattern type. ('apriltag' or 'checkerboard')
|
||||
--nx N_COLS The number of tags in x direction (default: 6)
|
||||
--ny N_ROWS The number of tags in y direction (default: 7)
|
||||
|
||||
Apriltag arguments:
|
||||
--tsize TSIZE The size of one tag [m] (default: 0.08)
|
||||
--tspace TAGSPACING The space between the tags in fraction of the edge size
|
||||
[0..1] (default: 0.3)
|
||||
--tfam TAGFAMILIY Familiy of April tags ['t16h5', 't25h9', 't25h7',
|
||||
't36h11'] (default: t36h11)
|
||||
|
||||
Checkerboard arguments:
|
||||
--csx CHESSSZX The size of one chessboard square in x direction [m]
|
||||
(default: 0.05)
|
||||
--csy CHESSSZY The size of one chessboard square in y direction [m]
|
||||
(default: 0.05)
|
||||
|
||||
* **Calibrate the intrinsic IMU parameters** :kalibr requires imu data to be calibrated by intrinsic parameters by default.The intrinsic parameters calibration tool uses `imu-tk <https://github.com/Kyle-ak/imu_tk.git>`_ .
|
||||
|
||||
* **Count imu data parameter**:
|
||||
* noise density
|
||||
* bias random walk
|
||||
|
||||
Using Allan analyzing tool `imu_utils <https://github.com/gaowenliang/imu_utils>`_, We can get the characteristics of above imu data,and to format the output as ``imu.yaml``
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
#Accelerometers
|
||||
accelerometer_noise_density: 0.02680146180736048 #Noise density (continuous-time)
|
||||
accelerometer_random_walk: 0.0026296086159332804 #Bias random walk
|
||||
|
||||
#Gyroscopes
|
||||
gyroscope_noise_density: 0.008882328296710996 #Noise density (continuous-time)
|
||||
gyroscope_random_walk: 0.00037956578292701033 #Bias random walk
|
||||
|
||||
rostopic: /mynteye/imu/data_raw #the IMU ROS topic
|
||||
update_rate: 200.0 #Hz (for discretization of the values above)
|
||||
|
||||
Calibrate the pose relationship between left and right camera
|
||||
--------------------------------------------------------------
|
||||
|
||||
* Collect calibration images: kalibr supports the collection of the required calibration images through two ways:by ``rosbag`` or collect offline images . Using ``rosbag`` here for convenience,Reference `link <https://github.com/ethz-asl/kalibr/wiki/bag-format>`_ for collecting images.
|
||||
* Method of collecting images by ``rosbag`` :fix mynteye camera,move ``aprilgrid`` calibration board in the camera field of view.
|
||||
* To increase the calibration time,try to use image acquisition data with lower frame rate,kalibr recommends using ``4Hz`` frame rate,here uses ``10hz`` .
|
||||
* MYNTEYE S series camera offers images at least 10Hz,You can use `topic_tools <http://wiki.ros.org/topic_tools/throttle>`_ to modify frequency,because using 10Hz requires more calibration time.
|
||||
* Record ``static.bag`` : After fix the mynteye camera,start `wrapper <https://github.com/slightech/MYNT-EYE-S-SDK>`_, record the topic of the left and right images to ``static.bag`` .
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ source wrappers/ros/devel/setup.bash
|
||||
$ roslaunch mynt_eye_ros_wrapper display.launch
|
||||
$ cd ~
|
||||
$ mkdir -p bag
|
||||
$ cd bag
|
||||
$ rosbag record -O static_10hz /mynteye/left/image_raw /mynteye/right/image_raw #recommand use 10hz,you can also use topic_tools to publish 4hz.
|
||||
|
||||
* kalibr calibration:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ kalibr_calibrate_cameras --target aprilgrid.yaml --bag ~/bag/static_10hz.bag --models pinhole-radtan pinhole-radtan --topics /mynteye/left/image_raw /mynteye/right/image_raw
|
||||
|
||||
View parameters' meanings by kalibr_calibrate_cameras command:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ kalibr_calibrate_cameras --h
|
||||
|
||||
Calibrate the intrinsics and extrinsics of a camera system with non-shared
|
||||
overlapping field of view.
|
||||
|
||||
usage:
|
||||
Example usage to calibrate a camera system with two cameras using an aprilgrid.
|
||||
|
||||
cam0: omnidirection model with radial-tangential distortion
|
||||
cam1: pinhole model with equidistant distortion
|
||||
|
||||
kalibr_calibrate_cameras --models omni-radtan pinhole-equi --target aprilgrid.yaml \
|
||||
--bag MYROSBAG.bag --topics /cam0/image_raw /cam1/image_raw
|
||||
|
||||
example aprilgrid.yaml:
|
||||
target_type: 'aprilgrid'
|
||||
tagCols: 6
|
||||
tagRows: 6
|
||||
tagSize: 0.088 #m
|
||||
tagSpacing: 0.3 #percent of tagSize
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
--models MODELS [MODELS ...]
|
||||
The camera model ['pinhole-radtan', 'pinhole-equi',
|
||||
'omni-radtan', 'pinhole-fov'] to estimate
|
||||
|
||||
Data source:
|
||||
--bag BAGFILE The bag file with the data
|
||||
--topics TOPICS [TOPICS ...]
|
||||
The list of image topics
|
||||
--bag-from-to bag_from_to bag_from_to
|
||||
Use the bag data starting from up to this time [s]
|
||||
|
||||
Calibration target configuration:
|
||||
--target TARGETYAML Calibration target configuration as yaml file
|
||||
|
||||
Image synchronization:
|
||||
--approx-sync MAX_DELTA_APPROXSYNC
|
||||
Time tolerance for approximate image synchronization
|
||||
[s] (default: 0.02)
|
||||
|
||||
Calibrator settings:
|
||||
--qr-tol QRTOL The tolerance on the factors of the QR decomposition
|
||||
(default: 0.02)
|
||||
--mi-tol MITOL The tolerance on the mutual information for adding an
|
||||
image. Higher means fewer images will be added. Use -1
|
||||
to force all images. (default: 0.2)
|
||||
--no-shuffle Do not shuffle the dataset processing order
|
||||
|
||||
Outlier filtering options:
|
||||
--no-outliers-removal
|
||||
Disable corner outlier filtering
|
||||
--no-final-filtering Disable filtering after all views have been processed.
|
||||
--min-views-outlier MINVIEWOUTLIER
|
||||
Number of raw views to initialize statistics (default:
|
||||
20)
|
||||
--use-blakezisserman Enable the Blake-Zisserman m-estimator
|
||||
--plot-outliers Plot the detect outliers during extraction (this could
|
||||
be slow)
|
||||
|
||||
Output options:
|
||||
--verbose Enable (really) verbose output (disables plots)
|
||||
--show-extraction Show the calibration target extraction. (disables
|
||||
plots)
|
||||
--plot Plot during calibration (this could be slow).
|
||||
--dont-show-report Do not show the report on screen after calibration.
|
||||
|
||||
Output the following three files after finish calibration:
|
||||
|
||||
* ``camchain-homezhangsbagstatic_10hz.yaml``
|
||||
* ``report-cam-homezhangsbagstatic_10hz.pdf``
|
||||
* ``results-cam-homezhangsbagstatic_10hz.txt``
|
||||
|
||||
.. tip::
|
||||
|
||||
If you use camera parameters in Vins,it would be better to choose the pinhole-equi model or the omni-radtan model.If you use camera parameters in Maplab,please choose pinhole-equi model
|
||||
|
||||
Calibrate the pose relationship between camera and IMU coordinate system
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
* **Collect calibration data**:as calibrate the pose relationship of camera,Kalibr supports two ways to collect data,we still use ``rosbag`` here.
|
||||
* Method of collecting image: fix ``apilgrid`` calibration board, move camera
|
||||
* Make sure that the data collected is good:the brightness of the calibration board should be appropriate,too bright or too dark can't guarantee the quality of data,meanwhile do not shake too fast to avoid blurring of the image.
|
||||
* Set the imu publishing frequency to 200Hz,image to 20Hz(recommended by kalibr)
|
||||
* Fully motivate each axis of the imu,for example ,3 actions on each axis,then in the \"8-shaped\" motion
|
||||
|
||||
* Record camera and imu as ``dynamic.bag``.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ roslaunch mynt_eye_ros_wrapper display.launch
|
||||
$ cd bag
|
||||
$ rosbag record -O dynamic /mynteye/left/image_raw /mynteye/right/image_raw /mynteye/imu/data_raw #remember set image hz to 20hz, imu hz to 200hz
|
||||
|
||||
* kalibr calibration:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ kalibr_calibrate_imu_camera --cam camchain-homezhangsbagstatic_10hz.yaml --target aprilgrid.yaml --imu imu.yaml --time-calibration --bag ~/bag/dynamic.bag
|
||||
|
||||
View the parameters' meanings by kalibr_calibrate_imu_camera command
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ kalibr_calibrate_imu_camera --h
|
||||
|
||||
Calibrate the spatial and temporal parameters of an IMU to a camera chain.
|
||||
|
||||
usage:
|
||||
Example usage to calibrate a camera system against an IMU using an aprilgrid
|
||||
with temporal calibration enabled.
|
||||
|
||||
kalibr_calibrate_imu_camera --bag MYROSBAG.bag --cam camchain.yaml --imu imu.yaml \
|
||||
--target aprilgrid.yaml --time-calibration
|
||||
|
||||
camchain.yaml: is the camera-system calibration output of the multiple-camera
|
||||
calibratin tool (kalibr_calibrate_cameras)
|
||||
|
||||
example aprilgrid.yaml: | example imu.yaml: (ADIS16448)
|
||||
target_type: 'aprilgrid' | accelerometer_noise_density: 0.006
|
||||
tagCols: 6 | accelerometer_random_walk: 0.0002
|
||||
tagRows: 6 | gyroscope_noise_density: 0.0004
|
||||
tagSize: 0.088 | gyroscope_random_walk: 4.0e-06
|
||||
tagSpacing: 0.3 | update_rate: 200.0
|
||||
|
||||
optional arguments:
|
||||
-h, --help show this help message and exit
|
||||
|
||||
Dataset source:
|
||||
--bag BAGFILE Ros bag file containing image and imu data (rostopics
|
||||
specified in the yamls)
|
||||
--bag-from-to bag_from_to bag_from_to
|
||||
Use the bag data starting from up to this time [s]
|
||||
--perform-synchronization
|
||||
Perform a clock synchronization according to 'Clock
|
||||
synchronization algorithms for network measurements'
|
||||
by Zhang et al. (2002).
|
||||
|
||||
Camera system configuration:
|
||||
--cams CHAIN_YAML Camera system configuration as yaml file
|
||||
--recompute-camera-chain-extrinsics
|
||||
Recompute the camera chain extrinsics. This option is
|
||||
exclusively recommended for debugging purposes in
|
||||
order to identify problems with the camera chain
|
||||
extrinsics.
|
||||
--reprojection-sigma REPROJECTION_SIGMA
|
||||
Standard deviation of the distribution of reprojected
|
||||
corner points [px]. (default: 1.0)
|
||||
|
||||
IMU configuration:
|
||||
--imu IMU_YAMLS [IMU_YAMLS ...]
|
||||
Yaml files holding the IMU noise parameters. The first
|
||||
IMU will be the reference IMU.
|
||||
--imu-delay-by-correlation
|
||||
Estimate the delay between multiple IMUs by
|
||||
correlation. By default, no temporal calibration
|
||||
between IMUs will be performed.
|
||||
--imu-models IMU_MODELS [IMU_MODELS ...]
|
||||
The IMU models to estimate. Currently supported are
|
||||
'calibrated', 'scale-misalignment' and 'scale-
|
||||
misalignment-size-effect'.
|
||||
|
||||
Calibration target:
|
||||
--target TARGET_YAML Calibration target configuration as yaml file
|
||||
|
||||
Optimization options:
|
||||
--time-calibration Enable the temporal calibration
|
||||
--max-iter MAX_ITER Max. iterations (default: 30)
|
||||
--recover-covariance Recover the covariance of the design variables.
|
||||
--timeoffset-padding TIMEOFFSET_PADDING
|
||||
Maximum range in which the timeoffset may change
|
||||
during estimation [s] (default: 0.01)
|
||||
|
||||
Output options:
|
||||
--show-extraction Show the calibration target extraction. (disables
|
||||
plots)
|
||||
--extraction-stepping
|
||||
Show each image during calibration target extraction
|
||||
(disables plots)
|
||||
--verbose Verbose output (disables plots)
|
||||
--dont-show-report Do not show the report on screen after calibration.
|
||||
|
||||
Output the follwing 4 files after finish calibration:
|
||||
* ``camchain-imucam-homezhangsbagdynamic.yaml``
|
||||
* ``imu-homezhangsbagdynamatic.yaml``
|
||||
* ``report-imucam-homezhangsbagdynamic.pdf``
|
||||
* ``results-imucam-homezhangsbagdynamic.yaml``
|
4
docs/src/slam/maplab.rst
Normal file
|
@ -0,0 +1,4 @@
|
|||
.. _slam_maplab:
|
||||
|
||||
How to use in `Maplab <https://github.com/ethz-asl/maplab>`_ x
|
||||
===============================================================
|
46
docs/src/slam/okvis.rst
Normal file
|
@ -0,0 +1,46 @@
|
|||
.. _slam_okvis:
|
||||
|
||||
How to use in `OKVIS <https://github.com/ethz-asl/okvis>`_
|
||||
=============================================================
|
||||
|
||||
If you wanna run OKVIS with MYNT EYE camera, please follow the steps:
|
||||
----------------------------------------------------------------------
|
||||
|
||||
1. Download `MYNT-EYE-S-SDK <https://github.com/slightech/MYNT-EYE-S-SDK.git>`_ and install it.
|
||||
2. Install dependencies and build MYNT-EYE-OKVIS-Sample follow the procedure of the original OKVIS.
|
||||
3. Update camera parameters to ``<OKVIS>/config/config_mynteye.yaml``.
|
||||
4. Run OKVIS using MYNT® EYE.
|
||||
|
||||
Install MYNTEYE OKVIS
|
||||
---------------------
|
||||
|
||||
First install dependencies based on the original OKVIS, and the follow:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
git clone -b mynteye-s https://github.com/slightech/MYNT-EYE-OKVIS-Sample.git
|
||||
mkdir build && cd build
|
||||
cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
make -j4
|
||||
|
||||
Get camera calibration parameters
|
||||
----------------------------------
|
||||
|
||||
Through the ``GetIntrinsics()`` and ``GetExtrinsics()`` function of the `MYNT-EYE-S-SDK <https://github.com/slightech/MYNT-EYE-S-SDK.git>`_ API, you can get the camera calibration parameters of the currently open device, follow the steps:
|
||||
|
||||
.. code-block:: bat
|
||||
|
||||
cd MYNT-EYE-S-SDK
|
||||
./samples/_output/bin/tutorials/get_img_params
|
||||
|
||||
After running the above type, pinhole's ``distortion_parameters`` and ``projection_parameters`` is obtained, then update to `here <https://github.com/slightech/MYNT-EYE-OKVIS-Sample/blob/mynteye-s/config/config_mynteye.yaml>`_ .
|
||||
|
||||
Run MYNTEYE OKVIS
|
||||
---------------------
|
||||
|
||||
Go to ``MYNT-EYE-OKVIS-Sample/build`` folder and Run the application ``okvis_app_mynteye_s`` :
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd MYNT-EYE-OKVIS-Sample/build
|
||||
./okvis_app_mynteye_s ../config/config_mynteye.yaml
|
78
docs/src/slam/orb_slam2.rst
Normal file
|
@ -0,0 +1,78 @@
|
|||
.. _slam_orb_slam2:
|
||||
|
||||
How to use in `ORB_SLAM2 <https://github.com/raulmur/ORB_SLAM2>`_
|
||||
==================================================================
|
||||
|
||||
|
||||
If you wanna run ORB_SLAM2 with MYNT EYE camera, please follow the steps:
|
||||
-------------------------------------------------------------------------
|
||||
|
||||
1. Download `MYNT-EYE-S-SDK <https://github.com/slightech/MYNT-EYE-S-SDK.git>`_ and follow steps to install.
|
||||
2. Follow the normal procedure to install ORB_SLAM2.
|
||||
3. Update ``distortion_parameters`` and ``projection_parameters`` to ``<ORB_SLAM2>/config/mynteye_*.yaml``.
|
||||
4. Run examples by MYNT® EYE.
|
||||
|
||||
Binocular camera sample
|
||||
------------------------
|
||||
|
||||
* Calibrate a stereo camera with `ROS-StereoCalibration <http://wiki.ros.org/camera_calibration/Tutorials/StereoCalibration>`_ or OpenCV, and then update parameters to ``<ORB_SLAM2>/config/mynteye_stereo.yaml``.
|
||||
|
||||
* Execute ``build.sh``:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
chmod +x build.sh
|
||||
./build.sh
|
||||
|
||||
* Run stereo sample using the follow type:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
./Examples/Stereo/stereo_mynt ./Vocabulary/ORBvoc.txt ./config/mynteye_stereo.yaml true /mynteye/left/image_raw /mynteye/right/image_raw
|
||||
|
||||
|
||||
Building the nodes for mono and stereo (ROS)
|
||||
--------------------------------------------
|
||||
|
||||
* Add the path including ``Examples/ROS/ORB_SLAM2`` to the ``ROS_PACKAGE_PATH`` environment variable. Open ``.bashrc`` file and add at the end the following line. Replace ``PATH`` by the folder where you cloned ORB_SLAM2:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:PATH/ORB_SLAM2/Examples/ROS
|
||||
|
||||
* Execute `build_ros.sh`:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
chmod +x build_ros.sh
|
||||
./build_ros.sh
|
||||
|
||||
Mono_ROS Example
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Update ``distortion_parameters`` and ``projection_parameters`` in ``<ORBSLAM2>/config/mynteye_mono.yaml``
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd MYNT-EYE-S-SDK
|
||||
|
||||
./samples/_output/bin/tutorials/get_img_params
|
||||
|
||||
After running the above type, pinhole's ``distortion_parameters`` and ``projection_parameters`` is obtained, and then update to ``<ORB_SLAM2>/config/mynteye_mono.yaml``.
|
||||
|
||||
* Launch ORB_SLAM2 ``Mono_ROS``
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
rosrun ORB_SLAM2 mynteye_mono ./Vocabulary/ORBvoc.txt ./config/mynteye_mono.yaml /mynteye/left/image_raw
|
||||
|
||||
Stereo_ROS Example
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Calibrate a stereo camera with `ROS-StereoCalibration <http://wiki.ros.org/camera_calibration/Tutorials/StereoCalibration>`_ or OpenCV, and then update parameters to ``<ORB_SLAM2>/config/mynteye_stereo.yaml``.
|
||||
|
||||
* Launch ORB_SLAM2 ``Stereo_ROS``
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
rosrun ORB_SLAM2 ros_mynteye_stereo ./Vocabulary/ORBvoc.txt ./config/mynteye_stereo.yaml true /mynteye/left/image_raw /mynteye/right/image_raw
|
61
docs/src/slam/vins.rst
Normal file
|
@ -0,0 +1,61 @@
|
|||
.. _slam_vins:
|
||||
|
||||
How to use in `VINS-Mono <https://github.com/HKUST-Aerial-Robotics/VINS-Mono>`_
|
||||
================================================================================
|
||||
|
||||
|
||||
If you wanna run VINS-Mono with MYNT EYE camera, please follow the steps:
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
1. Download `MYNT-EYE-S-SDK <https://github.com/slightech/MYNT-EYE-S-SDK.git>`_ and install mynt_eye_ros_wrapper.
|
||||
2. Follow the normal procedure to install VINS-Mono.
|
||||
3. Update ``distortion_parameters`` and ``projection_parameters`` to `here <https://github.com/slightech/MYNT-EYE-VINS-Sample/blob/mynteye-s/config/mynteye/mynteye_config.yaml>`_ .
|
||||
4. Run mynt_eye_ros_wrapper and VINS-Mono.
|
||||
|
||||
Install ROS Kinetic conveniently (if already installed, please ignore)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd ~
|
||||
wget https://raw.githubusercontent.com/oroca/oroca-ros-pkg/master/ros_install.sh && \
|
||||
chmod 755 ./ros_install.sh && bash ./ros_install.sh catkin_ws kinetic
|
||||
|
||||
Install MYNT-EYE-VINS-Sample
|
||||
------------------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
mkdir -p ~/catkin_ws/src
|
||||
cd ~/catkin_ws/src
|
||||
git clone -b mynteye-s https://github.com/slightech/MYNT-EYE-VINS-Sample.git
|
||||
cd ..
|
||||
catkin_make
|
||||
source devel/setup.bash
|
||||
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
|
||||
Get image calibration parameters
|
||||
---------------------------------
|
||||
|
||||
Use MYNT® EYE's left eye camera and IMU. By `MYNT-EYE-S-SDK <https://github.com/slightech/MYNT-EYE-S-SDK.git>`_ API ``GetIntrinsics()`` function and ``GetExtrinsics()`` function, you can "get the image calibration parameters of the current working device:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd MYNT-EYE-S-SDK
|
||||
./samples/_output/bin/tutorials/get_img_params
|
||||
|
||||
After running the above type, pinhole's ``distortion_parameters`` and ``projection_parameters`` is obtained , and then update to `here <https://github.com/slightech/MYNT-EYE-VINS-Sample/blob/mynteye-s/config/mynteye/mynteye_config.yaml>`_ .
|
||||
|
||||
Run VINS-Mono with MYNT® EYE
|
||||
-----------------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd ~/catkin_ws
|
||||
roslaunch mynt_eye_ros_wrapper mynteye.launch
|
||||
roslaunch vins_estimator mynteye.launch
|
||||
|
||||
.. note::
|
||||
|
||||
If you want to use a fish-eye camera model, please click `here <https://github.com/slightech/MYNT-EYE-VINS-Sample/tree/mynteye-s/calibration_images>`_ .
|
57
docs/src/slam/viorb.rst
Normal file
|
@ -0,0 +1,57 @@
|
|||
.. _slam_viorb:
|
||||
|
||||
How to use in `VIORB <https://github.com/jingpang/LearnVIORB>`_
|
||||
=============================================================---
|
||||
|
||||
|
||||
If you wanna run VIORB with MYNT® EYE,please follow the steps:
|
||||
---------------------------------------------------------------
|
||||
|
||||
1. Download `MYNT-EYE-S-SDK <https://github.com/slightech/MYNT-EYE-S-SDK.git>`_ and install mynt_eye_ros_wrapper.
|
||||
2. Follow the normal procedure to install VIORB.
|
||||
3. Update camera parameters to ``<VIO>/config/config_mynteye.yaml``.
|
||||
4. Run mynt_eye_ros_wrapper and VIORB.
|
||||
|
||||
Install MYNT-EYE-VIORB-Sample.
|
||||
------------------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
git clone -b mynteye-s https://github.com/slightech/MYNT-EYE-VIORB-Sample.git
|
||||
cd MYNT-EYE-VIORB-Sample
|
||||
|
||||
``ROS_PACKAGE_PATH`` environment variable. Open ``.bashrc`` file and add at the end the following line. Replace ``PATH`` by the folder where you cloned ``MYNT-EYE-VIORB-Sample``:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:PATH/Examples/ROS/ORB_VIO
|
||||
|
||||
Execute:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd MYNT-EYE-VIORB-Sample
|
||||
./build.sh
|
||||
|
||||
Get image calibration parameters
|
||||
----------------------------------
|
||||
|
||||
Assume that the left eye of the mynteye camera is used with IMU. Through the ``GetIntrinsics()`` and ``GetExtrinsics()`` function of the `MYNT-EYE-S-SDK <https://github.com/slightech/MYNT-EYE-S-SDK.git>`_ API, you can get the image calibration parameters of the currently open device:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
cd MYNT-EYE-S-SDK
|
||||
./samples/_output/bin/tutorials/get_img_params
|
||||
|
||||
After running the above type, pinhole's ``distortion_parameters`` and ``projection_parameters`` is obtained, and then update to ``<MYNT-EYE-VIORB-Sample>/config/mynteye.yaml``.
|
||||
|
||||
Run VIORB and mynt_eye_ros_wrapper
|
||||
--------------------------------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
roslaunch mynt_eye_ros_wrapper mynteye.launch
|
||||
roslaunch ORB_VIO testmynteye.launch
|
||||
|
||||
Finally, ``pyplotscripts`` can be used to visualize some results.
|
||||
|
8
docs/src/wrapper/contents.rst
Normal file
|
@ -0,0 +1,8 @@
|
|||
.. _wrapper:
|
||||
|
||||
Wrapper interface
|
||||
==================
|
||||
|
||||
.. toctree::
|
||||
|
||||
ros
|
74
docs/src/wrapper/ros.rst
Normal file
|
@ -0,0 +1,74 @@
|
|||
.. _wrapper_ros:
|
||||
|
||||
How to use ROS
|
||||
==============
|
||||
|
||||
Compile and run the node according to :ref:`sdk_install_ros` .
|
||||
|
||||
``rostopic list`` lists all released nodes:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ rostopic list
|
||||
/mynteye/depth/image_raw
|
||||
/mynteye/disparity/image_norm
|
||||
/mynteye/disparity/image_raw
|
||||
/mynteye/imu/data_raw
|
||||
/mynteye/left/camera_info
|
||||
/mynteye/left/image_raw
|
||||
/mynteye/left/image_rect
|
||||
/mynteye/points/data_raw
|
||||
/mynteye/right/camera_info
|
||||
/mynteye/right/image_raw
|
||||
/mynteye/right/image_rect
|
||||
/mynteye/temp/data_raw
|
||||
...
|
||||
|
||||
``rostopic hz <topic>`` checks the data:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ rostopic hz /mynteye/imu/data_raw
|
||||
subscribed to [/mynteye/imu/data_raw]
|
||||
average rate: 505.953
|
||||
min: 0.000s max: 0.018s std dev: 0.00324s window: 478
|
||||
average rate: 500.901
|
||||
min: 0.000s max: 0.018s std dev: 0.00327s window: 975
|
||||
average rate: 500.375
|
||||
min: 0.000s max: 0.019s std dev: 0.00329s window: 1468
|
||||
...
|
||||
|
||||
``rostopic echo <topic>`` can print and release data. Please read `rostopic <http://wiki.ros.org/rostopic>`_ for more information.
|
||||
|
||||
The ROS file is structured like follows:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
<sdk>/wrappers/ros/
|
||||
├─src/
|
||||
│ └─mynt_eye_ros_wrapper/
|
||||
│ ├─launch/
|
||||
│ │ ├─display.launch
|
||||
│ │ └─mynteye.launch
|
||||
│ ├─msg/
|
||||
│ ├─rviz/
|
||||
│ ├─src/
|
||||
│ │ ├─wrapper_node.cc
|
||||
│ │ └─wrapper_nodelet.cc
|
||||
│ ├─CMakeLists.txt
|
||||
│ ├─nodelet_plugins.xml
|
||||
│ └─package.xml
|
||||
└─README.md
|
||||
|
||||
In ``mynteye.launch``, you can configure the topics and frame_ids, decide which data to enable, and set the control options. Please set ``gravity`` to the local gravity acceleration.
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<arg name="gravity" default="9.8" />
|
||||
|
||||
For printing debug info, replace ``Info`` in ``wrapper_node.cc`` to ``Debug`` :
|
||||
|
||||
.. code-block:: c++
|
||||
|
||||
ros::console::set_logger_level(
|
||||
ROSCONSOLE_DEFAULT_NAME, ros::console::levels::Info);
|