library for omnidirectional planar positioning system

Dependents:   measuring_wheel 2018NHK_gakugaku_robo 2018NHK_gaku_ver2

Committer:
UCHITAKE
Date:
Tue Oct 23 19:29:35 2018 +0900
Revision:
13:913b647071a8
Parent:
9:222f7fcbd05a
tukaeru

Who changed what in which revision?

UserRevisionLine numberNew contents of line
UCHITAKE 0:58910ef3f2b0 1 #ifndef OMNI_POSITION_H
UCHITAKE 0:58910ef3f2b0 2 #define OMNI_POSITION_H
UCHITAKE 0:58910ef3f2b0 3
UCHITAKE 0:58910ef3f2b0 4 #include "mbed.h"
tanabe2000 9:222f7fcbd05a 5
UCHITAKE 13:913b647071a8 6 #define OP_SERIAL_BUFFER_SIZE 9
UCHITAKE 13:913b647071a8 7 #define OP_HEADER_FIRST_BYTE 72
UCHITAKE 13:913b647071a8 8 #define OP_HEADER_SECOND_BYTE 42
UCHITAKE 13:913b647071a8 9 #define OP_DEFAULT_BAUD 115200
UCHITAKE 0:58910ef3f2b0 10
UCHITAKE 13:913b647071a8 11 class OmniPosition : public RawSerial {
UCHITAKE 13:913b647071a8 12 public:
UCHITAKE 13:913b647071a8 13 OmniPosition(PinName serialTX, PinName serialRX);
takeuchi 1:0229fc98a26f 14
UCHITAKE 13:913b647071a8 15 int16_t getX();
UCHITAKE 13:913b647071a8 16 int16_t getY();
UCHITAKE 13:913b647071a8 17 float getTheta();
takeuchi 2:edd33d3ad0fd 18
UCHITAKE 13:913b647071a8 19 void reset();
takeuchi 2:edd33d3ad0fd 20
UCHITAKE 13:913b647071a8 21 private:
UCHITAKE 13:913b647071a8 22 DigitalOut debugled;
UCHITAKE 13:913b647071a8 23 void receiveByte();
UCHITAKE 13:913b647071a8 24 void checkData();
takeuchi 2:edd33d3ad0fd 25
UCHITAKE 13:913b647071a8 26 uint8_t buffer[9];
UCHITAKE 13:913b647071a8 27 uint8_t bufferSize;
UCHITAKE 13:913b647071a8 28 uint8_t bufferPoint;
UCHITAKE 13:913b647071a8 29 uint8_t receivedBytes;
UCHITAKE 13:913b647071a8 30 int16_t X;
UCHITAKE 13:913b647071a8 31 int16_t Y;
UCHITAKE 13:913b647071a8 32 int16_t theta;
UCHITAKE 0:58910ef3f2b0 33 };
UCHITAKE 0:58910ef3f2b0 34
UCHITAKE 13:913b647071a8 35 #endif
UCHITAKE 13:913b647071a8 36