anki / cozmo-python-sdk

Anki Cozmo Python SDK
Other
667 stars 434 forks source link

COZMO-10308 Added Navigation Memory Map access #142

Closed MarkWez closed 7 years ago

MarkWez commented 7 years ago

Added nav_memory_map.py - supports deserializing a Navigation Memory Map from the engine, and providing access to query the contents at a given X,Y position.

Lots of other tidy up including:

Importing cozmo now sys.exits if the Python version is too old, or if the cozmoclad version is older than the minimum version supported by the cozmo code - this is to simplify error handling in other code that relied on specific Clad message names being present or in a given format. Zero-length CLAD messages can now be received Renamed Rotation to Quaternion in util (but kept Rotation as an alias to avoid breaking any external code). Added a Matrix44 class, with conversion functions for converting Pose and Quaternion objects into a Matrix format (which is generally easier to use in 3D graphics and for general 3D math) Factored out common CLAD enum handling into a new CladEnumWrapper helper class - updated BehaviorTypes to use this, and it's used in the new nav_memory_map's NodeContentTypes Object annotation in the 2D camera view now supports per-class specialization, so that cubes and custom objects can add additional useful info like CubeId and ObjectType. Face annotation now includes the expression score (if facial expression scores have been requested), UNKNOWN expressions are now handled correctly (they were showing up as zero scored Neutral faces before) Added type info to the rest of the robot.Robot class to help auto-completion in IDEs. Added support for optionally ignoring any combination of head, lift and body (wheels/treads) animation tracks when playing an animation trigger. Updated the 08_animation.py example to include an example. Added support for "use_lift_safe" on playing an animation that automatically allows the lift track to be ignored if Cozmo is currently carrying an object. Added mobile device IMU support, and the remote_control_cozmo example requests the mobile device's IMU (accelerometer and gyro) data and displays it in the display. (This data could be used to e.g. control Cozmo via the mobile device). Disabled logging on action aborting by default (can be enabled on a per-call basis by passing in log_abort_messages=True) as it spams a lot when heavily used. Chmod +x quick_tap.py and color_finder.py so that they can be run directly from command line Fix bug in quick_tap.py if you tapped a cube before Cozmo chose his cube.