Spring 2014, ECE 4180 project, Georgia Institute of Technolgoy. This is the autonomous driver program for the Robotics Cat and Mouse program.
Dependencies: IMUfilter ADXL345_I2C mbed ITG3200 USBHost mbed-rtos
Diff: Humain.cpp
- Revision:
- 1:dacf7db790f6
diff -r 84d5aa80fd77 -r dacf7db790f6 Humain.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Humain.cpp Wed Apr 30 05:54:17 2014 +0000 @@ -0,0 +1,42 @@ +#include "mbed.h" +#include "rtos.h" +#include "IMU_RPY.h" +#include "GameCode.h" +#include "HumanPosition.h" +#include "HumanControl.h" + +int main() +{ + pc.printf("\n\rStartup...\r\n"); + + //Reset xbee + pc.printf("Resetting XBee...\r\n"); + rst1 = 0; + wait_us(1); + rst1 = 1; + wait_us(1); + + //Initialize IMU and filter + pc.printf("Initializing IMU...\r\n"); + imuFilter.reset(); + rpy_init(); + + // wait for AI car to get away from user + pc.printf("Waiting for AI car...\n\r"); + wait(10); + + // start positioning system + pc.printf("Starting Positioning System...\n\r"); + Thread position(PositionSystemMain, NULL, osPriorityRealtime, 256 * 4); + wait(3); // wait for the mouse sensor to boot up + + // give control to radio driver while game is running + pc.printf("Running!\n"); + Timer sendTimer; + sendTimer.start(); + while(!gameOver) { + radioDrive(); + if(sendTimer.read_ms() % 250) + sendPosition(NULL); + } +}