ouster.sdk.viz.util module

class BoundMethod(method)[source]

Bases: object

Used to wrap a bound method’s instance with a weak ref, which is necessary to use the method as a PointViz event callback while allowing the bound method’s instance to be deleted.

push_point_viz_handler(viz, arg, handler)[source]

Add a key handler with extra context without keeping it alive.

It’s often useful to add a key callback that calls a method of an object that wraps a PointViz instance. In this case it’s necessary to take some extra care to avoid a reference cycle; holding onto self in the callback passed to native code would cause a memory leak.

Parameters:
  • viz (PointViz) – The PointViz instance.

  • arg (TypeVar(T)) – The extra context to pass to handler; often self.

  • handler (Callable[[TypeVar(T), WindowCtx, int, int], bool]) – Key handler callback taking an extra argument

Return type:

None

class AxisWithLabel(point_viz, *, pose=array([[1., 0., 0., 0.], [0., 1., 0., 0.], [0., 0., 1., 0.], [0., 0., 0., 1.]]), label='', length=1.0, thickness=3, label_scale=1.0, axis_n=100, enabled=True)[source]

Bases: object

Coordinate axis with a text label.

property enabled: bool

True if label is added to the viz

enable()[source]

Enable the label and make it added to the viz

Return type:

None

disable()[source]

Disable the label and remove it from the viz

Return type:

None

toggle()[source]

Toggle the label visibility (i.e. presence in the viz)

Return type:

bool

property pose: ndarray

Label pose, 4x4 matrix

property label: str

Label text, 4x4 matrix

update()[source]

Update label component viz states.

Return type:

None