This project aims to extend Cozmo's abilities with voice recognition, interactive chatting sessions (served by online AI chatbots) special user commands, pulling useful information from the internet, etc.
- If not already installed, download and install the following:
- Download geckodriver and install according to your OS.
- On Windows, copy the .exe to a folder (eg C:\bin\gecko) and open a command prompt to declare it in your PATH:
$ set PATH=%PATH%;C:\bin\gecko
- On Linux and MacOS extract the file to your home folder, open a Terminal prompt and run:
mkdir ~/.local/bin
cp ~/geckodriver ~/.local/bin/
export PATH=$PATH:~/.local/bin/
- Install all the necessary Python libraries.
Important note: Since Cozmo's API is unfortunately not actively maintained anymore, I had to fork the whole API and incorporate various fixes for issues that were caused by third party Python libraries ungrading and breaking various calls in the code. As such we are going to install cozmo's API library from the fork.
- On Windows start a command prompt, go to Python's pip.exe location (eg C:\Python35\Scripts) and run:
pip.exe install -U selenium pillow numpy termcolor requests SpeechRecognition selenium feedparser beautifulsoup4 unidecode pyaudio
pip.exe install -U git+https://github.com/c64-dev/cozmo-python-sdk.git
- On MacOS/Linux start a Terminal and run:
pip3 install selenium pillow numpy termcolor requests SpeechRecognition selenium feedparser beautifulsoup4 unidecode pyaudio
pip3 install git+https://github.com/c64-dev/cozmo-python-sdk.git
For Apple Mac users only: If you encounter an error trying to install pyaudio, then please install Homebrew and then run the following terminal commands:
brew install --build-from-source portaudio
pip3 install pyaudio
After pyaudio is installed, then run the previous pip command to install all the other libraries.
After all the requirements are met you can install Cozmo.AI as follows:
- Windows:
set PATH=%PATH%;C:\Program Files\Git\cmd
cd %HOME%
git.exe clone https://github.com/c64-dev/Cozmo.AI.git
- MacOS/Linux:
cd ~/
git clone https://github.com/c64-dev/Cozmo.AI.git
- For the very first time only, you will need to enable the connection between your phone and your PC. There are various guides on the internet (like this one depending on your computer OS and phone type but generally the typical process for an Android phone is this:
- Enable USB debugging on your phone.
- Get Android ADB & Fastboot drivers either for Mac/Linux or Windows and install them.
- Connect your phone to your computer using a USB cable.
- Tap the USB option from the Notification Panel on your phone and make sure that MTP mode and USB Debugging are both enabled.
- In a Terminal/Command prompt run
adb devices
. It should list your phone asunauthorised
. - Run any push/pull adb command such as
adb push abc abc
to prompt your phone to authorize your computer.
-
With your phone connected via USB to your computer, connect your Cozmo robot to your smartphone/tablet via wifi and run Cozmo's app.
-
After Cozmo wakes up go to the app's settings and enable SDK mode. Now the phone should display a black text screen and Cozmo should stop moving around. The robot is now ready to execute our Python program.
-
Run the CozmoAI program as follows:
- Windows:
python.exe %HOME%\Cozmo.AI\main.py
- MacOS/Linux:
python3 ~/Cozmo.AI/main.py
To update to the latest version of CozmoAI simply run the following commands:
- Windows:
cd %HOME%\Cozmo.AI
git.exe pull https://github.com/c64-dev/Cozmo.AI.git
- MacOS/Linux:
cd ~/Cozmo.AI/
git pull https://github.com/c64-dev/Cozmo.AI.git