Let the robot be your Avatar!
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:
Requirements
Python 3.6 and later
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/
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
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.
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:
You can execute run.sh within OpenCat-Imitation/ with your shell command directly. It wraps up the above commands.
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.
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:
5. Connect the camera and complete its 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 and 5 of Run on a regular computer.
Now the OpenCat imitation program can run on the Jetson Nano development board. You can refer to other relevant technical documents to improve the program's performance, such as enabling openCV to support CUDA acceleration.