cozmo.robot

Classes and functions relating to an individual Cozmo robot.

The cozmo.conn.CozmoConnection.wait_for_robot() method returns an instance of Robot which controls a single Cozmo robot.

The Robot class has methods and properties to determine its current state, control its low-level motors, play animations and start behaviors as well as performing high-level actions such as detecting faces and picking up objects.

Each Robot has a Robot.world attribute which represents an instance of a cozmo.world.World. This tracks the state of the world that Cozmo knows about: The objects and faces it’s currently observing, the camera images it’s receiving, etc. You can monitor the world instance for various events that occur, or monitor individual objects directly: The world instance receives all events that the robot triggers, and nearly all SDK objects inherit from cozmo.event.Dispatcher and therefore inherit methods such as wait_for() and add_event_handler().

Module Attributes

MIN_HEAD_ANGLE

The minimum angle the robot's head can be set to

MAX_HEAD_ANGLE

The maximum angle the robot's head can be set to

MIN_LIFT_HEIGHT

The lowest height-above-ground that lift can be moved to

MAX_LIFT_HEIGHT

The largest height-above-ground that lift can be moved to

LIFT_ARM_LENGTH

The length of Cozmo's lift arm

LIFT_PIVOT_HEIGHT

The height above ground of Cozmo's lift arm's pivot

MIN_LIFT_ANGLE

The minimum angle the robot's lift can be set to

MAX_LIFT_ANGLE

The maximum angle the robot's lift can be set to

Classes

DisplayOledFaceImage(screen_data, ...)

Represents the "display oled face image" action in progress.

DockWithCube(obj, approach_angle, ...)

Represents the dock with cube action in progress.

DriveOffChargerContacts(**kw)

Represents the drive off charger contacts action in progress.

DriveStraight(distance, speed, ...)

Represents the "drive straight" action in progress.

EvtRobotReady(**kwargs)

Generated when the robot has been initialized and is ready for commands.

EvtRobotStateUpdated(**kwargs)

Dispatched whenever the robot's state is updated (multiple times per second).

EvtUnexpectedMovement(**kwargs)

Triggered whenever the robot does not move as expected (typically rotation).

GoToObject(object_id, distance_from_object, **kw)

Represents the go to object action in progress.

GoToPose(pose, **kw)

Represents the go to pose action in progress.

LiftPosition([height, ratio, angle])

Represents the position of Cozmo's lift.

PerformOffChargerContext(robot, **kw)

A helper class to provide a context manager to do operations while Cozmo is off charger.

PickupObject(obj[, use_pre_dock_pose])

Represents the pickup object action in progress.

PlaceObjectOnGroundHere(obj, **kw)

Tracks the state of the "place object on ground here" action.

PlaceOnObject(obj[, use_pre_dock_pose])

Tracks the state of the "place on object" action.

PopAWheelie(obj, approach_angle, **kw)

Tracks the progress of a "pop a wheelie" robot action.

Robot(conn, robot_id, is_primary, **kw)

The interface to a Cozmo robot.

RollCube(obj, approach_angle, ...)

Represents the roll cube action in progress.

SayText(text, play_excited_animation, ...)

Tracks the progress of a say text robot action.

SetHeadAngle(angle, max_speed, accel, ...)

Represents the Set Head Angle action in progress.

SetLiftHeight(height, max_speed, accel, ...)

Represents the Set Lift Height action in progress.

TurnInPlace(angle, speed, accel, ...)

Tracks the progress of a turn in place robot action.

TurnTowardsFace(face, **kw)

Tracks the progress of a turn towards face robot action.

UnexpectedMovementSide()

Defines the side of collision that caused unexpected movement.

UnexpectedMovementType()

Defines the type of unexpected movement.