Commit Graph
155 Commits
Author SHA1 Message Date
Andrew Tridgell b5fbe26515 AP_Camera: improve comments 2026-09-23 08:59:12 +10:00
Andrew TridgellandPeter Barker 3bd94f56a9 AP_Camera: deny multi-image capture with a zero interval
IMAGE_START_CAPTURE asking for more than one image with a zero interval
cannot be honoured. It was reported as FAILED by the interval check in
take_multiple_pictures; report DENIED from the command handler instead,
matching the other parameter rejections and the mission path.

Based on Peter Barker's work in ArduPilot/ardupilot#33900.

Co-authored-by: Peter Barker <pbarker@barker.dropbear.id.au>
2026-09-23 08:59:12 +10:00
Andrew Tridgell 6434442671 AP_Camera: relay MAVLink cameras and resolve camera selectors
Cache bounded stream lists and resume replies independently on each
GCS link after transmit backpressure. Expire remote capture status
after three seconds, retain locally scheduled interval capture, and
back off unanswered status requests.

Preserve native camera identity in cached replies and isolated-link
broadcasts, and suppress synthetic FC-owned status for native cameras.
Restore configured mount associations in cached information only when
a same-system camera advertises none.

Add CAMn_COMPID (0 or 7-255) so camera-v2 discovery can use a
non-default component ID. The first slot owns a colliding ID; duplicate
or invalid IDs warn and disable discovery.

Resolve command selectors as component IDs or legacy slots 1-6 with the
same rules for live commands and missions. NaN in formerly reserved
selector fields means unset. Video commands with a nonzero camera
selector treat param1 as a stream ID and pass the status frequency
through; without one they keep the old camera-slot interpretation.

Fill camera_device_id in camera information, settings, capture status,
field of view and stream messages, and document the routing and
selector design.
2026-09-23 08:59:12 +10:00
Peter Barker a526f304a5 AP_Camera: place parameter conversion table in rodata 2026-09-16 17:07:48 +10:00
Peter Barker dbe7af07be AP_Camera: use the standard PARAMETER_CONVERSION annotation
The RunCam annotation had text in front of the PARAMETER_CONVERSION
token, so a grep anchored at the start of the comment did not find it.
Both annotations also described the release in prose rather than in the
standard form.

The RunCam date was wrong as well.  It read Nov-2024, but the conversion
arrived in 399f9f6f98 "AP_Camera: RunCam camera backend", which was
authored Apr-2024 and merged Dec-2024 - the annotations on this branch
use the date the conversion landed in master, so it is Dec-2024.

Established by content rather than by date: convert_runcam_params() is
absent from Copter-4.6.0 and present in Copter-4.7.0; the CAM_TRIGG_TYPE
to CAM1_TYPE conversion is absent from Copter-4.3.0 and present in
Copter-4.4.0.  No functional change.
2026-08-31 08:18:26 +10:00
Peter Barker 37cdeab8f1 AP_Camera: add support for camera instance in SET_CAMERA_FOCUS 2026-07-01 17:22:22 +10:00
Peter Barker ef02dec9d2 AP_Camera: add ability to zoom and trigger multiple different cameras 2026-05-20 10:38:26 +10:00
Peter BarkerandClaude Sonnet 4.6 19c796ef98 AP_Camera: support per-instance CAMERA_INFORMATION via REQUEST_MESSAGE param2
param2 of MAV_CMD_REQUEST_MESSAGE (512) selects a specific camera
instance when requesting CAMERA_INFORMATION (1-based, matching the
MAVLink convention used for gimbal_device_id).  A param2 of 0 retains
the existing behaviour of sending information for all camera instances.

