Random motion sensor initialization failures

Rarely, every once in a while the SDK will not be able to initialize the motion sensors on a ZED 2i (Windows 10, Python SDK):

[2023-10-27 18:04:55 UTC][ZED][INFO] Logging level INFO
[2023-10-27 18:04:57 UTC][ZED][INFO] [Init]  Depth mode: QUALITY
[2023-10-27 18:05:05 UTC][ZED][WARNING] [ZED] Sensors could not be initialized. Some modules (AI-based) might not work correctly.
[2023-10-27 18:05:05 UTC][ZED][INFO] [Init]  Camera successfully opened.
[2023-10-27 18:05:05 UTC][ZED][INFO] [Init]  Camera FW version: 1523
[2023-10-27 18:05:05 UTC][ZED][INFO] [Init]  Video mode: HD720@30
[2023-10-27 18:05:05 UTC][ZED][INFO] [Init]  Serial Number: S/N 30469917
[2023-10-27 18:05:06 UTC][ZED][WARNING] MOTION SENSORS REQUIRED in enum sl::ERROR_CODE __cdecl sl::Camera::enableBodyTracking(struct sl::BodyTrackingParameters)

It is not specific to a particular camera, I have seen it happen on more than one of our 2i’s.

When the camera gets in this state the only solution is to hard power cycle it by re-plugging the USB.

How do I prevent this from happening?

Hi @JC3
what version of the ZED SDK are you using?
Have you checked that the cable screws are strongly strengthened?
You can avoid unplugging and replugging the camera by calling the sl::Camera::reboot function.

ZED SDK 4.0.7

The cable screws are securely fastened.

I will try implementing automatic reboots if enableBodyTracking fails and see if that works around the issue.

Rebooting via software does not help.

Last night I had a camera running that spuriously lost its connection for no reason that I can understand, and failed to recover the motion sensors:

[ZED][Grab] Detected Connection Failure. Trying to recover the camera with sn 37175491 ...
............[2023-10-31 20:52:49 UTC][ZED][ERROR] [Grab]  Failed to recover image capture... Cannot communicate with camera.
[2023-10-31 20:52:49 UTC][ZED][WARNING] CAMERA MOTION SENSORS NOT DETECTED in sl::ERROR_CODE sl::Camera::grab(sl::RuntimeParameters)
37175491: Grab failed: CAMERA MOTION SENSORS NOT DETECTED

My software was set up to auto reboot in response to too many errors but even this did not recover the camera:

[ZED][Grab] Detected Connection Failure. Trying to recover the camera with sn 32182788 ...
............[2023-11-01 13:03:46 UTC][ZED][ERROR] [Grab]  Failed to recover image capture... Cannot communicate with camera.
[2023-11-01 13:03:46 UTC][ZED][WARNING] CAMERA MOTION SENSORS NOT DETECTED in sl::ERROR_CODE sl::Camera::grab(sl::RuntimeParameters)
32182788: Grab failed: CAMERA MOTION SENSORS NOT DETECTED
32182788: Rebooting camera...
[2023-11-01 13:03:46 UTC][ZED][WARNING] CAMERA NOT DETECTED in static sl::ERROR_CODE sl::Camera::reboot(int, bool)
32182788: Reboot result: CAMERA NOT DETECTED
[ZED][Grab] Detected Connection Failure. Trying to recover the camera with sn 32182788 ...

So it does not appear that there is any good way to recover from this state. This is one of a number of various stability issues we’ve been seeing with the ZED 2i.

This is Ubuntu 22 with SDK 4.0.7 and the Python API.

Can you please monitor the temperature of the camera to verify that this problem is not caused by overheating?

It is also possible that your PC puts the USB port in suspend mode and the camera cannot be recovered when the power is reset.