> For the complete documentation index, see [llms.txt](https://docs.gremsy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gremsy.com/gremsy-tiny-series/lynx/third-parties-integration/companion-computer-for-uav-and-robotics-platform.md).

# COMPANION COMPUTER FOR UAV & ROBOTICS PLATFORM

**1. System Overview Diagram**

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

***

**2. Hardware Connection**

**Option A: Ethernet (Recommended)**

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

<figure><img src="/files/1vA2qiqPt7Je0UVrCPkr" alt=""><figcaption></figcaption></figure>

**Option B: UART (Alternative)**

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

<figure><img src="/files/e9lbF36oo7MCcmZUiCa1" 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="/pages/c2P0BVFjieVLXmOdjluP" %}
[GREMSY PAYLOAD SDK](/payloads/general/gremsy-payload-sdk.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.gremsy.com/gremsy-tiny-series/lynx/third-parties-integration/companion-computer-for-uav-and-robotics-platform.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
