Colour sensors calibrated
Dependencies: mbed-rtos mbed Servo QEI
Fork of ICRSEurobot13 by
Diff: main.cpp
- Revision:
- 31:791739422122
- Parent:
- 26:b16f1045108f
- Child:
- 33:e3f633620816
diff -r b16f1045108f -r 791739422122 main.cpp --- a/main.cpp Wed Apr 10 02:01:51 2013 +0000 +++ b/main.cpp Wed Apr 10 18:03:32 2013 +0000 @@ -12,6 +12,7 @@ #include <algorithm> #include "motion.h" #include "MotorControl.h" +#include "ai.h" void motortest(); void encodertest(); @@ -62,15 +63,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,6 +75,9 @@ 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);