![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
This is some awesome robot code
Dependencies: mbed-rtos mbed QEI
Fork of ICRSEurobot13 by
Diff: main.cpp
- Revision:
- 62:78d99b781f02
- Parent:
- 60:5058465904e0
- Child:
- 63:c2c6269767b8
diff -r a7782a35ce4f -r 78d99b781f02 main.cpp --- a/main.cpp Sun Apr 14 10:49:51 2013 +0000 +++ b/main.cpp Sun Apr 14 12:57:04 2013 +0000 @@ -73,19 +73,34 @@ Ticker motorcontroltestticker; motorcontroltestticker.attach(MotorControl::motor_control_isr, 0.05); // ai layer thread - Thread aithread(AI::ailayer, NULL, osPriorityNormal, 2048); + //Thread aithread(AI::ailayer, NULL, osPriorityNormal, 2048); // motion layer periodic callback - RtosTimer motion_timer(motion::motionlayer, osTimerPeriodic); - motion_timer.start(50); + //RtosTimer motion_timer(motion::motionlayer, osTimerPeriodic); + //motion_timer.start(50); - Thread printingThread(Printing::printingloop, NULL, osPriorityLow, 2048); + //Thread printingThread(Printing::printingloop, NULL, osPriorityLow, 2048); //while(1){ // printf("r:%f, l:%f, t:%f\r\n", right_encoder.getTicks()*ENCODER_M_PER_TICK, left_encoder.getTicks()*ENCODER_M_PER_TICK, SystemTime.read()); //} //measureCPUidle(); //repurpose thread for idle measurement + + MotorControl::set_omegacmd(0); + for(float spd = 0.02; spd <= 0.5; spd *= 1.4){ + + MotorControl::set_fwdcmd(spd); + + Thread::wait(3000); + + float f = MotorControl::mfwdpowdbg; + float r = MotorControl::mrotpowdbg; + MotorControl::set_fwdcmd(0); + printf("targetspd:%f, fwd:%f, rot:%f\r\n", spd, f, r); + Thread::wait(5000); + } + Thread::wait(osWaitForever); }