ouster.sdk.examples.open3d_example module

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

Ouster Open3D visualizer

view_from(vis, from_point, to_point=array([0, 0, 0]))[source]

Helper to setup view direction for Open3D Visualiser.

Parameters:
  • from_point (ndarray) – camera location in 3d space as [x,y,z]

  • to_point (ndarray) – camera view direction in 3d space as [x,y,z]

create_canvas(w, h)[source]

Create canvas for 2D image.

Parameters:
  • w (int) – width of the 2D image in screen coords (pixels)

  • h (int) – height of the 2D image in screen coords (pixels)

Return type:

TriangleMesh

canvas_set_viewport(pic, camera_params)[source]

Set the position of the 2D image in space so it seems as static.

The method should be called on every animation update (animation callback) before rendering so the 2D mesh with texture always appear in the position that would seem “static” for the observer of the scene through the current camera parameters.

Parameters:
  • pic (TriangleMesh) – canvas with 2D image, created with create_canvas()

  • camera_params (PinholeCameraParameters) – current open3d camera parameters

Return type:

None

canvas_set_image_data(pic, img_data)[source]

Set 2D image data to 2D canvas.

Parameters:
  • pic (TriangleMesh) – 2D canvas creates with create_canvas()

  • img_data (ndarray) – image data RGB (i.e. shape [h, w, 3])

Return type:

None

range_for_field(f)[source]
Return type:

str

viewer_3d(scans, paused=False)[source]

Render one scan in Open3D viewer from pcap file with 2d image.

Parameters:
  • pcap_path – path to the pcap file

  • metadata_path – path to the .json with metadata (aka SensorInfo)

  • num – scan number in a given pcap file (satrs from 0)

Return type:

None

main()[source]
Return type:

None