This serves as a quick test of the PyCozmo expression and animation capabilities.
This application uses Python 3, and these instructions assume python3 is set as your default python command. You can check your version with python --version
Additionally, all of my instructions are based on using git bash through git for Windows and generic Python 3. If you're on Linux, Mac, or using pycharm or conda your mileage will vary.
- Note: If your Python 3 is called with
python3
then you use that for all python command instances, and your pip commands will bepip3
- In bash (or git bash on Windows) navigate to this respository folder, then create your virtual environment with
python -m venv ./venv
- Once complete activate your environment with
source ./venv/Scripts/activate
- Update pip with
python -m pip install --upgrade pip
- Install the requirements once activated with
pip install -r requirements.txt
- If you install any additional libraries, update the requirements with
pip freeze > requirements.txt
- Exit the virtual environment with
deactivate
If you just want to use pycozmo as on pip.
- If your virtual environment is not currently active, activate it with
source ./venv/Scripts/activate
- Install pycozmo through pip with
pip install pycozmo==0.8.0
If you want to do pycozmo development it can get a bit more screamy.
- If your virtual environment is not currently active, activate it with
source ./venv/Scripts/activate
- Navigate to your pycozmo source folder (probably something like
cd ../pycozmo
) - Install pycozmo with
python setup.py install
- Navigate back to this project directory.
List all functions:
python main.py -h
Results in:
Possible function tests are called with:
pexressions --------------- Print all expression names
expressions --------------- See all possible expressions and their names
expression <option> ------- Run expression with specific name
panims -------------------- Print all animation names
tanim <option> ------------ Run animation with specific name
panimgroups --------------- Print all animation group names
tanimgroup <option> ------- Run animation group with specific name
animjson <option> <file> -- Print the animation keyframes from animation
named <option> to json file with name <json>
agjson <option> <file> ---- Print the animation keyframes from animation group
named <option> to json file with name <json>
tcompound ----------------- Test a compound animation
- Requires disabling standard procedural faces
- Full list just pulled form pycozmo examples
- Base animations from flat stack. Looks like there are complete animations, and then components of those complete animations.
The names don't seem to line up with the names from the cozmo SDK. So answer hazy which animations are which- The named animations from the sdk are the animation groups, and are themselves compound animations
- Can make compount animations with functions and animation groups, mostly same commands
- Could likely make interruptable routines of python commands for interruptable compound action sets
Currently get handling for:
- On Robot Picked Up
- On Robot Orientation Change (is it put on its back or side or anything)
- On Cliff Detected
- On Charging State Change
- On robot poked???? -> Is this petting cozmo or something?
- Get robot state data packet -> currently only reading the battery level out of it
ability to interrupt animations-> not tested, but seems feasible- Event handling of animation events