AutoMoDe Arena Experiments
This page is in a very early stage. If you have any questions about the contents of this page, ask Ken or Jonas.
In the future you will find a checklist for download here that you can follow if you want to run your experiments. The next sections will describe the necessary parts in more detail.
Ken has already prepared a number of helpful scripts that can help when running experiments in the arena. They are available on his github account.
You will need an account on the arena computer (?) and for the Iridia Tracking System.
Setup virtual network interface to connect to e-puck network: > sudo ifconfig enp2s0:0 10.0.1.95
Generating the files
Compiling libraries and executables
In order to run ARGoS and AutoMoDe on the e-pucks, you need to crosscompile all necessary libraries.
- Download the cross-compiler that Ken build (TODO: Link) and extract it on your computer
- Open the TargetEPuck.cmake file and change each occurence of
/usr/local/angstrom/armwith the path to the crosscompiler. TODO: Verify that this is the correct path.
- Instead of changing every .cmake file on your system, you can also setup only one TargetEPuck.cmake file and reference it from all of your projects.
- Add to folders to the root level of your project: build and build_epuck
- Do we need to compile first before cross-compiling?
- In the folder build_epuck run the usual cmake command for that project in your terminal but add the following parameter to cmake
- Once cmake completed without any errors, run make and get your executable or library.
- Sometimes you need to install the so created executable or library to the cross-compiler for future linking. Running
sudo make installwill do so, but also has the side effect of changing the include path
lib.d. Question: Does this only happen for sudo make install or also for just make install?
Generating mission files
ExpGen.py generates most of the files that you will need to run your experiments. It takes a couple of arguments (a short summary can be obtained by the -h option). (TODO: Explain the arguments a little bit more)
- An .xml file that contains the template for the mission .xml (or .argos) file.
- Another .xml file that contains the template for the initial positioning with the Iridia Tracking System.
- The number of experiments that are run.
- The file that contains the random seeds for the experiments.
- The output file where the seeds, ids, and mission files are listed. The output file will be formatted in Markdown, if you want to have a visual representation, than you will need to convert the file (for example to html or pdf).
The script will load your controllers (you may need to adjust the script to your needs), create a random order for your experiments and copy your controllers and seeds into the corresponding templates. It will also create two scripts called
startE.sh script is intended to be uploaded to the E-Pucks where it will start a single run of the experiment. The other script (
startPathPla.sh) is executed on the computer in the lab, where it will start Argos for the positioning of the robots in the arena.
Preparing the robots
Before using the robots you need to put in the batteries from the charging port. It is recommended that you put the batteries into the box labelled "charged" so that you always know which batteries are for your use. Put the batteries without the cable in the bottom slot of the e-puck and the battery with the cables in the top slot of the e-puck. When connecting the cable, make sure that it is twisted inward so that the robots do not get caught on each other. Once you have placed the batteries, toggle the bottom switch first to see, if the battery was placed succesfully. Sometimes it doesn't connect properly and than the LED in the e-puck will not light up, when the switch is toggled. If the bottom battery sits well, toggle the switch for the top battery.
Uploading scripts to the e-pucks can be done by either one of two scripts that Ken provided: makeupload.py or massupload.py. The main difference between the two scripts is that makeupload.py will make the AutoMoDe executable and upload it to the specified e-pucks, while massupload will simply copy folders and files from the arena computer to the e-pucks. TODO: Explain more about how these scripts work and the epucks.json file that they use.
One way of uploading all the files can be done by:
- Open a terminal in the
build_epuckfolder for the tracking system, and all of your controllers.
- Then run
python3 /path/to/makeupload.py -j /path/to/epucks.json -c <name of the controller in your epucks.json file>
- Open a terminal in where you generated the experiment files (that is RobotFiles and PCFiles)
- Then run
python3 /path/to/massupload.py -j /path/to/epucks.json -c <name of the controller in your epucks.json file>
Once all the necessary scripts are uploaded to the e-pucks, place them in the arena and make sure that the tags on the top are pointing to the front of the e-puck. TODO: Explain how to connect to all e-pucks simultaneously.
Running the experiments
Once the robots are setup, connect to the tracking system (via ssh?). In the folder
arena_tracking_system you should find a couple of scripts that you can execute in order to use the tracking system. Execute
./server conf/resources.xml cond/track_from_stream.xml to start the tracking process. If you only want to verify that your setup is working, run
./arena-viewer conf/resources.xml cond/track_from_stream.xml. Once the server is started, run
./startPathPla.sh \<ID\> where the ID is the one that the ExpGen.py file created for you.
Start the script ??? on the e-pucks and then press "Play" in the argos window on the arena computer. Once all robots approximately reached there position, stop and exit argos.
Run argos with the mission file and the seed (as given by the experiment configuration returned by ExpGen.py) and execute ./startE.sh <ID> on the e-pucks. Press Play in Argos and wait until the experiment is finished. Then exit write down the score and exit Argos.