# COMPANION COMPUTER FOR UAV & ROBOTICS PLATFORM

**1. System Overview Diagram**

```
Companion / Onboard Computer (Jetson / RPi / NUC)
     ├── [UDP via Ethernet or UART] → Orus L Control (Payload SDK)
     ├── [RTSP Stream] ← Orus L Camera Output
     └── [Optional] → Flight Controller (MAVLink)
```

***

**2. Hardware Connection**

**Option A: Ethernet (Recommended)**

* Connect Orus L's Ethernet port to the onboard computer's Ethernet port (or via USB-C to Ethernet adapter)

<figure><img src="https://3309772875-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnikHUDUd2JXqkOsnOi7l%2Fuploads%2Fof2RbFDXxQujVFJ3bmYo%2Fintergration%20(5).png?alt=media&#x26;token=f1164b51-c164-4c52-9c63-d853e2ed7705" alt=""><figcaption></figcaption></figure>

**Option B: UART (Alternative)**

* Connect UART TX/RX lines from Orus L to onboard serial port
* Ensure proper logic level (3.3V TTL)

<figure><img src="https://3309772875-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FnikHUDUd2JXqkOsnOi7l%2Fuploads%2FMPy4i0JUKCqoUxqnCAdE%2Fintergration%20(6).png?alt=media&#x26;token=55ae018a-5f25-4c81-ae14-db79d89a0794" alt=""><figcaption></figcaption></figure>

**Optional:**

* Connect Flight Controller (Pixhawk) via separate UART for MAVLink passthrough if needed

***

**3. Software Setup: Gremsy Payload SDK (v3)**

**A. Install SDK (Python version)**

```
# Clone the SDK
git clone -b payloadsdk_v3 https://github.com/Gremsy/PayloadSdk.git
cd PayloadSdk/python

# Install dependencies
pip install -r requirements.txt
```

**B. Initialize SDK and Connect**

```
from payloadsdk import GremsySDK

# Create SDK instance and connect via Ethernet (UDP)
sdk = GremsySDK(protocol='udp', target_ip='192.168.12.249', target_port=14566)

# Or connect via UART
# sdk = GremsySDK(protocol='serial', serial_port='/dev/ttyUSB0', baudrate=115200)

sdk.connect()
```

**C. Send Basic Commands**

```
# Move gimbal to specific angles
sdk.gimbal_control.set_angle(pitch=0.0, roll=0.0, yaw=90.0)

# Start/Stop video recording
sdk.camera_control.set_recording(True)

# Set gimbal mode
sdk.gimbal_control.set_mode('lock')
```

***

**4. RTSP Video Streaming**

* Use VLC or OpenCV to access the video stream:

```
rtsp://192.168.12.249:8554/payload
```

* Example with OpenCV:

```
import cv2
cap = cv2.VideoCapture('rtsp://192.168.12.249:8554/payload')

while True:
    ret, frame = cap.read()
    if ret:
        cv2.imshow("Orus L Stream", frame)
    if cv2.waitKey(1) == 27:
        break
cap.release()
cv2.destroyAllWindows()
```

***

**5. Optional: Integration with MAVLink and Flight Controller**

* If a flight controller is present, you can:
  * Forward MAVLink commands from Pixhawk to Orus L (mount\_control)
  * Synchronize gimbal with autopilot commands
* Requires proper UART bridge and time sync if needed

***

**6. Use Cases**

* Onboard AI/ML target detection and autonomous gimbal pointing
* GPS-denied or tethered drone operations
* Ground robot (UGV) with 3-axis PTZ camera functionality
* Inspection and defect detection robots with onboard processing

DETAILED PAYLOAD SDK

{% content-ref url="../../general/gremsy-payload-sdk" %}
[gremsy-payload-sdk](https://docs.gremsy.com/payloads/general/gremsy-payload-sdk)
{% endcontent-ref %}
