anki_vector.opengl.opengl_viewer

This module provides a 3D visualizer for Vector’s world state and a 2D camera window.

It uses PyOpenGL, a Python OpenGL 3D graphics library which is available on most platforms. It also depends on the Pillow library for image processing.

Example

import time

import anki_vector

with anki_vector.Robot(show_viewer=True,
                       show_3d_viewer=True,
                       enable_face_detection=True,
                       enable_custom_object_detection=True,
                       enable_nav_map_feed=True) as robot:
    time.sleep(10)

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 "wirepod_vector_sdk[3dviewer]"

To install the Python packages on Windows do py -3 -m pip install --user "wirepod_vector_sdk[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.”

Module Attributes

default_resolution

A default window resolution provided for OpenGL Vector programs 800x600 is large enough to see detail, while fitting on the smaller end of modern monitors.

default_projector

A default projector configurate provided for OpenGL Vector programs A Field of View of 45 degrees is common for 3d applications, and a viewable distance range of 1.0 to 1000.0 will provide a visible space comparable with most physical Vector environments.

default_camera

A default camera object provided for OpenGL Vector programs.

default_lights

A default light group provided for OpenGL Vector programs.

Classes

OpenGLViewer(close_event, ...[, resolution, ...])

OpenGL-based 3D Viewer.