# Running ROS2 Onboard OAK4-D

In this example, we deploy a ROS 2 application directly onboard OAK4-D with no external ROS computer. The demo uses an iRobot
Create 3 robot base and an OAK4-D running onboard perception and control for person-follow behavior.

The person-following app is only a demonstration workload. The core takeaway is the deployment pattern: package ROS 2 as a Luxonis
App and manage devices through Luxonis Hub for remote deployment, debugging, fleet operations, and OTA updates.

## A Note on ROS 2 Deployment Modes

This walkthrough focuses on STANDALONE mode, where ROS 2 runs fully on OAK4-D.

OAK4 also supports PERIPHERAL mode, where part of the workload runs on the camera but still depends on host PC resources.

The blog post uses ROS 2 Kilted, and notes that the same setup pattern works for Jazzy/Humble host environments as well.

## Existing ROS 2 App Examples

Before building a custom deployment, you can start from:

 * Ready-to-run ROS 2 apps in Luxonis Hub
 * Additional ROS app examples in the [`oak-examples`](https://github.com/luxonis/oak-examples) repository

For this industry example, the focus is a custom robot deployment on Create 3.

## Hardware Setup

For this demo setup:

 * Robot base iRobot Create 3
 * Edge compute + perception Luxonis OAK4-D
 * Robot link Ethernet between Create 3 and OAK4-D
 * Power MW-PoE-PB PoE injector power bank for OAK4-D
 * Cloud/device management USB WiFi dongle attached to OAK4-D

The referenced setup uses a MediaTek MT7601U WiFi dongle. Supported out-of-the-box chipsets include RTL8811CU/RTL8812CU and
MT7601U.

## Camera and Networking Setup

To keep direct robot communication while preserving Hub connectivity, configure both static Ethernet and WiFi.

 1. Initial connection via PoE+ switch Connect OAK4-D to a PoE+ switch with DHCP internet so initial setup and WiFi authentication
    can complete.
 2. Generate static IP configuration In the web configurer, enable SSH and set static Ethernet values for robot communication
    (example from the post: `192.168.186.3`, mask `255.255.0.0`, gateway `0.0.0.0`).
 3. Apply setup on device Use `oakctl` setup commands generated by the configurer to apply device configuration.
 4. SSH to the camera While connected to the PoE switch, identify the DHCP address: `oakctl list` Then connect: `ssh
    root@CAMERA_IP`
 5. Connect WiFi On the camera: `nmcli d wifi connect <ssid> password <password>`

### Possible combinations

The next illustration shows a couple of ideas for possible camera positions and the needed components.

### Running ROS2 Onboard OAK4-D Blogpost

Read the full write-up on deploying ROS 2 workloads directly onboard OAK4-D.

[Read the blogpost](https://discuss.luxonis.com/blog/6695-running-ros2-onboard-oak4-d)
