ouster.sdk.viz.accumulators module

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

Ouster frame accumulation for LidarFrameViz

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

Bases: object

Accumulate frames, track poses and overall map view Every new frame (LidarFrame or FrameSet) is passed through update(frame, num).

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

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

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

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

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

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

  • config (LidarFrameVizAccumulatorsConfig) –

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

    (ACCUM) frames 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

    frames between accumulated (ACCUM) key frames

    map_enabled: enable overall map accumulation (MAP) (--map) map_select_ratio: percent of points to select from the frames 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

  • lock (RLock)

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. :rtype: bool

Parameters:

amount (int)

Return type:

bool

toggle_sensor(sensor_idx, state)[source]
Parameters:

state (bool)

toggle_mode_accum(state=None)[source]

Toggle ACCUM view :rtype: bool

Parameters:

state (bool | None)

Return type:

bool

toggle_mode_map(state=None)[source]

Toggle MAP view :rtype: bool

Parameters:

state (bool | None)

Return type:

bool

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

bool

Parameters:

state (bool | None)

toggle_osd(state=None)[source]

Show or hide the on-screen display. :rtype: bool

Parameters:

state (bool | None)

Return type:

bool

osd_text()[source]

Prepare OSD text for use in draw_osd or elsewhere. :rtype: str

Return type:

str

clear_track()[source]
Return type:

None

update(frames, frame_num=None)[source]

Updates the accumulation state from the current frame. 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(). :rtype: None

Parameters:
  • frames (FrameSet)

  • frame_num (int | None)

Return type:

None

draw(update=True)[source]

Process and draw the latest state to the screen. :rtype: None

Parameters:

update (bool)

Return type:

None