Skip to content

camera_app: reorder camera definition parameters for GCSs - #53

Open
rmackay9 wants to merge 2 commits into
ArduPilot:masterfrom
rmackay9:xml-param-reorder
Open

rmackay9 wants to merge 2 commits into
ArduPilot:masterfrom
rmackay9:xml-param-reorder

Conversation

@rmackay9

Copy link
Copy Markdown
Contributor

This PR makes two relatively minor changes:

  1. GCSs list parameters in the order they appear in the XML. This changes the order to put the live controls first, then thermal, streams, recording, photo and image, overlays, tracking and survey.
  2. sitl: fix stale CAM_MODE assertion in camera definition test

My AI has tested this but I have not yet. I think this is an improvement but happy to discuss if another order might be better.

Here's the new order for the MT11

# Before After
1 CAM_MODE CAM_MODE
2 SURV_LENS CAM_ZOOM
3 SURV_PATTERN CAM_OPT_ZOOM
4 SURV_OVERLAP CAM_AUTOFOCUS
5 SURV_FORE CAM_LENS
6 SURV_AFT CAM_SOURCE
7 SURV_BURST CAM_THERM_GAIN
8 SURV_BURST_MS CAM_PALETTE
9 SURV_DWELL_MS RAW_STREAM_FPS
10 SURV_SETTLE_MS RAW_RECORD_FPS
11 SURV_ERROR_CD VIDEO_MAIN_RES
12 SURV_RATE_CD VIDEO_MAIN_CODEC
13 SURV_TERR_MS VIDEO_SUB_RES
14 SURV_TERR_M VIDEO_SUB_CODEC
15 SURV_TERR_TOL REC_RESOLUTION
16 SURV_MIN_SPEED REC_AUTOSTART
17 SURV_TURN_DEG PHOTO_SCOPE
18 CAM_ZOOM IMG_BRIGHTNESS
19 CAM_OPT_ZOOM IMG_SATURATION
20 CAM_AUTOFOCUS IMG_CONTRAST
21 CAM_LENS IMG_EXPOSURE
22 CAM_SOURCE IMG_ISO
23 CAM_THERM_GAIN IMG_SHUTTER
24 CAM_PALETTE IMG_METERING
25 PHOTO_SCOPE IMG_WHITE_BAL
26 RAW_STREAM_FPS OSD_CROSS
27 RAW_RECORD_FPS OSD_RECORD
28 OSD_CROSS OSD_THERMAL_FOV
29 OSD_RECORD MAV_POS_TARGET
30 OSD_THERMAL_FOV TRACK_METHOD
31 LOG_DISARMED LOG_DISARMED
32 TRACK_METHOD SURV_LENS
33 MAV_POS_TARGET SURV_PATTERN
34 REC_AUTOSTART SURV_OVERLAP
35 REC_RESOLUTION SURV_FORE
36 VIDEO_MAIN_RES SURV_AFT
37 VIDEO_MAIN_CODEC SURV_BURST
38 VIDEO_SUB_RES SURV_BURST_MS
39 VIDEO_SUB_CODEC SURV_DWELL_MS
40 IMG_BRIGHTNESS SURV_SETTLE_MS
41 IMG_SATURATION SURV_ERROR_CD
42 IMG_CONTRAST SURV_RATE_CD
43 IMG_EXPOSURE SURV_TERR_MS
44 IMG_ISO SURV_TERR_M
45 IMG_SHUTTER SURV_TERR_TOL
46 IMG_METERING SURV_MIN_SPEED
47 IMG_WHITE_BAL SURV_TURN_DEG

rmackay9 and others added 2 commits October 16, 2026 06:15
A GCS lists parameters in XML order, which was somewhat arbitrary. Put the live
controls first, then thermal, streams, recording, photo and image,
overlays, tracking and survey.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
CAM_MODE is listed on every target with photo support, so only the Z1 Mini
lacks it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@AP-Review

Copy link
Copy Markdown

Automated review note — AI-generated (Claude+Codex), validated against the live diff. Please sanity-check before acting.
Verdict: ACCEPT

Reviewed at head d8f940c754.
Full report: https://firmware.ardupilot.org/Tools/APReview/DevCallReviews/PRReviews/ardupilot/ap_cameragimbal/53/1.html#prAP_CameraGimbal-53

Thanks, this looks good to me.

I checked that the reorder only changes order. I exported the camera-definition XML for all five targets at base and at head: every target keeps the same parameter set, with identical per-parameter XML, and all names are within 16 characters. Merging the SURV_* guards into APCAM_HAVE_PHOTO && APCAM_HAVE_THERMAL (https://github.com/ardupilot/ap_cameragimbal/pull/53/files#diff-4026e5b010f9e7daf7c40fac6c3f24b6114af3a10b43e9437069225f6b023e9bR100) is equivalent to the old nesting. Because cam_definition_version is a CRC of the XML, it changes for every target, so GCS caches will refresh. make camera-definition-test passes.

The CAM_MODE assertion fix (https://github.com/ardupilot/ap_cameragimbal/pull/53/files#diff-9df17b86452451a64062886777d468b05ec4ea9dc416b9e42e3312be185566f2R147) is correct. The old assertion already failed on zr10 under SITL, and the new one matches the target flags and the host test.

One minor point, not blocking: CI only runs sitl/test_camera_definition.py with --targets mt11 --zoom-only, which skips protocol_checks. That is why the stale assertion went unnoticed. It may be worth widening that job at some point.

Not checked: hardware, and whether QGC or Mission Planner show parameters in XML order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants