Localization
Dependencies: BNO055_fusion mbed
main.cpp@4:d70375cfa533, 2016-03-04 (annotated)
- Committer:
- 12104404
- Date:
- Fri Mar 04 03:02:36 2016 +0000
- Revision:
- 4:d70375cfa533
- Parent:
- 3:c58eb4be51de
- Child:
- 5:c89308dc1827
added N P;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
12104404 | 0:96d6eb224379 | 1 | #include "LOCALIZE.h" |
12104404 | 0:96d6eb224379 | 2 | |
12104404 | 0:96d6eb224379 | 3 | //Serial pc(p13, p14); |
12104404 | 0:96d6eb224379 | 4 | Serial pc(USBTX, USBRX); |
12104404 | 0:96d6eb224379 | 5 | |
12104404 | 0:96d6eb224379 | 6 | I2C i2c1(p28, p27); |
12104404 | 0:96d6eb224379 | 7 | I2C i2c2(p9, p10); |
12104404 | 0:96d6eb224379 | 8 | LOCALIZE loc(i2c1, i2c2, p26); |
12104404 | 0:96d6eb224379 | 9 | LOCALIZE_xya xya; |
12104404 | 0:96d6eb224379 | 10 | |
12104404 | 0:96d6eb224379 | 11 | DigitalOut led1(LED1); |
12104404 | 0:96d6eb224379 | 12 | DigitalOut led2(LED2); |
12104404 | 0:96d6eb224379 | 13 | DigitalOut led3(LED3); |
12104404 | 0:96d6eb224379 | 14 | DigitalOut led4(LED4); |
12104404 | 0:96d6eb224379 | 15 | |
12104404 | 0:96d6eb224379 | 16 | int main() |
12104404 | 0:96d6eb224379 | 17 | { |
12104404 | 0:96d6eb224379 | 18 | pc.baud(9600); |
12104404 | 4:d70375cfa533 | 19 | pc.printf("Initialized Localization: %d\n",loc.init()); |
12104404 | 0:96d6eb224379 | 20 | while(1) { |
12104404 | 1:8966a48ce8d5 | 21 | //loc.get_angle(&xya); |
12104404 | 1:8966a48ce8d5 | 22 | loc.get_xy(&xya); |
12104404 | 1:8966a48ce8d5 | 23 | pc.printf("X: %3d\tY: %3d\tP: %3d\n",xya.x,xya.y,xya.a); |
12104404 | 3:c58eb4be51de | 24 | pc.printf("X: %3d\tY: %3d\tP: %3d\n",xya.x,xya.y,xya.a); |
12104404 | 3:c58eb4be51de | 25 | //pc.printf("%c%c%c%c\n",xya.x,xya.y,xya.a/10,xya.a%10); |
12104404 | 0:96d6eb224379 | 26 | } |
12104404 | 0:96d6eb224379 | 27 | } |