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

Common: add djirs2 gimbal support to upcoming features #4912

Merged
merged 2 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions common/source/docs/common-cameras-and-gimbals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Detail topics
Gremsy Pixy U Gimbal <common-gremsy-pixyu-gimbal>
Servo Gimbal <common-camera-gimbal>
SimpleBGC Gimbal Controller <common-simplebgc-gimbal>
Siyi ZR10, ZR30 and A8 <common-siyi-zr10-gimbal>
SToRM32 Gimbal Controller <common-storm32-gimbal>
Tarot 2D Gimbal <common-tarot-gimbal>
FLIR Vue Pro Thermal Camera <common-flir-vue-pro>
Expand Down
41 changes: 41 additions & 0 deletions common/source/docs/common-djirs2-gimbal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.. _common-djirs2-gimbal:

===========================
DJI RS2 and RS3-Pro Gimbals
===========================

.. image:: ../../../images/djirs2-gimbal.png
:height: 450px

ArduPilot 4.4 (and higher) support the `DJI RS2 <https://www.dji.com/rs-2>`__ and `DJI RS3-Pro <https://www.dji.com/jp/rs-3-pro>`__ handheld gimbals using a :ref:`Lua script <common-lua-scripts>`. The driver relies on the gimbal supporting the "DJI R SDK" protocol which is only these two gimbals as far as we know. Other gimbals including the very similar RSC2 and RS3 are not supported.

What to Buy
===========

- `DJI RS2 <https://www.dji.com/rs-2>`__ or `DJI RS3-Pro <https://www.dji.com/jp/rs-3-pro>`__ gimbal
- `DJI R Focus Wheel <https://store.dji.com/product/ronin-s-focus-wheel>`__ to allow connecting to the autopilot

Connection and Configuration
============================

Connect the autopilot's CAN1 or CAN2 port to the Focus wheel as shown below

.. image:: ../../../images/djirs2-gimbal-autopilot-connection.png
:width: 450px
:target: ../_images/djirs2-gimbal-autopilot-connection.png

Connect to the autopilot with a ground station and do the following

- If using CAN1, set :ref:`CAN_D1_PROTOCOL <CAN_D1_PROTOCOL>` = 10 (Scripting), :ref:`CAN_P1_DRIVER <CAN_P1_DRIVER>` = 1 (First driver)
- If using CAN2, set :ref:`CAN_D2_PROTOCOL <CAN_D2_PROTOCOL>` = 10 (Scripting), :ref:`CAN_P2_DRIVER <CAN_P2_DRIVER>` = 2 (Second driver)
- Set :ref:`SCR_ENABLE <SCR_ENABLE>` = 1 to enable scripting
- Set :ref:`SCR_HEAP_SIZE <SCR_HEAP_SIZE>` = 120000 (or higher)
- Set :ref:`MNT1_TYPE <MNT1_TYPE>` = 9 (Scripting) to enable the mount/gimbal scripting driver
- Reboot the autopilot
- Download mount-djirs2-driver.lua (`from here <https://github.com/ArduPilot/ardupilot/tree/master/libraries/AP_Scripting/drivers>`__) and copy it to the autopilot's SD card in the APM/scripts directory and reboot the autopilot
- Optionally set DJIR_DEBUG to 1 to display parsing and errors stats at 5sec. Set to 2 to display gimbal angles

Testing
=======

See :ref:`Gimbal / Mount Controls <common-mount-targeting>` for details on how to control the gimbal
2 changes: 1 addition & 1 deletion common/source/docs/common-master-features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This lists features or changes merged in master and build in the "latest" firmwa
Trajectory Based Precision Aerobatics Scripting (replaces old page) <common-scripted-aerobatics-4.4>
[/site]
Temperature Sensors <common-temperature-sensor>
SIYI ZR10 and A8 gimbals <common-siyi-zr10-gimbal>
DJI RS2 and RS3-Pro gimbals <common-djirs2-gimbal>
Other wiki changes <common-future-wiki-changes>


Expand Down
Binary file added images/djirs2-gimbal-autopilot-connection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/djirs2-gimbal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.