# Software driver

### Next Vision Gimbal (NVGimbal) Library <a href="#next-vision-gimbal-nvgimbal-library" id="next-vision-gimbal-nvgimbal-library"></a>

The NVGimbal library supports camera operations as described in the `Colibri Camera Control Protocol v 3.9`.

### Trial Version <a href="#trial-version" id="trial-version"></a>

#### **Prerequisites**

1. NextVision Gimbal, adapter board, and CSI flex cable compatible with DroneCore.Suite.
2. DroneCore.Suite 1.2 or DroneCore.Suite 2.0.
3. One of the following configurations flashed: Xavier NX + DCS 1.2 + JP 5.1.2 or Orin NX + DCS 2.0 + JP 5.1.2.

To flash Nvidia Jetson with the required configuration, use [dcs-deploy](https://github.com/airvolute/dcs-deploy). Follow these steps to flash the compatible configuration:

```python
git clone -b jp_512_20_configs https://github.com/airvolute/dcs-deploy.git
cd dcs-deploy

# Put the device in force recovery mode, connect it to your host PC via USB dev, and select the appropriate version.

# For Orin NX + DCS 2.0 + JP 5.1.2:
python3 dcs_deploy.py flash orin_nx 512 2.0 nvme full 

# For Xavier NX + DCS 1.2 + JP 5.1.2:
python3 dcs_deploy.py flash xavier_nx 512 1.2 nvme full

# Note: For Xavier NX, you can also use the EMMC configuration. However, installing Jetpack may not be possible due to limited space. NVME is recommended.
python3 dcs_deploy.py flash xavier_nx 512 1.2 emmc full
```

#### **Installation of Trial Version**

To install the trial version and follow these steps:

1. Download the trial version package: `wget https://airvolute.com/download/Jetson_system/NVGimbal/trial/libnv_gimbal.tar.gz`
2. Copy the package to the device: `scp $HOME/Downloads/libnv_gimbal.tar.gz dcs_user@192.168.55.1:/home/dcs_user`
3. Log in to the device: `ssh -X dcs_user@192.168.55.1`
4. Apply the patch (with parameter `--dcs-revision` specify version 1.2 or 2.0): `mkdir -p $HOME/libnv_gimbal && tar -xvf libnv_gimbal.tar.gz -C $HOME/libnv_gimbal && bash $HOME/libnv_gimbal/install/install_nv_gimbal_lib.sh --dcs-revision x.x`
5. Reboot or turn off the device.
6. Connect the gimbal using the adapter. The CSI flex cable must be connected to CSI A port (DCS 1.2) or CAM 2/3 (DCS 2.0). USB can be connected to any USB port.
7. Start the device and log in: `ssh -X dcs_user@192.168.55.1`
8. Run the application: `$HOME/libnv_gimbal/example/nv_gimbal_test`

After completing these steps, you should see the output of the video stream. Approximately 10 seconds after startup, you will be able to control the gimbal as per the application output. The trial version is limited to a maximum of 10 minutes and has an approximate 10-second startup time.

{% hint style="info" %}
Note: If the stream is not smooth, this may be due to USB dev speed limitations. You can connect a monitor and keyboard to the DroneCore and run the demo this way.
{% endhint %}

{% hint style="info" %}
Note: If you are interested in receiving source code for a trial example, please contact us
{% endhint %}
