2014 Eurobot fork
Dependencies: mbed-rtos mbed QEI
Diff: main.cpp
- Revision:
- 32:e3f633620816
- Parent:
- 31:ada943ecaceb
- Parent:
- 30:791739422122
- Child:
- 41:26e5f24b55b3
--- a/main.cpp Wed Apr 10 18:04:47 2013 +0000 +++ b/main.cpp Wed Apr 10 18:25:16 2013 +0000 @@ -13,6 +13,7 @@ #include "motion.h" #include "MotorControl.h" #include "system.h" +#include "ai.h" void motortest(); void encodertest(); @@ -63,15 +64,6 @@ Serial pc(USBTX, USBRX); pc.baud(115200); - using AI::current_waypoint; - - current_waypoint = new Waypoint; - current_waypoint->x = 0.5; - current_waypoint->y = 0.7; - current_waypoint->theta = 0.0; - current_waypoint->pos_threshold = 0.02; - current_waypoint->angle_threshold = 0.09; - InitSerial(); //while(1) // printbuff(); @@ -83,8 +75,11 @@ Thread updatethread(Kalman::updateloop, NULL, osPriorityNormal, 2084); - //Ticker motorcontroltestticker; - //motorcontroltestticker.attach(MotorControl::motor_control_isr, 0.05); + Ticker motorcontroltestticker; + motorcontroltestticker.attach(MotorControl::motor_control_isr, 0.05); + + // ai layer thread + Thread aithread(AI::ailayer, NULL, osPriorityNormal, 2048); // motion layer periodic callback RtosTimer motion_timer(motion::motionlayer, osTimerPeriodic);