> For the complete documentation index, see [llms.txt](https://robodog.gitbook.io/robodog-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://robodog.gitbook.io/robodog-docs/software/working-with-the-ouster-os1.md).

# Working with the Ouster OS1

## Documentation

Detailed information about the ouster-ros package can be found on [Github](https://github.com/ouster-lidar/ouster-ros).

## Configuration

The ouster has to be connected to the jetson board via the usb-ethernet connector. The resulting ethernet connection `(eth1[00:3B:A3:00:6E])` has to be set to `Link-Local Only (IPv4)`.

The Ouster LiDAR can either be connected to the robot or to a personal laptop for testing. The Ouster package offers `.launch` files for running the node, recording from the sensor to a `.bag` file and replaying from a `.bag` file.

## Run

To launch all required OS1 ROS-nodes, the `sensor.launch` file can be launched by providing it the `sensor_hostname`, which consists of `os-<SERIAL_NUMBER>.local`

`roslaunch ouster_ros sensor.launch sensor_hostname:=os-122222003163.local` `viz:=false`

* `sensor_hostname` configures the node to the hardware
* `viz:=false` prevents the launch file from launching rviz on the robot

### Extract metadata

The recording of rosbags requires metadata about the sensor configuration. These can be extracted with the `service /ouster/get_config` which outputs the current metadata to the console. This string can then be saved to the `metadata.json` file.

## Record

The launch file for recording to rosbags requires both a absolute path to the `metadata.json` file and a absolute path to the generated `*.bag` file.

### **Local:**

{% code overflow="wrap" lineNumbers="true" %}

```bash
roslaunch ouster_ros record.launch sensor_hostname:=os-122222003163.local metadata:=/home/juri/ROSWorkspace/BA/src/ouster-ros/config/metadata.json bag_file:=/home/juri/ROSWorkspace/BA/bags/os1_test.bag
```

{% endcode %}

Change the `metadata.json` and the `os1_test.bag` file accordingly.

### **On robot:**

{% code overflow="wrap" lineNumbers="true" %}

```bash
roslaunch ouster_ros record.launch sensor_hostname:=os-122222003163.local metadata:=/home/unitree/catkin_ws/src/ouster-ros/config/metadata.json bag_file:=/home/unitree/catkin_ws/bags/os1_test.bag viz:=false
```

{% endcode %}

Change the `metadata.json` and the `os1_test.bag` file accordingly.

Note the change in path to `/home/`**`unitree/catkin_ws`** instead of `home/juri/ROSWorkspace` and the flag **`viz:=false`**

## Replay .bag recording

The mode to replay rosbags requires both the absolute path to the `metadata.json` and `*.bag` files. Since the replay is independent of live lidar measurements, the `sensor_hostname` doesn’t have to provided.

### **Local:**

{% code overflow="wrap" lineNumbers="true" %}

```bash
roslaunch ouster_ros replay.launch metadata:=/home/juri/ROSWorkspace/BA/src/ouster-ros/config/metadata.json bag_file:=/home/juri/ROSWorkspace/BA/bags/os1_test.bag
```

{% endcode %}

Change the `metadata.json` and the `os1_test.bag` file accordingly.

### **On robot:**

{% code overflow="wrap" lineNumbers="true" %}

```
roslaunch ouster_ros replay.launch metadata:=/home/unitree/catkin_ws/src/ouster-ros/config/metadata.json bag_file:=/home/unitree/catkin_ws/bags/os1_test.bag viz:=false
```

{% endcode %}

Change the `metadata.json` and the `os1_test.bag` file accordingly.

Note the change in path to `/home/`**`unitree/catkin_ws`** instead of `home/juri/ROSWorkspace` and the flag **`viz:=false`**


---

# 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://robodog.gitbook.io/robodog-docs/software/working-with-the-ouster-os1.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.
