cozmo.objects

Object and Power Cube recognition.

Cozmo can recognize and track a number of different types of objects.

These objects may be visible (currently observed by the robot’s camera) and tappable (in the case of the Power Cubes that ship with the robot).

Power Cubes are known as a LightCube by the SDK. Each cube has controllable lights, and sensors that can determine when its being moved or tapped.

Objects can emit several events such as EvtObjectObserved when the robot sees (or continues to see) the object with its camera, or EvtObjectTapped if a power cube is tapped by a player. You can either observe the object’s instance directly, or capture all such events for all objects by observing them on cozmo.world.World instead.

All observable objects have a marker attached to them, which allows Cozmo to recognize the object and it’s position and rotation(“pose”). You can attach markers to your own objects for Cozmo to recognize by printing them out from the online documentation. They will be detected as CustomObject instances.

Module Attributes

OBJECT_VISIBILITY_TIMEOUT

Length of time in seconds to go without receiving an observed event before assuming that Cozmo can no longer see an object.

LightCube1Id

LightCube1Id's markers look a bit like a paperclip

LightCube2Id

LightCube2Id's markers look a bit like a lamp (or a heart)

LightCube3Id

LightCube3Id's markers look a bit like the letters 'ab' over 'T'

LightCubeIDs

An ordered list of the 3 light cube IDs for convenience

Classes

Charger(*a, **kw)

Cozmo's charger object, which the robot can observe and drive toward.

CustomObject(conn, world, object_type, ...)

An object defined by the SDK.

CustomObjectMarkers()

Defines all available custom object markers.

CustomObjectTypes()

Defines all available custom object types.

EvtObjectAppeared(**kwargs)

Triggered whenever an object is first visually identified by a robot.

EvtObjectConnectChanged(**kwargs)

Triggered when an active object has connected or disconnected from the robot.

EvtObjectConnected(**kwargs)

Triggered when the engine reports that an object is connected (i.e. exists).

EvtObjectDisappeared(**kwargs)

Triggered whenever an object that was previously being observed is no longer visible.

EvtObjectLocated(**kwargs)

Triggered when the engine reports that an object is located (i.e. pose is known).

EvtObjectMoving(**kwargs)

Triggered when an active object is currently moving.

EvtObjectMovingStarted(**kwargs)

Triggered when an active object starts moving.

EvtObjectMovingStopped(**kwargs)

Triggered when an active object stops moving.

EvtObjectObserved(**kwargs)

Triggered whenever an object is visually identified by the robot.

EvtObjectTapped(**kwargs)

Triggered when an active object is tapped.

FixedCustomObject(pose, x_size_mm, ...)

A fixed object defined by the SDK.

LightCube(cube_id, *a, **kw)

A light cube object has four LEDs that Cozmo can actively manipulate and communicate with.

ObservableElement(conn, world, robot, **kw)

The base type for anything Cozmo can see.

ObservableObject(conn, world[, object_id])

The base type for objects in Cozmo's world.