Petoi Doc Center
🇺🇸English
Search…
⌃K

OpenCat Imitation Tutorial

Let the robot be your Avatar!
Demo
In this tutorial, we will introduce how to use the Ailia in python language to implement an OpenCat robot to imitate various human body movements.
To clone or download the code from the GitHub repository, you can clone the code with the following command:
git clone https://github.com/TomCC7/OpenCat-Imitation

Run on a regular computer (Mac/Linux)

Requirements
  • Python 3.6 and later
  1. 1.
    It is recommended to install the Anaconda3 IDE. For the specific installation method, please refer to the following link: https://docs.anaconda.com/anaconda/install/
  2. 2.
    Open the Anaconda Prompt (Windows) or the Terminal (Linux / macOS) and enter the following commands to create and activate a virtual environment (the environment name is "venv", and can also be customized to other names): conda create --name venv conda activate venv
  3. 3.
    Follow the guide to install the Ailia SDK, it will be used for pose detection. The guide mainly includes the following steps: download and install the ailia SDK and the related python library files. When downloading the Ailia SDK, you need to enter the correct email address to receive the download link address and license file. The free license is valid for only one month. The SDK is about 2GB, so it takes time to download. Move the downloaded license file (AILIA.lic) to the directory where bootstrap.py is located ({ailia sdk directory}/python), and then follow the steps to continue installing the Ailia SDK. cd {ailia sdk directory}/python python3 bootstrap.py pip3 install . Download the requirements.txt from this page (https://github.com/axinc-ai/ailia-models) to the directory where bootstrap.py is located before running the following command: pip install -r requirements.txt. It may take 30 minutes.
  4. 4.
    Use the USB uploader or Bluetooth module to connect the robot and power it on. The computer needs to be connected to a camera device. Run the following command to start the OpenCat Imitation program:
  5. 5.
    cd {your file directory}/OpenCat-Imitation/
    # set python import path
    export PYTHONPATH=$PWD:$PWD/serialMaster
    python opencat_imitation/imitation.py -v0

Run on the Jetson Nano 2GB Developer kit

You may want to run the demo on a Jetson Nano to experiment with some GPU features.
The developer kit uses a microSD card as a boot device and for main storage. It’s important to have a card that’s fast and large enough for your projects; the minimum requirement is a 32GB UHS-1 card. Many projects with Jetson Nano 2GB Developer Kit will utilize swap space on the MicroSD Card due to only 2GB physical memory. For this reason, we recommend 64GB or larger microSD cards. High-endurance microSD cards are also recommended.
  1. 1.
    Please refer to the user guide to record the system image file (JetPack 4.6) into the microSD card and complete the system initialization.
The system image file link in the user guide (https://developer.nvidia.com/embedded/learn/get-started-jetson-nano-2gb-devkit#write) points to JetPack 4.6.1, download and burn it to a microSD card After that, system initialization may fail when the Jetson Nano is started. So we recommend using the earlier version: JetPack 4.6.
2. Use a network cable to connect the Jetson Nano development board to a router or other computer hosts so that it can access the Internet.
3. Clone or download the code from GitHub, and install the Ailia SDK according to the guide, the specific method is the same as the above step 3 in Run on the host computer, but NO need to execute the statement:
pip install -r requirements.txt
4. Install the relevant python library files using the following command:
sudo apt install python3-pip
sudo apt install python3-matplotlib
sudo apt install python3-scipy
pip3 install cython
pip3 install numpy
sudo apt install nvidia-jetpack
pip3 install dataclasses
pip3 install pyserial
5. Connect the camera and complete the camera configuration by referring to the relevant guide.
Please refer to the technical documentation to complete the setup if you use a USB camera the relevant technical documentation to complete the setup.
To connect the USB uploader, you need to use the following command:
sudo usermod -a -G dialout $USER to increase user rights.
6. Start the program, please refer to step 4 of Run on a regular computer.
Note: the last sentence of the startup program command, please specify python3 to run the script:
python3 opencat_imitation/imitation.py -v0
So far, the OpenCat imitation program can run on the Jetson Nano development board. You can refer to other relevant technical documents to further improve the program's performance, such as enabling openCV to support CUDA acceleration.