Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ros release 2.19.1 #649

Merged
merged 184 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
dddafc8
Update FW: allow OV9282/OV9782 on RGB socket
alex-luxonis Apr 27, 2021
561ba91
Color/MonoCamera: add extra resolutions for OV9782 and OV7251 support
alex-luxonis Apr 30, 2021
dcd21d5
Merge remote-tracking branch 'origin/develop' into ov9782_color_dbg
alex-luxonis Apr 30, 2021
e3b5ef3
Update FW: initial ColorCamera support for OV9782
alex-luxonis Apr 30, 2021
b48c2a2
Update FW: improve OV9782 colors
alex-luxonis Apr 30, 2021
2dcfadd
Merge remote-tracking branch 'origin/develop' into ov9782_color_dbg
alex-luxonis May 12, 2021
b82abda
Update FW: OV9782 on RGB socket, working with OV9282 on L/R
alex-luxonis May 12, 2021
04a790b
Update FW: fix OV9782 bayer order
alex-luxonis May 14, 2021
2f2cdf9
Update FW: improve OV9782 color saturation and sharpness
alex-luxonis May 16, 2021
99ce505
TMP: OV9782(color) working on Left and/or Right sockets
alex-luxonis May 19, 2021
316c251
Update FW: initial support for LUX-D-LITE: IMX214 and OV7251
alex-luxonis Jun 23, 2021
29d7daa
Merge remote-tracking branch 'origin/develop' into lux-d-lite_bringup
alex-luxonis Jul 1, 2021
897e2a7
Update FW: fix some OV7251 flickering, change stereo res to 480p,
alex-luxonis Jul 2, 2021
5be4fab
Update FW: improved focus for IMX214, lowered range
alex-luxonis Jul 2, 2021
d2bd940
Merge remote-tracking branch 'origin/develop' into ov9782_low_power_t…
alex-luxonis Jul 2, 2021
78a1cf2
CameraControl: add `setExternalTrigger(numFramesBurst)`
alex-luxonis Jul 2, 2021
7484b87
ImgFrame: add API to get camera settings:
alex-luxonis Jul 15, 2021
4fa9efa
Merge remote-tracking branch 'origin/develop' into report_cam_settings
alex-luxonis Jul 22, 2021
2ee9abe
setManualFocus auto-handles focus mode now, don't set
alex-luxonis Jul 17, 2021
ed731f9
Update FW: report exposure + iso too in ImgFrame for RGB,
alex-luxonis Jul 22, 2021
2fe8aa1
CameraControl setExternalTrigger: add numFramesDiscard param
alex-luxonis Jul 26, 2021
c4b6f44
Merge branch 'report_cam_settings' into ov9782_low_power_trigger
alex-luxonis Jul 26, 2021
2398e35
CameraControl: add `setManualWhiteBalance(colorTemperatureK)`
alex-luxonis Jun 9, 2021
7a190fd
Merge remote-tracking branch 'origin/develop' into ov9782_low_power_t…
alex-luxonis Aug 9, 2021
8151abb
Merge branch 'develop' into lux-d-lite_bringup
alex-luxonis Aug 13, 2021
cb2894d
Update FW: reduce ColorCamera still pool: 4 -> 1 frame
alex-luxonis Aug 13, 2021
42fcd43
Merge 'develop' into ov9782_low_power_trigger
alex-luxonis Sep 3, 2021
0f0c15c
Update FW: support for up to 3x IMX378/IMX477 or 3x OV9782
alex-luxonis Sep 4, 2021
d80f97c
Fix FW, support for multiple IMX378/477
alex-luxonis Sep 4, 2021
bee3808
Merge remote-tracking branch 'origin/develop' into multi_cam_support
alex-luxonis Sep 7, 2021
9af2524
Merge remote-tracking branch 'origin/lux-d-lite_bringup' into multi_c…
alex-luxonis Sep 9, 2021
f7b141f
Merge remote-tracking branch 'origin/develop' into multi_cam_support
alex-luxonis Sep 9, 2021
b34a634
Merge branch 'develop' into report_cam_settings
themarpe Sep 9, 2021
8f7c502
Update FW (IMX214 multiple resolutions), add more camera sockets
alex-luxonis Sep 10, 2021
614562c
Merge remote-tracking branch 'origin/develop' into multi_cam_support
alex-luxonis Sep 10, 2021
6e8bcaa
Update FW: CAM-D (4th socket) tested, AR0234 support. Note:
alex-luxonis Sep 14, 2021
6c5070f
Update FW: changes for IMX214/OV7251, other fixes
alex-luxonis Sep 17, 2021
0109c87
Merge 'flash_bl_example_fix' into multi_cam_support
alex-luxonis Sep 18, 2021
baaa938
Update FW: fix ColorCamera `preview`/`video`/`still` when multiple ca…
alex-luxonis Sep 20, 2021
21067b8
Update FW: change SIPP mem alloc to allow 4x ColorCamera to operate a…
alex-luxonis Sep 21, 2021
55a758d
Update FW: StereoDepth: fix RGB alignment when running at calib resol…
alex-luxonis Sep 22, 2021
74d1b05
Update FW: fix for IMX378 still output at 12MP
alex-luxonis Sep 28, 2021
67027ad
Merge 'origin/develop' into multi_cam_support. Update FW:
alex-luxonis Sep 30, 2021
1812aaf
Update FW: OV9282/9782 img orientation per camera,
alex-luxonis Oct 1, 2021
c977ab4
Merge 'origin/develop' into multi_cam_support
alex-luxonis Oct 5, 2021
db10af4
Update FW: - support for camera modules with IMX380 sensor id,
alex-luxonis Oct 5, 2021
9b2de20
Update FW: IMX577 proper support (0577 sensor ID)
alex-luxonis Oct 6, 2021
f2a6d3a
Merge 'origin/develop' into multi_cam_support
alex-luxonis Oct 26, 2021
4293e76
CameraControl: add setAutoFocusLensRange
alex-luxonis Jul 24, 2021
2211302
Add `CameraControl::setFrameSyncMode`,
alex-luxonis Oct 28, 2021
0474a1a
changed spdlog visibility
saching13 Oct 30, 2021
74306ae
Add Device::getConnectedCameraProperties
alex-luxonis Nov 1, 2021
e8d6440
Add new predefined resolutions for ColorCamera: THE_1200_P, THE_13_MP
alex-luxonis Nov 3, 2021
0e323f3
Update FW: configurable FPS and fix enumeration issues with AR0234
alex-luxonis Nov 3, 2021
8505c34
Merge branch 'develop' into report_cam_settings
themarpe Nov 9, 2021
8bd6bdf
Added some getters to CameraControl and modified to use chrono where …
themarpe Nov 9, 2021
e4766c4
Update FW: populate `CameraProperties::hasAutofocus`
alex-luxonis Nov 11, 2021
b1caf57
Merge 'origin/develop' into multi_cam_support
alex-luxonis Nov 23, 2021
30f14fd
Merge 'origin/develop' into multi_cam_support
alex-luxonis Dec 6, 2021
39f4a50
OV5645 and 5MP resolution support
alex-luxonis Dec 9, 2021
19cf4d2
Merge 'origin/develop' into multi_cam_support
alex-luxonis Dec 9, 2021
c7033ae
Update FW: fixes for multiple IMX378/477
alex-luxonis Dec 10, 2021
529b342
Update FW: fixes for OV9282/9782 on CAM-D, fix stereo rectified frame…
alex-luxonis Jan 7, 2022
ff87a3b
Merge 'origin/develop' into multi_cam_support
alex-luxonis Jan 14, 2022
aa8e05a
Merge 'origin/oak-d-pro_develop' into multi_cam_support
alex-luxonis Jan 14, 2022
d2e4a8a
Update FW: allow `StereoDepth` to work with `ColorCamera`s,
alex-luxonis Jan 14, 2022
c4b5cc7
Add dot-projector/flood-illuminator brightness control for OAK-D-Pro-…
alex-luxonis Jan 17, 2022
9d66037
Merge 'origin/focal_from_intrinsics' into multi_cam_support
alex-luxonis Jan 25, 2022
661f2e4
Merge 'origin/develop' into multi_cam_support. Update FW with OV9282 …
alex-luxonis Feb 3, 2022
eb1817c
Merge 'origin/poe_improvements' into multi_cam_support, without new b…
alex-luxonis Feb 3, 2022
3f14de2
Allow using AR0234/OV5645 (but at degraded image quality) with other …
alex-luxonis Feb 7, 2022
a5981cf
Merge 'origin/develop' into multi_cam_support
alex-luxonis Feb 11, 2022
8deb3ae
Update FW with multiple fixes:
alex-luxonis Feb 11, 2022
d9ffc56
Merge 'origin/develop' into multi_cam_support
alex-luxonis Feb 17, 2022
fad962f
Merge 'origin/poe_mtu_sysctl' into multi_cam_support
alex-luxonis Mar 18, 2022
a2e9573
Fix CI build (not matching bootloader-shared commits)
alex-luxonis Mar 18, 2022
d40c282
Merge 'origin/develop' into multi_cam_support
alex-luxonis Apr 8, 2022
d092a96
Script: add optional name parameter to `setScriptPath`,
alex-luxonis Apr 13, 2022
e0cc9b4
ColorCamera/MonoCamera: add `frameEvent` output, to be used for IR co…
alex-luxonis Apr 13, 2022
31bcf54
Merge 'origin/develop' into multi_cam_support
alex-luxonis Apr 22, 2022
72b62d1
Update FW: FSYNC for IMX378
alex-luxonis Apr 28, 2022
872ddba
Merge 'origin/develop' into multi_cam_support
alex-luxonis May 18, 2022
a20d06d
Update FW, add initial support for IMX582/IMX586
alex-luxonis May 18, 2022
dfeb8fa
Merge 'origin/develop' into multi_cam_support
alex-luxonis Jun 17, 2022
0d69053
Merge 'origin/develop' into multi_cam_support
alex-luxonis Jul 12, 2022
5628336
Updates for IMX582 - full 48MP res, temporarily center cropped (5312x…
alex-luxonis Jul 12, 2022
7bf099e
Merge 'origin/develop' into multi_cam_support
alex-luxonis Jul 29, 2022
b1accef
CameraControl: add STROBE MX-GPIO control, applicable for ext trig mo…
alex-luxonis Jun 8, 2022
e5b462a
Merge 'origin/develop' into multi_cam_support
alex-luxonis Sep 8, 2022
591a98b
Pipeline: add `setImageManipCmxSizeAdjust`
alex-luxonis Sep 8, 2022
a3d6a6f
FW: fixes for 48MP camera, FW build for previous commits
alex-luxonis Sep 8, 2022
a30aa77
Fix ColorCamera::getSensorCrop calculation for AUTO, was returning zero
alex-luxonis Sep 13, 2022
3f8eca0
WIP - flashUserBootloader
themarpe Sep 14, 2022
9f6899d
Updated Bootloader and added example
themarpe Sep 15, 2022
c4936a3
Added monitor thread for DeviceBootloader
themarpe Sep 15, 2022
130baf2
Added explicit isUserBootloader call
themarpe Sep 15, 2022
f9b1e39
Merge 'origin/develop' into ir_frame_control
alex-luxonis Sep 16, 2022
f8b817b
Updated Bootloader for better User Bootloader support
themarpe Sep 17, 2022
bd61be8
MonoCamera: add frame pool size config API
alex-luxonis Sep 19, 2022
0f6f312
Merge 'origin/develop' into ir_frame_control
alex-luxonis Sep 19, 2022
aa50133
Merge branch 'main' into develop
themarpe Sep 19, 2022
c7c59ed
Removed device_information and multi_roi from tests
themarpe Sep 19, 2022
53f7050
Updated FW with ImageManip dynamic memory allocation
themarpe Sep 19, 2022
875bd7b
Disabled LATEX generation for docs
themarpe Sep 20, 2022
b88ca03
Added Warp node
themarpe Sep 22, 2022
0c1ac22
Applied style
themarpe Sep 22, 2022
3a82ecd
Set Yolo default iou threshold to 0.5
SzabolcsGergely Sep 23, 2022
4f9a8e4
Merge pull request #596 from luxonis/yolo_iou_threshold
SzabolcsGergely Sep 24, 2022
026491a
Exposed Bootloader version available when booting a device in bootloa…
themarpe Sep 24, 2022
6f21ad8
Merge branch 'image_manip_dynamic_cmx_allocation' into develop
themarpe Sep 25, 2022
56c5074
Merge branch 'network_user_bootloader' into develop
themarpe Sep 26, 2022
10ff2b4
[Warp] Exposed HW engines used and interpolation
themarpe Sep 26, 2022
c463dbc
Merge branch 'warp_node' into develop
themarpe Sep 26, 2022
401f04d
Merge 'origin/develop' into report_cam_settings
alex-luxonis Sep 27, 2022
2567abf
ImgFrame: add `getColorTemperature`. FW: fix exp/iso report for MonoC…
alex-luxonis Sep 27, 2022
632e0ce
CameraControl: update API docs, specify some defaults
alex-luxonis Sep 27, 2022
c411b34
Merge 'origin/report_cam_settings' into multi_cam_support
alex-luxonis Sep 27, 2022
c926c9f
Rename CameraProperties -> CameraFeatures
alex-luxonis Sep 28, 2022
169c506
Added a sign cast to max user bootloader size check
themarpe Sep 28, 2022
f293838
Revert "Pipeline: add `setImageManipCmxSizeAdjust`"
alex-luxonis Sep 30, 2022
a17f33e
Fix typo and add calibration_factory_reset example
Oct 3, 2022
0f761d4
Don't use the example as a part of the testing suite
moratom Oct 3, 2022
59f5e6e
DEPTHAI_DEBUG=1 env var to enable `logDevicePrints`, ColorCamera: THE…
alex-luxonis Oct 3, 2022
9a44312
Merge remote-tracking branch 'origin/develop' into report_cam_settings
alex-luxonis Oct 3, 2022
2e02737
Update FW, shared: clangformat
alex-luxonis Oct 3, 2022
1d03f7e
Merge pull request #191 from luxonis/report_cam_settings
alex-luxonis Oct 3, 2022
f456756
Merge 'origin/develop' into multi_cam_support
alex-luxonis Oct 3, 2022
ea7f371
Merge pull request #602 from luxonis/calibration_example_fix
moratom Oct 3, 2022
983a6c8
Merge 'origin/develop' into ir_frame_control
alex-luxonis Oct 7, 2022
32d3a46
`make clangformat`: calibration_factory_reset.cpp, depthai-shared,
alex-luxonis Oct 7, 2022
0da8880
Merge pull request #451 from luxonis/ir_frame_control
alex-luxonis Oct 7, 2022
80516a3
Merge 'origin/develop' into multi_cam_support
alex-luxonis Oct 7, 2022
cd69105
Exposed Timesync configurability
themarpe Dec 27, 2021
1abbd29
Merge branch 'timesync_improvements' into develop
themarpe Oct 7, 2022
a09cbea
Docs fixes
themarpe Oct 11, 2022
2a1ed06
Add support for yolov6r2 parsing
SzabolcsGergely Oct 14, 2022
2077d0b
Expand spatial image detections with original config
SzabolcsGergely Oct 14, 2022
8254066
Update CPP examples
SzabolcsGergely Oct 17, 2022
d955edb
Add getTimestamp and getTimestampDevice getter to IMU packets
SzabolcsGergely Oct 17, 2022
cc1abfa
Update IMU examples
SzabolcsGergely Oct 17, 2022
93e08e5
Add THE_1200_P for AR0234 MonoCamera
alex-luxonis Oct 17, 2022
ea01a4d
Merge 'origin/develop' into multi_cam_support
alex-luxonis Oct 17, 2022
fdf008a
Several FW updates:
alex-luxonis Oct 17, 2022
966fd0d
Color/MonoCamera: handle some more cases for newly added resolutions/…
alex-luxonis Oct 18, 2022
dc9bc3d
Update shared/FW after merge, fix error log printed for MonoCamera AU…
alex-luxonis Oct 18, 2022
3a3c2f2
Merge pull request #210 from luxonis/multi_cam_support
alex-luxonis Oct 18, 2022
eeb2577
Merge pull request #613 from luxonis/fix_getSensorCrop_auto
alex-luxonis Oct 18, 2022
fe71aa2
Closes: #355
themarpe Oct 18, 2022
55dbfca
Bump version to 2.18.0
themarpe Oct 19, 2022
acaa5f9
Updated FW with some Color/MonoCamera fixes
themarpe Oct 20, 2022
e170b4d
Merge branch 'release_v2.18.0' into main
themarpe Oct 20, 2022
4890c05
stability test
SzabolcsGergely Oct 21, 2022
c877409
Update FW:
alex-luxonis Oct 25, 2022
9568072
stability test
SzabolcsGergely Oct 21, 2022
a8a570e
Merge branch 'stability_test' into develop
themarpe Oct 28, 2022
b370de2
Added a convinience setTimesync function
themarpe Oct 28, 2022
b0b62c0
Merge remote-tracking branch 'origin/develop' into HEAD
SzabolcsGergely Oct 28, 2022
4e10716
Merge pull request #616 from luxonis/stability_test
SzabolcsGergely Oct 28, 2022
da29b22
Added isUserBootloaderSupported to DeviceBootloader
themarpe Oct 29, 2022
20e6d6c
Merge branch 'user_bootloader_update' into develop
themarpe Oct 29, 2022
317d92b
Updated XLink with Windows improvements when scanning for already boo…
themarpe Oct 30, 2022
b7fb190
Updated FW with device time reset on boot
themarpe Oct 30, 2022
8ee78b2
Bump to v2.19.0
themarpe Oct 30, 2022
27ba359
Improved wording on unavailable devices
themarpe Oct 30, 2022
2f4e16c
Fix yolo v5 decoding when there is a single class
SzabolcsGergely Oct 31, 2022
ad4a64f
FW: fixes for certain OV9782 and OV9282 permutations/configs,
alex-luxonis Nov 1, 2022
7d2d412
Update CI to Node16 compatible actions
themarpe Oct 31, 2022
fd1bd2d
Merge branch 'ci_updates' into develop
themarpe Nov 1, 2022
0ba40d0
Update FW: fix image size when decimation filter is enabled
SzabolcsGergely Nov 1, 2022
d29af8b
Merge branch 'release_v2.19.0' into main
themarpe Nov 1, 2022
f36fdfa
Stability test - limit FPS (#633)
moratom Nov 7, 2022
d2d55ec
Added getProductName
themarpe Nov 7, 2022
76e2b2b
Renamed to getDeviceName and added some legacy handling
themarpe Nov 8, 2022
7f284dc
Updated FW with productName as protected field and ImageManip behavio…
themarpe Nov 8, 2022
bca5fd2
Updated style
themarpe Nov 8, 2022
5122150
Merge branch 'device_product_name' into develop
themarpe Nov 10, 2022
4572b3e
Added IR driver support for new OAK-FFC 4P
themarpe Nov 10, 2022
5a0600f
FW: bugfix for device bootup with default static IP
themarpe Nov 10, 2022
24d81b1
Merge remote-tracking branch 'origin/fw_poe_startup_bugfix' into develop
themarpe Nov 12, 2022
6bde246
OAK-FFC 4P R5M1E5 IR/Dot support
themarpe Nov 12, 2022
9421453
Bump to v2.19.1
themarpe Nov 12, 2022
690b6a6
Merge branch 'release_v2.19.1' into main
themarpe Nov 13, 2022
444b3c0
Merge remote-tracking branch 'origin/main' into ros-release-2.19.1
saching13 Nov 28, 2022
074a07d
changed version and updated changelog
saching13 Nov 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
Changelog for package depthai
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

2.19.1 (2022-11-28)
-----------
* Added Device getDeviceName API
* OAK-FFC 4P (R5M1E5) IR/Dot support
* Additional Stability bugfixes to go along with 2.19.0 for PoE devices
* Protected productName field in EEPROM
* Contributors: Alex Bougdan, Szabolcs Gergely, Martin Peterlin


2.19.0 (2022-09-20)
-----------
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ if(WIN32)
endif()

# Create depthai project
project(depthai VERSION "2.19.0" LANGUAGES CXX C)
project(depthai VERSION "2.19.1" LANGUAGES CXX C)
get_directory_property(has_parent PARENT_DIRECTORY)
if(has_parent)
set(DEPTHAI_VERSION ${PROJECT_VERSION} PARENT_SCOPE)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "b3aeaf23ff5857fc8f79d412ceefc08da23e7aad")
set(DEPTHAI_DEVICE_SIDE_COMMIT "adbcc016c8bd5a5580a26d8b6250f77160203666")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
3 changes: 3 additions & 0 deletions examples/ColorCamera/rgb_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ int main() {
cout << "Bootloader version: " << device.getBootloaderVersion()->toString() << endl;
}

// Device name
cout << "Device name: " << device.getDeviceName() << endl;

// Output queue will be used to get the rgb frames from the output defined above
auto qRgb = device.getOutputQueue("rgb", 4, false);

Expand Down
1 change: 1 addition & 0 deletions include/depthai/device/CalibrationHandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace dai {
* - batchName
* - batchTime
* - boardOptions
* - productName
*/
class CalibrationHandler {
public:
Expand Down
6 changes: 6 additions & 0 deletions include/depthai/device/DeviceBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,12 @@ class DeviceBase {
*/
DeviceInfo getDeviceInfo() const;

/**
* Get device name if available
* @returns device name or empty string if not available
*/
std::string getDeviceName();

/**
* Get MxId of device
*
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<package format="3">
<name>depthai</name>
<version>2.19.0</version>
<version>2.19.1</version>
<description>DepthAI core is a C++ library which comes with firmware and an API to interact with OAK Platform</description>

<maintainer email="[email protected]">Sachin Guruswamy</maintainer>
Expand Down
28 changes: 28 additions & 0 deletions src/device/DeviceBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,34 @@ DeviceInfo DeviceBase::getDeviceInfo() const {
return deviceInfo;
}

std::string DeviceBase::getDeviceName() {
checkClosed();

std::string deviceName;
EepromData eeprom = readFactoryCalibrationOrDefault().getEepromData();
if((deviceName = eeprom.productName).empty()) {
eeprom = readCalibrationOrDefault().getEepromData();
if((deviceName = eeprom.productName).empty()) {
deviceName = eeprom.boardName;
}
}

// Convert to device naming from display/product naming
std::transform(deviceName.begin(), deviceName.end(), deviceName.begin(), std::ptr_fun<int, int>(std::toupper));
std::replace(deviceName.begin(), deviceName.end(), ' ', '-');

// Handle some known legacy cases
if(deviceName == "BW1098OBC") {
deviceName = "OAK-D";
} else if(deviceName == "DM2097") {
deviceName = "OAK-D-CM4-POE";
} else if(deviceName == "BW1097") {
deviceName = "OAK-D-CM3";
}

return deviceName;
}

void DeviceBase::setLogOutputLevel(LogLevel level) {
checkClosed();

Expand Down
49 changes: 44 additions & 5 deletions tests/src/stability_stress_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,24 @@
#include <opencv2/opencv.hpp>
#endif

static constexpr int RGB_FPS = 20;
static constexpr int MONO_FPS = 20;
static constexpr int ENCODER_FPS = 10;

void printSystemInformation(dai::SystemInformation info) {
printf("Ddr used / total - %.2f / %.2f MiB\n", info.ddrMemoryUsage.used / (1024.0f * 1024.0f), info.ddrMemoryUsage.total / (1024.0f * 1024.0f));
printf("Cmx used / total - %.2f / %.2f MiB\n", info.cmxMemoryUsage.used / (1024.0f * 1024.0f), info.cmxMemoryUsage.total / (1024.0f * 1024.0f));
printf("LeonCss heap used / total - %.2f / %.2f MiB\n",
info.leonCssMemoryUsage.used / (1024.0f * 1024.0f),
info.leonCssMemoryUsage.total / (1024.0f * 1024.0f));
printf("LeonMss heap used / total - %.2f / %.2f MiB\n",
info.leonMssMemoryUsage.used / (1024.0f * 1024.0f),
info.leonMssMemoryUsage.total / (1024.0f * 1024.0f));
const auto& t = info.chipTemperature;
printf("Chip temperature - average: %.2f, css: %.2f, mss: %.2f, upa: %.2f, dss: %.2f\n", t.average, t.css, t.mss, t.upa, t.dss);
printf("Cpu usage - Leon CSS: %.2f %%, Leon MSS: %.2f %%\n", info.leonCssCpuUsage.average * 100, info.leonMssCpuUsage.average * 100);
}

static const std::vector<std::string> labelMap = {
"person", "bicycle", "car", "motorbike", "aeroplane", "bus", "train", "truck", "boat",
"traffic light", "fire hydrant", "stop sign", "parking meter", "bench", "bird", "cat", "dog", "horse",
Expand Down Expand Up @@ -63,6 +81,7 @@ int main(int argc, char** argv) {
auto edgeDetectorLeft = pipeline.create<dai::node::EdgeDetector>();
auto edgeDetectorRight = pipeline.create<dai::node::EdgeDetector>();
auto edgeDetectorRgb = pipeline.create<dai::node::EdgeDetector>();
auto sysLog = pipeline.create<dai::node::SystemLogger>();
#ifdef DEPTHAI_STABILITY_TEST_SCRIPT
auto script1 = pipeline.create<dai::node::Script>();
auto script2 = pipeline.create<dai::node::Script>();
Expand All @@ -84,6 +103,7 @@ int main(int argc, char** argv) {
auto xoutEdgeLeft = pipeline.create<dai::node::XLinkOut>();
auto xoutEdgeRight = pipeline.create<dai::node::XLinkOut>();
auto xoutEdgeRgb = pipeline.create<dai::node::XLinkOut>();
auto xoutSysLog = pipeline.create<dai::node::XLinkOut>();
#ifdef DEPTHAI_STABILITY_TEST_SCRIPT
auto scriptOut = pipeline.create<dai::node::XLinkOut>();
auto scriptOut2 = pipeline.create<dai::node::XLinkOut>();
Expand All @@ -97,6 +117,7 @@ int main(int argc, char** argv) {
xoutDepth->setStreamName("depth");
xoutNN->setStreamName("detections");
xoutRgb->setStreamName("rgb");
xoutSysLog->setStreamName("sysinfo");
const auto edgeLeftStr = "edge left";
const auto edgeRightStr = "edge right";
const auto edgeRgbStr = "edge rgb";
Expand All @@ -117,17 +138,20 @@ int main(int argc, char** argv) {
camRgb->setPreviewSize(416, 416);
camRgb->setInterleaved(false);
camRgb->setColorOrder(dai::ColorCameraProperties::ColorOrder::BGR);
camRgb->setFps(RGB_FPS);

monoLeft->setBoardSocket(dai::CameraBoardSocket::LEFT);
monoLeft->setResolution(dai::MonoCameraProperties::SensorResolution::THE_400_P);
monoLeft->setFps(MONO_FPS);

monoRight->setBoardSocket(dai::CameraBoardSocket::RIGHT);
monoRight->setResolution(dai::MonoCameraProperties::SensorResolution::THE_400_P);
monoRight->setFps(MONO_FPS);

// Setting to 26fps will trigger error
ve1->setDefaultProfilePreset(25, dai::VideoEncoderProperties::Profile::H264_MAIN);
ve2->setDefaultProfilePreset(25, dai::VideoEncoderProperties::Profile::H265_MAIN);
ve3->setDefaultProfilePreset(25, dai::VideoEncoderProperties::Profile::H264_MAIN);
ve1->setDefaultProfilePreset(ENCODER_FPS, dai::VideoEncoderProperties::Profile::H264_MAIN);
ve2->setDefaultProfilePreset(ENCODER_FPS, dai::VideoEncoderProperties::Profile::H265_MAIN);
ve3->setDefaultProfilePreset(ENCODER_FPS, dai::VideoEncoderProperties::Profile::H264_MAIN);

stereo->setDefaultProfilePreset(dai::node::StereoDepth::PresetMode::HIGH_DENSITY);
// Align depth map to the perspective of RGB camera, on which inference is done
Expand All @@ -150,6 +174,8 @@ int main(int argc, char** argv) {

edgeDetectorRgb->setMaxOutputFrameSize(8294400);

sysLog->setRate(0.2f);

#ifdef DEPTHAI_STABILITY_TEST_SCRIPT
std::string source1 = R"(
import time
Expand Down Expand Up @@ -250,6 +276,9 @@ int main(int argc, char** argv) {
camRgb->video.link(edgeDetectorRgb->inputImage);
edgeDetectorLeft->outputImage.link(xoutEdgeLeft->input);
edgeDetectorRight->outputImage.link(xoutEdgeRight->input);
sysLog->out.link(xoutSysLog->input);
xoutSysLog->input.setBlocking(false);
xoutSysLog->input.setQueueSize(1);

#ifdef DEPTHAI_STABILITY_TEST_SCRIPT
script1->outputs["out"].link(script2->inputs["in"]);
Expand All @@ -269,6 +298,8 @@ int main(int argc, char** argv) {
// Connect to device and start pipeline
dai::Device device(pipeline);

auto usb_speed = device.getUsbSpeed();

// Output queues will be used to get the encoded data from the output defined above
auto outQ1 = device.getOutputQueue("ve1Out", 30, false);
auto outQ2 = device.getOutputQueue("ve2Out", 30, false);
Expand All @@ -279,7 +310,7 @@ int main(int argc, char** argv) {
auto edgeLeftQueue = device.getOutputQueue(edgeLeftStr, 8, false);
auto edgeRightQueue = device.getOutputQueue(edgeRightStr, 8, false);
auto edgeRgbQueue = device.getOutputQueue(edgeRgbStr, 8, false);

auto qSysInfo = device.getOutputQueue("sysinfo", 4, false);
#ifdef DEPTHAI_STABILITY_TEST_SCRIPT
auto scriptQueue = device.getOutputQueue("script", 8, false);
auto script2Queue = device.getOutputQueue("script2", 8, false);
Expand All @@ -298,7 +329,7 @@ int main(int argc, char** argv) {
mutex countersMtx;
unordered_map<std::string, int> counters;

thread countingThread([&countersMtx, &counters, &device, TEST_TIMEOUT]() {
thread countingThread([&countersMtx, &counters, &device, &usb_speed, TEST_TIMEOUT]() {
// Initial delay
this_thread::sleep_for(5s);

Expand All @@ -310,6 +341,7 @@ int main(int argc, char** argv) {

bool failed = counters.size() == 0;
cout << "[" << duration_cast<seconds>(steady_clock::now() - timeoutStopwatch).count() << "s] "
<< "Usb speed " << usb_speed << " "
<< "FPS: ";
for(const auto& kv : counters) {
if(kv.second == 0) {
Expand Down Expand Up @@ -353,6 +385,13 @@ int main(int argc, char** argv) {
auto edgeLefts = edgeLeftQueue->tryGetAll<dai::ImgFrame>();
auto edgeRights = edgeRightQueue->tryGetAll<dai::ImgFrame>();

auto sysInfo = qSysInfo->tryGet<dai::SystemInformation>();
if(sysInfo) {
printf("----------------------------------------\n");
std::cout << "Usb speed: " << usb_speed << std::endl;
printSystemInformation(*sysInfo);
printf("----------------------------------------\n");
}
#ifdef DEPTHAI_STABILITY_TEST_SCRIPT
auto script = scriptQueue->tryGetAll<dai::Buffer>();
auto script2 = script2Queue->tryGetAll<dai::Buffer>();
Expand Down