Localization

Dependencies:   BNO055_fusion mbed

Committer:
12104404
Date:
Thu Mar 03 01:00:32 2016 +0000
Revision:
3:c58eb4be51de
Parent:
1:8966a48ce8d5
Child:
4:d70375cfa533
cleaned up localization;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
12104404 0:96d6eb224379 1 #include "LOCALIZE.h"
12104404 0:96d6eb224379 2
12104404 0:96d6eb224379 3 #define RANGE_ERROR 14
12104404 0:96d6eb224379 4 #define RANGE_DIFF 10
12104404 0:96d6eb224379 5 #define RANGE_JMPS 4
12104404 0:96d6eb224379 6
12104404 0:96d6eb224379 7 //Serial pc(p13, p14);
12104404 0:96d6eb224379 8 Serial pc(USBTX, USBRX);
12104404 0:96d6eb224379 9
12104404 0:96d6eb224379 10 I2C i2c1(p28, p27);
12104404 0:96d6eb224379 11 I2C i2c2(p9, p10);
12104404 0:96d6eb224379 12 LOCALIZE loc(i2c1, i2c2, p26);
12104404 0:96d6eb224379 13 LOCALIZE_xya xya;
12104404 0:96d6eb224379 14
12104404 0:96d6eb224379 15 DigitalOut led1(LED1);
12104404 0:96d6eb224379 16 DigitalOut led2(LED2);
12104404 0:96d6eb224379 17 DigitalOut led3(LED3);
12104404 0:96d6eb224379 18 DigitalOut led4(LED4);
12104404 0:96d6eb224379 19
12104404 0:96d6eb224379 20 int main()
12104404 0:96d6eb224379 21 {
12104404 0:96d6eb224379 22 pc.baud(9600);
12104404 0:96d6eb224379 23 pc.printf("IMU INIT %d\n",loc.init());
12104404 0:96d6eb224379 24 while(1) {
12104404 1:8966a48ce8d5 25 //loc.get_angle(&xya);
12104404 1:8966a48ce8d5 26 loc.get_xy(&xya);
12104404 1:8966a48ce8d5 27 pc.printf("X: %3d\tY: %3d\tP: %3d\n",xya.x,xya.y,xya.a);
12104404 3:c58eb4be51de 28 pc.printf("X: %3d\tY: %3d\tP: %3d\n",xya.x,xya.y,xya.a);
12104404 3:c58eb4be51de 29 //pc.printf("%c%c%c%c\n",xya.x,xya.y,xya.a/10,xya.a%10);
12104404 0:96d6eb224379 30 }
12104404 0:96d6eb224379 31 }