Skip to content

Conversation

@julianoes
Copy link
Contributor

julianoes and others added 8 commits September 1, 2025 13:03
This is an attempt to fix some of the corner cases trying to discover
cameras, namely:

- Implement missing retries for CAMERA_INFORMATION, us old specific
  commands and REQUEST_MESSAGE.
- Try to simplify CameraControl::_initWhenReady a bit.
- Fix _requestStreamInfo() and _requestStreamStatus() using wrong retry
  variable.
- Add a few missing timers.
The logic was spread across 3 functions, we can actually remove a bit of
this duplication.
This makes us retry to discover a camera if it disappears after not
having been connected previously (for whatever reason).
In case a camera takes a while to properly respond, it's useful to wait
a while with retries while also not spamming the component with commands
the whole time. Therefore, retry with exponential backoff should do the
job.
- Fix missing retry counter reset in handleCaptureStatus()
- Fix missing timer stop in handleCaptureStatus()
- Consolidate inconsistent counter usage for REQUEST_CAMERA_CAPTURE_STATUS
- Standardize all retry limits to 6 attempts (was mixed 5/6)
- Standardize all retry timeouts to 1000ms (was mixed 500ms/1000ms)
- Standardize video stream info retry factor from 5 to 6 (_expectedCount * 6)
- Standardize _initWhenReady timing to consistent 500ms spacing
- Add consistent debug logging across all request functions
- Verify all success handlers properly stop timers and reset counters
- Ensure all requests use proper alternating message patterns
This fixes the unittests segfaulting.
* VideoManager: fix crash on camera disconnect

This fixes a segfault in:

src/VideoManager/VideoManager.cc:551
MavlinkCameraControl *pCamera = _activeVehicle->cameraManager()->currentCameraInstance();

* FlightMap: drive-by bugfix

---------

Co-authored-by: Holden Ramsey <[email protected]>
@DonLakeFlyer
Copy link
Collaborator

Thanks Julian

@DonLakeFlyer DonLakeFlyer reopened this Sep 15, 2025
@DonLakeFlyer DonLakeFlyer merged commit 15f61a1 into Stable_V5.0 Sep 15, 2025
23 of 25 checks passed
@DonLakeFlyer DonLakeFlyer deleted the pr-camera-backports branch September 15, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants