Repository navigation
Conversation
Library - Frames returned by getLastFrame() are no longer overwritten while in use - Frames and sensors data share the host clock; frames take the timestamp of their hardware sync signal when the synchronization is enabled - Add getIMUData() to receive every IMU sample, camera listing, open by serial number, close() and isOpened() for video and sensors - Camera settings report if they have been accepted - Fix hangs in the reset functions and when closing right after opening, the crash when connecting the sensors to a second camera, leaks when opening fails and a buffer overflow in the LED commands - resetGamma() restores the factory gamma, getGamma() reads the real value Examples and tools - Depth is extracted on CPU from grayscale images with new default parameters and automatic refinement of the rectification - Add zed_open_capture_benchmark to measure image, sensors and depth performance without a display - Sensors and sync examples no longer lose IMU samples; the multi-camera example searches the connected cameras Build - C++17, CMake 3.16, warnings enabled, sanitizer option - Install a CMake package and a pkg-config file - The udev installer applies the rules without replugging the camera
The tests run on every connected camera, without a display, and check video streaming in every mode, camera controls, sensors rate and timestamps, and the video/sensors synchronization. Enable them with -DBUILD_TESTS=ON.
Add usage of the new functions, build options, test instructions, depth settings and the benchmarks measured on Raspberry Pi 4 and NVIDIA Jetson AGX Thor.
- Print a warning when the environmental and temperature sensors of the camera stop providing new data, pointing to resetSensorModule() - Benchmarks measured again with a ZED 2i on the Jetson AGX Thor and with a textured scene for the depth - Describe MODE_HH4 and the left-right check in the depth settings
- Build: GCC and Clang, x86_64 and ARM64, every module configuration with warnings as errors, installed package used through CMake and pkg-config, tests that do not need a camera, also with address and thread sanitizers - Documentation: generated without warnings on pull requests, published from master - Checks: static analysis, CodeQL, no references to internal tools - Release: created from the changelog when a version tag is pushed - Fix two warnings reported by Clang
Reported by the static analysis
Add continuous integration
- The depth example no longer uses the OpenCV Viz module: on Raspberry Pi 4 its window opened and closed continuously with shader errors, and it was not available with OpenCV builds without Viz, like on NVIDIA Jetson. The point cloud is drawn on CPU with mouse controls - The depth map is displayed with the size of the left image - Complete the v0.6.0 section of the changelog and bring the v1.0.0 section up to date
The old product links of the website all redirected to the same page
…ot answer - Wait for the camera to complete each control command, check the register writes and read back the settings, so gain, exposure, hue and the other controls are applied at start-up and while streaming - Keep the manual exposure within the limit of the current frame rate - ZED 2 and ZED 2i: when the image sensors do not answer at the start of the stream, wait for the camera to start them again, then restart the camera through its sensors module if needed - README: describe when the image sensors and the environmental sensors stop, how to avoid it, and how to reset the sensors module at start-up
- New control tests and long stress tests of video, sensors and camera settings, with the duration scaled by an environment variable - The sensors stress test resets the sensors module first, so earlier video-only cases cannot leave the environmental sensors stopped
The release workflow reads the release notes from the new file name
Summary for the reviewWhat changes for users
Breaking changes (listed in Validation of the final code, full pass at 1.5 times the default stress length:
Address and thread sanitizer builds on the Thor: no report. No failed open, refused setting or changed manual exposure in any stress case; 360 s of sensors with no IMU pause and environmental data at 25 Hz without gaps. For the reviewer
|
The variables of the camera restart are only used when the sensors module is built
While the sensors module sends data, the left image sensor of the ZED 2 and ZED 2i stops answering for 0.5 to several seconds at a time: reads return 0xff or 0x00 and writes are lost. Outside these windows a single reply can also carry a wrong value. - Gain and exposure are accessed as a group of 3 registers, between two reads of the chip ID: if either is wrong, the group is repeated every 10 ms, for up to 6 seconds - Every register is read twice, and a write must be read back with the written value - No retry when the camera cannot be reached - getGain() and getExposure() return an error instead of a wrong value Tested on ZED 2i with the IMU streaming, 1000 cycles of brightness, gain and exposure on both sensors with read-back: 0 failures in 3 runs (previously 15 failed cycles out of 400). test_controls passes.
The depth example shows how to use the camera images: the quality of the depth map is not a goal of this repository. - Stereo matching defaults back to the previous values (blockSize 3, disp12MaxDiff 96) - Remove the automatic correction of the vertical misalignment of the images and the median filter of the disparity - Remove the recording, replay and depth quality measures of the benchmark, and the "Valid pixels" and "Refine" columns of its table - Remove the depth quality claims and the parameter guide from README, changelog and benchmarks page The fixes of the depth example are kept: disparity no longer increased by one pixel, failed matches and out of range values not used, point cloud viewer without OpenCV Viz.
The depth timing tables were measured with the previous stereo matching defaults. The complete benchmarks stay in the documentation.
They were measured with the previous stereo matching defaults.
|
initializeVideo() recovery: the retry loop has no pause when the sensors module is in use zed-open-capture/src/videocapture.cpp Lines 744 to 753 in e7beea6 When resetSensorModule(sn) fails, this loop calls initializeVideoBySerialNumber(sn) back to back for RECOVERY_TIMEOUT_NSEC (15 s). The other branch waits usleep(500000) between attempts. When the camera opens, each attempt already takes up to about 7 s (SENSORS_READY_MSEC + SENSORS_RESTART_MSEC), so that case is fine. When the open fails fast, the loop opens every /dev/video* and reads its serial number continuously for 15 s, using a full CPU core. Logs are silenced the whole time, because verbose is set to NONE. The open fails fast when: the camera is unplugged, |
Good catch. Fixing it |
When the sensors module cannot restart the camera, the recovery loop retried without pause for 15 s. If opening failed fast (camera unplugged, device busy, serial number not readable), it scanned every video device about 1,300 times per second with logs silenced. Both cases now wait 500 ms between attempts. The log after a successful recovery now says whether the camera was actually restarted.
|
Thanks, fixed in 849b1a7: the two loops are merged and every attempt waits 500 ms. The log after a recovery now also says whether the camera was actually restarted, since that branch logged "Camera restarted" even when the reset had failed. Tested on a ZED 2i with a fault-injection build that forces the "image sensors do not answer" path:
One correction on the cost: the process used about 1.25 s of CPU over the 15 s, not a full core. Most of the time went into opening each The pause now also comes before the first attempt when the reset fails. This costs 0.5 s on a rare path. It keeps both cases identical, and after a successful reset it avoids opening the camera before it drops off the bus. |
Summary
Full review of the library and of the examples for v1.0.0, to give reliable access to ZED 2i, ZED 2 and ZED Mini on Linux computers without the ZED SDK and without an NVIDIA GPU, including Raspberry Pi 4.
What changes for users
Reliability
getLastFrame()are no longer overwritten while the application uses themgetIMUData()returns all the samples received after the previous callisOpened()), and a warning is printed when the environmental sensors of the camera stop providing new dataCamera controls
getGain()andgetExposure()return an error instead of a wrong value (e.g. an exposure of 95325)initializeVideo()waits for the camera to start them again (about 6 s), then restarts the camera through its sensors module if needed, instead of returning a camera without framesTimestamps
enableSensorSync()each frame takes the timestamp of the IMU sample acquired with its hardware sync signal, immediately (99-100% of the frames in the tests)New functions
VideoCapture::getDeviceList(),initializeVideoBySerialNumber(),close(),isOpened(),getFps(),getCameraModel()SensorCapture::getIMUData(),close(),isOpened()Depth example
Tools, build and documentation
zed_open_capture_benchmark: image, sensors and depth performance of the host as Markdown tables, without a display-DBUILD_TESTS=ON), with camera control tests and long stress tests (ZED_OC_STRESS_SCALEsets their length)make installprovides a CMake package and a pkg-config fileContinuous integration (from #50)
master, static analysis, CodeQL, and a workflow that creates the release when a version tag is pushedmasterAPI changes
Existing applications need small changes, listed in the changelog. The main ones:
trueif the camera accepted it.setAECAGC,setLEDstatus,getLEDstatusandtoggleLEDreturned anintwith0for successFrame::frame_idis the frame counter of the driverTests
Stress tests, 1.5 times the default length, on the three cameras (all pass: 17 on the Thor, 8 on the Pi):
USB power management was ruled out as the cause of the sensors issues: they also happen with every USB device of the camera, its hubs and the root hubs kept powered.
Gain and exposure with the sensors module streaming, on x86_64 with ZED 2i: 1000 cycles of brightness, gain and exposure on both sensors with read-back, repeated 3 times, with an IMU thread: no failure (15 failed cycles out of 400 before the fix).
Not tested: the first ZED model, the stress tests on x86 hosts, Windows.
Before the release