Well, on this page, I will try to resume and sum up how to use the Host simulator and main concept behind
First you should know that this simulator is use to perform setup of AI for the French robotic cup "Mission to March". For the next challenge. This simulator will probably be improve.
The robot is composed by 2 microcontrolors AVR. They are the brain of the robot. We will execute the 2 programs on an host system (my Ubuntu Computer) and provide a communication system between the 2 AVR and the display application. Executing avr program on host system means that we re-use avr C-code but some wrapper have been added to handle the fact that avr-hardware is not present on host system.
So we will have to launch 3 concurrents process. They will communicate by them self by using Unix Socket.
For this description i use : * Apbteam repository revision [d8d05fbbbd92] * A laptop powerd by a centrino processor * A Ubuntu 8.04 Distro that i customize by adding several package : gcc-avr, avr-libc, yapps2 and graphviz (To convert fsm into png picture)
Ok, now obscure things:
- Do something with dfagen
- cd trunk/tools/dfagen/dfagen/ && yapps parser.
- dfagen is a tool to create template of fsm.
- Launch Tk application
- cd trunk/host/inter && python inter_node.py
- this display the simulator interface. But touch to nothing for the momment.
- Compile asserv program, this one will drive motor asservissement
- open a new terminal
- cd trunk/digital/asserv/src/asserv && make
- This command will build an hex file that you can use to program flash avr and an executable of host system
- Launch program with this command : cat init move_bot_blue - | ./asserv.host -m giboulee
- If you are not familiar with unix culture, this previews command will replace an user that would type on this keyboard the content of file init and move_bot_blue when program asserv.host is executed.
- Compile IO program, this one control all sensors
- open a new terminal
- cd trunk/digital/io/src && make CB=touch
- This command will build an hex that you can use to program flash avr and an executable of host system
- Launch program with this command : cat init - | ./io.host
- At this momment the terminal should display a message that mean the robot is waiting an action on jack switch to start : top IDLE =start=> WAIT_JACK_IN
- Ready to launch the simulation
- return to the Tk windows
- click on "play" then "jack" 2 times
- Rock & roll it move !!!! see in terminal there is some message
This simulator system work pretty well. You should know that in matter of simulator there is several kind of level. We can consider that this one target "system" simulation. This purpose is to check and help to setup a complex system compose by several calculi unit design by several person of the team.
Tanks to whom will corrected and complete this little documentation.