anki_vector.opengl.opengl_vector

This module provides Vector-specific 3D support classes for OpenGL, used by opengl_viewer.py.

Warning

This package requires Python to have the PyOpenGL package installed, along with an implementation of GLUT (OpenGL Utility Toolkit).

To install the Python packages on Mac and Linux do python3 -m pip install --user "anki_vector[3dviewer]"

To install the Python packages on Windows do py -3 -m pip install --user "anki_vector[3dviewer]"

On Windows and Linux you must also install freeglut (macOS / OSX has one preinstalled).

On Linux: sudo apt-get install freeglut3

On Windows: Go to http://freeglut.sourceforge.net/ to get a freeglut.dll file. It’s included in any of the Windows binaries downloads. Place the DLL next to your Python script, or install it somewhere in your PATH to allow any script to use it.”

Classes

CubeRenderFrame(cube) Minimal copy of a Cube’s state for 1 frame of rendering.
CustomObjectRenderFrame(custom_object, is_fixed) Minimal copy of a CustomObject’s state for 1 frame of rendering.
FaceRenderFrame(face) Minimal copy of a Face’s state for 1 frame of rendering.
LightCubeView(mesh_data) A view containing the Vector Light Cube 3D Model.
NavMapView() A view containing a cube of unit size at the origin.
ObservableObjectRenderFrame(obj) Minimal copy of an object’s state for 1 frame of rendering.
RobotRenderFrame(robot) Minimal copy of a Robot’s state for 1 frame of rendering.
RobotView(mesh_data) A view containing the Vector robot 3D Model.
UnitCubeView() A view containing a cube of unit size at the origin.
VectorViewManifest() A collection of Vector-specific source data containing views to display.
WorldRenderFrame(robot) Minimal copy of the World’s state for 1 frame of rendering.
class anki_vector.opengl.opengl_vector.CubeRenderFrame(cube)

Minimal copy of a Cube’s state for 1 frame of rendering.

Parameters:cube (LightCube) – the cube object to be rendered.
class anki_vector.opengl.opengl_vector.FaceRenderFrame(face)

Minimal copy of a Face’s state for 1 frame of rendering.

Parameters:face (Face) – The face object to be rendered.
class anki_vector.opengl.opengl_vector.LightCubeView(mesh_data)

A view containing the Vector Light Cube 3D Model.

Parameters:mesh_data (MeshData) – Source Mesh Data for the light cube.
display(pose)

Displays the precomputed view at a specific pose in 3d space.

Parameters:pose (Pose) – Where to display the cube.
class anki_vector.opengl.opengl_vector.RobotRenderFrame(robot)

Minimal copy of a Robot’s state for 1 frame of rendering.

Parameters:robot – the robot object to be rendered.
class anki_vector.opengl.opengl_vector.RobotView(mesh_data)

A view containing the Vector robot 3D Model.

Parameters:mesh_data (MeshData) – Source Mesh Data for the robot.
display(pose, head_angle, lift_position)

Displays the precomputed view at a specific pose in 3d space.

Parameters:pose (Pose) – Where to display the robot.
class anki_vector.opengl.opengl_vector.UnitCubeView

A view containing a cube of unit size at the origin.

display(color, draw_solid)

Displays the cube with a specific color.

Parameters:
  • color (List[float]) – Color to display the cube.
  • draw_solid (bool) – Whether to draw solid polygons (False to draw wireframe).
class anki_vector.opengl.opengl_vector.VectorViewManifest

A collection of Vector-specific source data containing views to display.

light_cube_view

A precomputed view of Vector’s light cube.

Return type:LightCubeView
load_assets()

Loads all assets needed for the view manifest, and precomputes them into cached views.

nav_map_view

A precomputable view of the navigation map. This will be updated as new content comes in.

Return type:NavMapView
robot_view

A precomputed view of the robot.

Return type:RobotView
unit_cube_view

A precomputed view of a unit cube.

This is used for representing detected faces.

Return type:UnitCubeView
class anki_vector.opengl.opengl_vector.WorldRenderFrame(robot)

Minimal copy of the World’s state for 1 frame of rendering.

Parameters:robot – the robot object to be rendered, which also has handles to the other objects defined in it’s world class.