> For the complete documentation index, see [llms.txt](https://docs.theseus.us/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.theseus.us/cyclops/autopilot-integration/optional-improvements/cyclops-safety-switch.md).

# Cyclops Safety Switch

This Lua script allows pilots to enable/disable Cyclops position output to the autopilot using a 2- or 3-position RC switch. When disabled, Cyclops stops sending position updates to the flight controller, allowing the pilot to immediately cut Cyclops input if needed during flight. This acts as a safety cutoff for Cyclops navigation data.

Upload the script below to ArduPilot to enable this functionality:

{% file src="/files/QGxT16I4aA9OK35P9tkz" %}

Inside of your scripts folder on MAVFTP, create a `modules/MAVLink` folder. Upload the scripts contained inside of the zip file below:

{% file src="/files/KXRxuXPYE2SWdCus8I2c" %}

{% hint style="info" %}
Make sure you upload the MAVLink dependency files to enable the cyclops safety switch.
{% endhint %}

### Configuring an RC Switch

Select which switch on your controller you want to use and identify its corresponding RC channel in your mixing model. On your GCS software, set the corresponding RC option to Scripting 5 (value 304). *For example, if your switch is on RC channel 8, set* `RC8_OPTION = 304`*.*

{% hint style="info" %}
To enable this script in ArduPilot, set `SCR_USER3=1` in the Full Parameters List. To prevent the script from running, set this parameter to 0.
{% endhint %}

{% hint style="warning" %}
Note: The script functionality is hardcoded to Scripting 5 (value 304) within the provided Lua script. If you are using multiple Lua scripts on the same flight controller, make sure that those scripts do not use Scripting 5.
{% endhint %}

### Switch Positions

* <mark style="color:$success;">**LOW / MID**</mark><mark style="color:$success;">: Cyclops output enabled (default)</mark>
* <mark style="color:orange;">**HIGH**</mark><mark style="color:orange;">: Cyclops output disabled (safety cutoff)</mark>

### Startup Behavior

On boot, the script reads the current switch position and sends the corresponding enable or disable command to the Cyclops unit. This ensures the Cyclops output state always matches the physical switch position at startup. If the RC channel is not configured, no commands are sent and the Cyclops unit continues operating in its own default state (output enabled).
