Skip to content

CameraZoomPlugin: support all camera-family sensor components - #167

Open
g-ampo wants to merge 1 commit into
ArduPilot:mainfrom
g-ampo:fix/129-zoom-all-camera-types
Open

CameraZoomPlugin: support all camera-family sensor components#167
g-ampo wants to merge 1 commit into
ArduPilot:mainfrom
g-ampo:fix/129-zoom-all-camera-types

Conversation

@g-ampo

@g-ampo g-ampo commented Apr 24, 2026

Copy link
Copy Markdown

Fixes #129.

Problem

CameraZoomPlugin::PreUpdate looked up only components::Camera on the sensor entity, so the early-return fired for every other camera-family variant: boundingbox_camera, depth_camera, rgbd_camera, segmentation, thermal, wideanglecamera.

Fix

Added Impl::CameraSensorSdf helper that fans out across the camera-family components and returns the matched ComponentTypeId. PreUpdate uses it for both lookup and _ecm.SetChanged(...). LogicalCamera is excluded (no sdf::Camera).

Verification

Built against gz-sim 8.11.0 (Ubuntu 24.04). For each of 7 sensor types: minimal world + gz.msgs.Double{ data: 4.0 } on /model/cam_mount/sensor/camera/zoom/cmd_zoom. Pre-fix: only camera converged to refHfov / zoom = 0.5 rad; others stayed at 2.0 rad. Post-fix: all 7 converge.

Test fixture

Adds tests/worlds/test_camera_zoom_boundingbox.sdf as in-tree reproducer for the bbox case.

Extends PreUpdate's component lookup to accept BoundingBoxCamera,
DepthCamera, RgbdCamera, SegmentationCamera, ThermalCamera and
WideAngleCamera in addition to plain Camera. Fixes ArduPilot#129 and removes
the same latent bug for every other camera variant.
@g-ampo
g-ampo force-pushed the fix/129-zoom-all-camera-types branch from 1bacecb to 3c3ff1b Compare April 27, 2026 23:03
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.

CameraZoomPlugin not working with BoundingBox Camera

1 participant