Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.7:Runcam backend #6473

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions common/source/docs/common-camera-runcam.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
RunCam Camera Support
=====================

*Note that this feature will be released in ArduPilot 4.1*

Description
===========

RunCam devices support the `Runcam Device Protocol <https://support.runcam.com/hc/en-us/articles/360014537794-RunCam-Device-Protocol>`_ which is the serial communication protocol initially developed for the RunCam Split and analog cameras.

The protocol itself supports not only full camera OSD menu navigation but also triggering recording on split style cameras as well as communicating the available SD-card space, syncing the current date, writing to the OSD and turning the camera or WiFi function (if available) on and off.
Expand Down Expand Up @@ -36,24 +33,35 @@ Setup

Note that so-called "Joystick control" is not supported and some devices only support joystick control, so be careful when selecting the RunCam model you are going to use. The following devices have been tested successfully - RunCam Split 3s Micro, RunCam Split 2s, RunCam Racer 3.

* In order to recognize the RunCam serial protocol on the UART, set the UART serial protocol to 26. So for instance for serial port 5, set :ref:`SERIAL5_PROTOCOL <SERIAL5_PROTOCOL>` = 26 (RunCam protocol). The correlation between serial port numbering and UART physical ports for your autopilot should be documented in its description page linked :ref:`here <common-autopilots>`.
ArduPilot supports up to two cameras. For the rest of this article, it is assumed that the RunCam is setup as the first camera.

- Set :ref:`CAM1_TYPE<CAM1_TYPE>` = "8" (RunCam)

- In order to recognize the RunCam serial protocol on the UART, set the UART serial protocol to 26. So for instance for serial port 5, set :ref:`SERIAL5_PROTOCOL <SERIAL5_PROTOCOL>` = "26" (RunCam protocol). The correlation between serial port numbering and UART physical ports for your autopilot should be documented in its description page linked :ref:`here <common-autopilots>`.

When the camera is connected correctly and the serial port configured correctly you will see a message similar to the following at boot: ``APM: RunCam initialized, features 0x0077, 2-key OSD`` otherwise you will see ``APM: RunCam device not found``.
When the camera is connected correctly and the serial port configured correctly you will see a message similar to the following at boot: ``APM: RunCam initialized, features 0x0077, 2-key OSD`` otherwise you will see ``APM: RunCam device not found``.

The camera must be powered and fully booted in order to accept commands. This can take some time and the delay between the autopilot booting and the camera being probed can be controlled through `CAM_RC_BT_DELAY``. The camera will be probed repeatedly until ``CAM_RC_BT_DELAY`` elapses, but once that has expired the camera will not be probed again.
- The camera must be powered and fully booted in order to accept commands. This can take some time and the delay between the autopilot booting and the camera being probed can be controlled through :ref:`CAM1_RC_BT_DELAY<CAM1_RC_BT_DELAY>`. The camera will be probed repeatedly until :ref:`CAM1_RC_BT_DELAY<CAM1_RC_BT_DELAY>` elapses, but once that has expired the camera will not be probed again.

* Some split-style cameras support three modes - video standby, video start and picture mode. It is not possible to tell from the RunCam device protocol whether this is the type of camera in use and so this must be configured. Set `CAM_RC_TYPE`` = 2. Most other cameras should be fine with the default, however some of the later cameras have a bug where video start/stop protocol commands are not properly supported and a workaround has to be used. Cameras known to have this problem are the RunCam Split4k and require setting ``CAM_RC_TYPE`` = 3. In addition to this problem RunCam Hybrid cameras have a QR code mode which can also cause problems for recording control. For RunCam Hybrids set ``CAM_RC_TYPE`` = 4. For RunCam2 4K camera, set ``CAM_RC_TYPE<CAM_RC_TYPE`` = 5.
- Some split-style cameras support three modes - video standby, video start and picture mode. It is not possible to tell from the RunCam device protocol whether this is the type of camera in use and so this must be configured.
- Set :ref:`CAM1_RC_TYPE<CAM1_RC_TYPE>` = "2".

Note that RunCam are bringing out new cameras all the time and seem to change the video controls with almost every camera, so if you are having issues - particularly with video control - try one of the other camera types for ``CAM_RC_TYPE``.
- Most other cameras should be fine with this value, however some of the later cameras have a bug where video start/stop protocol commands are not properly supported and a workaround has to be used. Cameras known to have this problem are the RunCam Split4k and require setting :ref:`CAM1_RC_TYPE<CAM1_RC_TYPE>` = "3".
- In addition to this problem RunCam Hybrid cameras have a QR code mode which can also cause problems for recording control. For RunCam Hybrids set :ref:`CAM1_RC_TYPE<CAM1_RC_TYPE>` = "4".

- For RunCam2 4K camera, set :ref:`CAM1_RC_TYPE<CAM1_RC_TYPE>` = "5".

.. note:: RunCam is bringing out new cameras all the time and seem to change the video controls with almost every camera, so if you are having issues - particularly with video control - try one of the other camera types for :ref:`CAM1_RC_TYPE<CAM1_RC_TYPE>`.

* In order to control start and stop of video recording from a radio transmitter set a free rc channel to ``RCx_OPTION`` = 78 to enable triggering from that RC input channel. If the switch is in the low position then video recording is stopped, if in the high position then video recording is started.

* In order to control entering the OSD menu set a free rc channel to ``RCx_OPTION`` = 79. If the switch is in the low position then the OSD menu is exited, if in the high position then the OSD menu is entered. The OSD menu can also be entered by default through rolling hard right while disarmed.

* The available features of the attached RunCam device are queried by the driver but can be disabled by setting up the :ref:`CAM1_RC_FEATURES<CAM1_RC_FEATURES>` bitmask with the desired features to enable (asssuming the camera model actually supports them)

OSD Menu Control
================

A big part of the RunCam feature is support for the OSD menu. The OSD menu allows various properties of a connected camera to be controlled via RC stick gestures. The easiest way to enter the OSD menu is to push the stick for Roll hard right. This gesture is enabled by default but can be changed by setting ``CAM_RC_CONTROL``. Once in the menu, the Pitch stick will allow you to navigated between menu items and Roll right will usually allow you to select items or navigate into sub-menus. The OSD menu can only be entered while disarmed.
A big part of the RunCam feature is support for the OSD menu. The OSD menu allows various properties of a connected camera to be controlled via RC stick gestures. The easiest way to enter the OSD menu is to push the stick for Roll hard right. This gesture is enabled by default but can be changed by setting :ref:`CAM1_RC_CONTROL<CAM1_RC_CONTROL>`. Once in the menu, the Pitch stick will allow you to navigated between menu items and Roll right will usually allow you to select items or navigate into sub-menus. The OSD menu can only be entered while disarmed.

The transmitter sticks can be used to control the OSD menu as follows:

Expand Down