ouster.sdk.examples.core module

Copyright (c) 2021, Ouster, Inc. All rights reserved.

Executable examples for using the core sensor APIs.

This module has a rudimentary command line interface. For usage, run:

$ python -m ouster.sdk.examples.core -h
configure_dual_returns(hostname)[source]

Configure sensor to use dual returns profile given hostname

Parameters:

hostname (str) – hostname of the sensor

Return type:

None

configure_sensor_params(hostname)[source]

Configure sensor params given hostname

Parameters:

hostname (str) – hostname of the sensor

Return type:

None

fetch_metadata(hostname)[source]

Fetch metadata from a sensor and write it to disk.

Accurately reconstructing point clouds from a sensor data stream requires access to sensor calibration and per-run configuration like the operating mode and azimuth window.

The client API makes it easy to read metadata and write it to disk for use with recorded data streams.

Parameters:

hostname (str) – hostname of the sensor

Return type:

None

filter_3d_by_range_and_azimuth(hostname, lidar_port=7502, range_min=2)[source]

Easily filter 3D Point Cloud by Range and Azimuth Using the 2D Representation

Parameters:
  • hostname (str) – hostname of sensor

  • lidar_port (int) – UDP port to listen on for lidar data

  • range_min (int) – range minimum in meters

Return type:

None

live_plot_reflectivity(hostname, lidar_port=7502)[source]

Display reflectivity from live sensor

Parameters:
  • hostname (str) – hostname of the sensor

  • lidar_port (int) – UDP port to listen on for lidar data

Return type:

None

plot_xyz_points(hostname, lidar_port=7502)[source]

Display range from a single scan as 3D points

Parameters:
  • hostname (str) – hostname of the sensor

  • lidar_port (int) – UDP port to listen on for lidar data

Return type:

None

record_pcap(hostname, lidar_port=7502, imu_port=7503, n_seconds=10)[source]

Record data from live sensor to pcap file.

Note that pcap files recorded this way only preserve the UDP data stream and not networking information, unlike capturing packets directly from a network interface with tools like tcpdump or wireshark.

See the API docs of pcap.record() for additional options for writing pcap files.

Parameters:
  • hostname (str) – hostname of the sensor

  • lidar_port (int) – UDP port to listen on for lidar data

  • imu_port (int) – UDP port to listen on for imu data

  • n_seconds (int) – max seconds of time to record. (Ctrl-Z correctly closes streams)

Return type:

None

main()[source]
Return type:

None