anki_vector.camera

Support for Vector’s camera.

Vector has a built-in camera which he uses to observe the world around him.

The CameraComponent class defined in this module is made available as anki_vector.robot.Robot.camera and can be used to enable/disable image sending and observe images being sent by the robot.

The camera resolution is 1280 x 720 with a field of view of 90 deg (H) x 50 deg (V).

Classes

CameraComponent(robot) Represents Vector’s camera.
class anki_vector.camera.CameraComponent(robot)

Represents Vector’s camera.

The CameraComponent object receives images from Vector’s camera, unpacks the data, composes it and makes it available as latest_image.

The anki_vector.robot.Robot or anki_vector.robot.AsyncRobot instance observes the camera.

import anki_vector

with anki_vector.Robot(enable_camera_feed=True) as robot:
    image = robot.camera.latest_image
    image.show()
Parameters:robot – A reference to the owner Robot object.
close_camera_feed()

Cancel camera feed task.

Return type:None
init_camera_feed()

Begin camera feed task.

Return type:None
latest_image

Image.Image – The most recently processed image received from the robot.

Getter:Returns the Pillow Image representing the latest image
import anki_vector

with anki_vector.Robot(enable_camera_feed=True) as robot:
    image = robot.camera.latest_image
    image.show()
Return type:Image
latest_image_id

The most recently processed image’s id received from the robot.

Used only to track chunks of the same image.

Getter:Returns the id for the latest image
import anki_vector

with anki_vector.Robot(enable_camera_feed=True) as robot:
    image = robot.camera.latest_image
    image.show()
    print(f"latest_image_id: {robot.camera.latest_image_id}")
Return type:int