3.1 KiB
Kicker project
Prerequisites
- (L)ubuntu 14.04 (if not using Docker)
- Git installed:
sudo apt install git -y
How to start working
To run code on the laptop
-
Install Python and Python NAOqi SDK: instructions
-
Check if NAOQi binding for Python works by launching Python and running there
from naoqi import ALProxy. The installation was successful if it imports without errors. You can finish Python withctrl-dthen. -
Go to the project directory and run:
python -m pykick
This will launch the striker state machine, which should work if colors are calibrated correctly, and the robot is on the field, and there is one ball on the field and no obstacles. And the goal is distinctive.
- To run the scripts from the project other than the main one, do this from the project directory:
python -m pykick.[file_name_without_.py]
To get an overview try
python -m pykick.colorpicker -h
python -m pykick.movements -h
To run code on the robot
-
Create a folder named
pykickon the robot. -
Copy the files from the project's
pykickfolder intopykickon the robot. -
ssh to the robot, go to the directory containing the
pykickfolder and runpython -m pykick(the same as on the laptop).
To run code with the Docker
Note: For this method to work, you don't need a Ubuntu 14.04, any x86 system with Docker installed will probably work.
- Download the
pynaoqi-python2.7-2.1.4.13-linux32.tar.gzfrom somewhere and put it into the project directory, andcdto the project directory. - Run
docker build -t kick-it . - Then use Docker to run the stuff, for example
docker run --rm -it \
-v /path/to/project:/workspace \
-w /workspace \
--user "$(id -u):$(id -g)" \
kick-it python -m pykick.colorpicker --help
The scripts with GUI (like colorpicker) can be made to work with some extra
flags.
What's inside?
__main__.py- The script containing the state machine. Read this to figure out how everything fits together.copyfiles.sh- Script for convenient copying of the project files to the robot (IP is hard-coded, so use with caution).nao_defaults.json- The settings such as color HSV values, and the NAOs IP addresscolorpicker.py- Program for calibrating the colors. Runpython -m pykick.colorpicker -hto see how to use it.detection_demo.py- Program to check how good the robot can detect objects with the current color settings.striker.py- The class with high lever behaviors, e.g. aligning to ball. If you want to figure out our code, START HERE.movements.py- Convenience classes for moving robot. Also kick is implemented here.finders.py- Classes for Ball, Goal and Field detection. Read this file if you are curious about detection algorithms and the class interfaces.imagereaders.py- Convenience classes for capturing video input from various sources.
More documentation will be available later. For now see our report in
documentation.