ouster.sdk.viz.accumulators module

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

Ouster scan accumulation for LidarScanViz

class LidarScanVizAccumulators(model, point_viz, config, lock)[source]

Bases: object

Accumulate scans, track poses and overall map view Every new scan (LidarScan or LidarScanSet) is passed through update(scan, num).

Available visualization depends on whether poses are present or not and params set on init. View modes are combination of:

  • TRACK - scan poses (i.e. trajectories) of every scan “seen” (poses required)

  • ACCUM - set of accumulated scans (key frames) picked according to params

  • MAP - overall map with select ratio of random points from every scan passed through update()

Parameters:
  • model (LidarScanVizModel) – a LidarScanVizModel instance.

  • point_viz (PointViz) – the PointViz instance to use for rendering clouds.

  • config (LidarScanVizAccumulatorsConfig) –

    a LidarScanVizAccumulatorsConfig that accepts the following keyword args: accum_max_num: aka, --accum-num, the maximum number of accumulated

    (ACCUM) scans to keep

    accum_min_dist_meters: aka, --accum-every-m, the minimum distance

    between accumulated (ACCUM) key frames

    accum_min_dist_num: aka, --accum-every, the minimum distance in

    scans between accumulated (ACCUM) key frames

    map_enabled: enable overall map accumulation (MAP) (--map) map_select_ratio: percent of points to select from the scans to the

    overall map (MAP), default 0.001

    map_max_points: maximum number of points to keep in overall map (MAP) map_overflow_from_start: if True, on map overflow continue writing

    points from the beginning (as in ring buffer), if False, overwrite points randomly in the existing map

property track_accumulator: TracksAccumulator

Get the TracksAccumulator instance.

cycle_cloud_mode(direction)[source]
Return type:

bool

cycle_cloud_palette(direction)[source]
Return type:

bool

update_point_size(amount)[source]

Change the point size of the MAP/ACCUM point cloud.

Return type:

bool

toggle_sensor(sensor_idx, state)[source]
toggle_mode_accum(state=None)[source]

Toggle ACCUM view

Return type:

bool

toggle_mode_map(state=None)[source]

Toggle MAP view

Return type:

bool

toggle_mode_track(state=None)[source]
Return type:

bool

toggle_osd(state=None)[source]

Show or hide the on-screen display.

Return type:

bool

osd_text()[source]

Prepare OSD text for use in draw_osd or elsewhere.

Return type:

str

update(scans, scan_num=None)[source]

Updates the accumulation state from the current scan. Locking is necessary here because the accumulation state depends on the current view mode, which might change in a separate thread than the thread that calls update().

Return type:

None

draw(update=True)[source]

Process and draw the latest state to the screen.

Return type:

None