The per-instance send is routed through the normal deferred-message
path so that COMMAND_ACK is transmitted before the CAMERA_INFORMATION
response, matching the order expected by callers that drain non-ACK
messages while waiting for acknowledgement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 09:50:54 +09:00
Iampete1 86ed6bc964 AP_Camera: fix conversion for runcam 2026-03-13 10:57:02 +11:00
Andy Piper 399f9f6f98 AP_Camera: RunCam camera backend
RunCam parameter conversion
add RunCam camera settings and control
2024-12-13 11:07:09 +00:00
Nick Exton cb620126b3 AP_Camera: Add capability to set VIDEO_STREAM_INFORMATION from Lua 2024-10-01 08:18:54 +09:00
Nick Exton 30a212b4cf AP_Camera: Add capability to set CAMERA_INFORMATION from Lua 2024-10-01 08:18:54 +09:00
Randy Mackay 6f2a88f707 AP_Camera: support send-thermal-range 2024-09-10 20:59:49 +09:00
Randy Mackay 78d88d11a3 AP_Camera: add change settings 2024-09-03 09:04:39 +09:00
Peter Barker bc80358e9b AP_Camera: rely on AHRS for position, not GPS
our location may not be coming from a GPS
2024-08-06 12:11:30 +10:00
Peter Barker 5538f6735f AP_Camera: move switch for sending camera messages into AP_Camera
neatens GCS_Common a bit, reduces repetitive code
2024-06-05 10:29:01 +10:00
Andrew Tridgell a71585b9b8 AP_Camera: use NEW_NOTHROW for new(std::nothrow) 2024-06-04 09:20:21 +10:00
Randy Mackay 5a22fb8da5 AP_Camera: support set-camera-source mavlink command 2024-03-25 09:19:18 +09:00
Peter Barker 8fb1f6f02c AP_Camera: correct compilation when AP_CAMERA_RELAY_ENABLED is 0
... like on skyviper-v2450
2024-01-03 18:05:08 +11:00
Iampete1 8292c6ea9f AP_Camera: move to new relay functions 2023-12-19 10:01:01 +11:00
Nick Exton 477534b446 AP_Camera: Add handler for CAMERA_CAPTURE_STATUS request 2023-11-09 13:00:57 +09:00
Asif Khan 2235a8e063 AP_Camera: add send_camera_fov_status support 2023-11-02 15:54:37 +11:00
Peter Barker 0e2261832e autotest: more test for emitted digicam command-long messages 2023-11-02 15:54:13 +11:00
Peter Barker 685bdd3d3d AP_Camera: handle camera messages as COMMAND_INT as well as COMMAND_LONG 2023-11-02 15:54:13 +11:00
Randy Mackay 999a3fe8d9 AP_Camera: image-stop-capture fix for instance 2023-09-26 10:53:22 +10:00
Randy Mackay fb35d97abf AP_Camera: start-image-capture with all zeros takes single pic
returns failed if no cameras configured
2023-09-26 10:53:22 +10:00
Randy Mackay 9e3ab558b3 AP_Camera: take_pic and take_multiple_pic report success
Methods return success if at least one backend succeeds
2023-09-26 10:53:22 +10:00
Asif KhanandZachary Zalass f30af5e072 AP_Camera: add MAV_CMD_IMAGE_STOP_CAPTURE support
Co-authored-by: Zachary Zalass <zachzalass@gmail.com>
2023-09-21 21:05:01 +10:00
Asif Khan 2cc080620c AP_Camera: fix MAV_CMD_START_CAPTURE handling 2023-09-21 21:05:01 +10:00
Asif Khan 2141f06967 AP_Camera: add time based triggering support 2023-08-05 18:52:57 +10:00
Randy Mackay 1dc1d24f1e AP_Camera: add set lens support 2023-07-26 20:20:13 +09:00
Peter Barker 82b0630c6a AP_Camera: add and use SetFocusResult 2023-07-05 16:28:42 +10:00
Randy Mackay 63b4b8b7d3 AP_Camera: support camera info and settings 2023-06-16 14:30:46 +10:00
Andrew Tridgell 7175318fbb AP_Camera: fixed build on cygwin with conflicting POINT 2023-05-10 17:10:20 +10:00
Randy Mackay a6cc9f042a AP_Camera: support image tracking 2023-05-08 21:26:35 +10:00
Randy Mackay 2ff89498c5 AP_Camera: set_focus replaces set_manual/auto_focus 2023-04-26 22:55:47 +10:00
Randy Mackay a1ae189b17 AP_Camera: move ZoomType def to separate .h 2023-04-19 17:31:46 +10:00
Randy Mackay 9c72cf2a1e AP_Camera: move some includes to backend
also remove some redundant includes
2023-04-19 17:31:46 +10:00
Randy Mackay 6603a6c8c5 AP_Camera: set_zoom replaces set_zoom_step 2023-04-19 17:31:46 +10:00
Peter Barker f6fa509443 AP_Camera: add timestamp on parameter conversion function
...so we can remove this stuff more easily over time
2023-04-17 22:05:08 +01:00
Randy Mackay de4b1890f5 AP_Camera: add semaphore to allow multi-threaded access 2023-04-13 07:04:46 +10:00
Randy Mackay f357bc53fe AP_Camera: add scripting backend 2023-04-13 07:04:46 +10:00
Randy Mackay 58b73c3613 AP_Camera: constify get_instance 2023-04-13 07:04:46 +10:00
Randy Mackay b328f84260 AP_Camera: add AP_CAMERA_MAVLINKCAMV2_ENABLED definition 2023-04-06 20:58:22 +10:00
Randy Mackay a9d271ff6a AP_Camera: MAVLinkCamV2 driver 2023-04-06 20:58:22 +10:00
Randy Mackay 227daf31f7 AP_Camera: support mav-cmd-set-camera-zoom from GCS
also support focus and image capture commands
2023-03-16 07:47:01 +09:00
Randy Mackay 267f459c7e AP_Camera: remove unnecessary includes 2023-03-16 07:47:01 +09:00
Randy Mackay 9ccf08a0f8 AP_Camera: add handle_command_long 2023-03-16 07:47:01 +09:00
Peter Barker 2f95c5fa29 AP_Camera: save some bytes 2023-03-09 09:28:19 +11:00
Peter Barker 86930592c4 AP_Camera: add and use AP_CAMERA_SERVO_ENABLED 2023-03-08 19:11:30 +11:00