pycozmo.robot

Robot constants and helper code.

Classes

LiftPosition([height, ratio, angle]) Represents the position of Cozmo’s lift.
RobotOrientation Robot orientation enumeration.
RobotStatusFlag
pycozmo.robot.MIN_HEAD_ANGLE = <Angle -0.44 radians (-25.00 degrees)>

Minimum head angle.

pycozmo.robot.MAX_HEAD_ANGLE = <Angle 0.78 radians (44.50 degrees)>

Maximum head angle.

pycozmo.robot.MIN_LIFT_HEIGHT = <Distance 32.00 mm (1.26 inches)>

Minimum lift height.

pycozmo.robot.MAX_LIFT_HEIGHT = <Distance 92.00 mm (3.62 inches)>

Maximum lift height.

pycozmo.robot.LIFT_ARM_LENGTH = <Distance 66.00 mm (2.60 inches)>

Lift arm length.

pycozmo.robot.LIFT_PIVOT_HEIGHT = <Distance 45.00 mm (1.77 inches)>

Lift arm pivot point height.

pycozmo.robot.MIN_LIFT_ANGLE = <Angle -0.20 radians (-11.36 degrees)>

Minimum lift arm angle.

pycozmo.robot.MAX_LIFT_ANGLE = <Angle 0.79 radians (45.41 degrees)>

Maximum lift arm angle.

pycozmo.robot.MAX_WHEEL_SPEED = <Speed 200.00 mmps>

Maximum wheel speed.

pycozmo.robot.TRACK_WIDTH = <Distance 45.00 mm (1.77 inches)>

Track width.

pycozmo.robot.FRAME_RATE = 30

Number of frames per second for animations.

class pycozmo.robot.RobotStatusFlag

Bases: object

ARE_WHEELS_MOVING = 32768
CLIFF_DETECTED = 16384
HEAD_IN_POS = 512
IS_ANIMATING = 64
IS_ANIMATING_IDLE = 2048
IS_ANIM_BUFFER_FULL = 1024
IS_BODY_ACC_MODE = 16
IS_CARRYING_BLOCK = 2
IS_CHARGER_OOS = 65536
IS_CHARGING = 8192
IS_FALLING = 32
IS_MOVING = 1
IS_ON_CHARGER = 4096
IS_PATHING = 128
IS_PICKED_UP = 8
IS_PICKING_OR_PLACING = 4
LIFT_IN_POS = 256
pycozmo.robot.RobotStatusFlagNames = {1: 'IS_MOVING', 2: 'IS_CARRYING_BLOCK', 4: 'IS_PICKING_OR_PLACING', 8: 'IS_PICKED_UP', 16: 'IS_BODY_ACC_MODE', 32: 'IS_FALLING', 64: 'IS_ANIMATING', 128: 'IS_PATHING', 256: 'LIFT_IN_POS', 512: 'HEAD_IN_POS', 1024: 'IS_ANIM_BUFFER_FULL', 2048: 'IS_ANIMATING_IDLE', 4096: 'IS_ON_CHARGER', 8192: 'IS_CHARGING', 16384: 'CLIFF_DETECTED', 32768: 'ARE_WHEELS_MOVING', 65536: 'IS_CHARGER_OOS'}

Robot status flag names.

class pycozmo.robot.LiftPosition(height=None, ratio=None, angle=None)

Bases: object

Represents the position of Cozmo’s lift.

The class allows the position to be referred to as either absolute height above the ground, as a ratio from 0.0 to 1.0, or as the angle of the lift arm relative to the ground.

Args:
height (cozmo.util.Distance): The height of the lift above the ground. ratio (float): The ratio from 0.0 to 1.0 that the lift is raised from the ground. angle (cozmo.util.Angle): The angle of the lift arm relative to the ground.
angle

The angle of the lift arm relative to the ground.

height

Height above the ground.

ratio

The ratio from 0 to 1 that the lift is raised, 0 at the bottom, 1 at the top.