This repository contains basic code and explanations to control the NAO robot in Chili Lab.
- Required: Python 2.7.18
Note: The NAO robot controller is not compatible with newer Python versions.
[Path to Python 2.7.18] -m pip install -r requirements.txt- Version: 2.1.2.17
- Download Link
Ensure there are no errors when running:
import naoqiAlthough the official documentation states that turning on the robot requires a short click on the chest button (NAO Turn-on Guide), the NAO robot in the CHILI lab requires a long press of the chest button until the LED lights turn on.
After that, wait approximately 3-4 minutes (sometimes longer if there are updates in progress; for detailed information, refer to the NAO Boot Process Guide).
When the NAO says "OGNAK GNOUK," it has successfully powered on.
To turn off the NAO, ensure it is in a safe, stable area, then long-press the chest button until all the LED lights are off.
-
Network Setup:
Connect both the NAO robot and your computer to the same Wi-Fi network.
Note: Avoid networks requiring login credentials (e.g., school networks). Use:- Wi-Fi Name:
Clem-is-excited - Password:
naotravelstochili
- Wi-Fi Name:
-
Get NAO's IP Address:
Press the chest button (short press). NAO will announce its IP address (e.g.,192.168.1.117). -
Access NAO's Web Interface: (Optional but useful)
- Open a browser and go to
http://[NAO_IP]ornao.local. - Login:
- Username:
nao - Password:
naotravelstochili
- Username:
- This interface allows you to adjust settings like voice, battery status, etc.
- Open a browser and go to
-
Configure IP in Code:
- In
proxy.py, setPEPPER_IPto NAO's IP address.
- In
- Via NAO's Web Interface: Navigate to the network settings, click "Add Network," and input the necessary credentials.
- If NAO is not connected to any network:
- Use an Ethernet cable to connect NAO, like Wired Connection Guide
- Visit
http://nao.localto manage network settings.
- All basic NAO setup details are in
proxy.pywith detailed comments.
- Use
ALRobotPostureandALMotion, defined inproxy.py, to control motions. - Example motions can be found in
robot_motion.py. - Documentation:
- Open Choregraphe.
- Connect to NAO (Wi-Fi icon should turn green).
- Navigate:
Connect > Advanced > File Transfer. - Upload audio files to NAO's shared folder.
Example to upload and play an audio file:
remote_audio_path = "/home/nao/audio/wav/lbt_pre_1.wav"
transfer_file_to_nao("audio_file/lbt_pre_1.wav", remote_audio_path, PEPPER_IP, username, password)
audio_player.playFile(remote_audio_path)Note: If the file is static, upload it once and reuse it.
from proxy import audio_player
nao_file_path = "/home/nao/audio/wav/filename.wav"
audio_player.playFile(nao_file_path)- Uses
ALTextToSpeech(configured inproxy.py). - Guide: TTS Documentation
- Uses
ALSpeechRecognition. - Guide: Speech Recognition Documentation
- Ensure Python 2.7.18 is active when running scripts.
- Verify network connections if NAO is unresponsive.
- Check NAO's battery status via the web interface.
For any issues, refer to the NAOqi official documentation or contact the Chili Lab support team.