Sample Sessions

These sample sessions will provide sample workflows for working with pcaps, sensors, and OSFs. Either can be done independently, but users with access to a sensor may wish to work with the sensor first, so that they will have recorded a pcap play back in the second sample.

Sample sensor session

Connect a sensor via Ethernet to the system with Ouster SDK installed.

Note

Bear in mind that following the steps below will modify the sensor’s configuration.

First we configure the sensor with standard ports, azimuth window, operating mode, and auto udp dest:

$ ouster-cli source <SENSOR HOSTNAME> config

You should get a return that looks like

No config specified; using defaults and auto UDP dest:
{
    "azimuth_window":
    [
        0,
        360000
    ],
    "operating_mode": "NORMAL",
    "udp_port_imu": 7503,
    "udp_port_lidar": 7502
}

Let’s see what the sensor is seeing in a pretty visualizer:

$ ouster-cli source <SENSOR HOSTNAME> viz

That looked nice! Let’s record some data to a pcap so we can view it on repeat!

Because many of ouster-cli commands can be chained together, we’ll add the slice command before the save command to limit the number of frames we save to 100.

If the slice is not present before save, you can stop recording at anytime with CTRL-C.

$ ouster-cli source <SENSOR HOSTNAME> slice 0:100 save .pcap

That should produce screen output that looks something like:

Connecting to <SENSOR HOSTNAME>
Saving PCAP file at ./OS-<SENSOR_DETAILS>-<LIDAR_MODE>_<DATE>.pcap

Go ahead and look in the current directory for the named pcap file and associated metadata file.

The slice command also allows recording for fixed time duration. For example, the following will record 30 seconds of pcap data.

$ ouster-cli source <SENSOR HOSTNAME> slice 0s:30s save .pcap

Continue to the next section, Sample pcap session to see what you can do with your new pcap file.

Sample pcap session

If you don’t have a pcap lying around or that you just recorded from a sensor, you can download one the OS2 bridge sample data and unzip the contents.

Let’s take a look at your pcap:

$ ouster-cli source <PCAP_FILE> info

This should output something that looks like:

Reading pcap:  [####################################]  100%
File size:     2247.16M
Packets read:  85085
Encapsulation: ETHERNET
Capture start: 2023-02-16 22:28:58.159505
Capture end:   2023-02-16 22:30:49.369547
Duration:      0:01:51.210042
UDP Streams:
    Src IP              Dst IP        Src Port        Dst Port        AF        Frag         Size        Count
    127.0.0.1        127.0.0.1            7502            7502         4          No        33024        71182
    127.0.0.1        127.0.0.1            7503            7503         4          No           48        13903

That tells us the number of packets belonging to each port captured in the pcap, and the associated size.

To visualize the pcap at 2x speed while looping back:

$ ouster-cli source <PCAP_FILE.pcap> viz -r 2.0 -e loop

You can check check out all the available options by typing --help after ouster-cli source <PCAP_FILE.pcap> viz.

Working with OSF files

Most of the Ouster CLI commands mentioned above also apply to OSF files. Here are a few examples.

To save 100 frames of lidar data from a sensor to an OSF file, run

$ ouster-cli source <SENSOR HOSTNAME> slice 0:100 save .osf

To visualize the OSF at 2x speed while looping back:

$ ouster-cli source <OSF FILE.osf> viz -r 2.0 -e loop