library for omnidirectional planar positioning system

Dependents:   measuring_wheel 2018NHK_gakugaku_robo 2018NHK_gaku_ver2

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers OmniPosition.h Source File

OmniPosition.h

00001 #ifndef OMNI_POSITION_H
00002 #define OMNI_POSITION_H
00003 
00004 #include "mbed.h"
00005 
00006 #define OP_SERIAL_BUFFER_SIZE 9
00007 #define OP_HEADER_FIRST_BYTE 72
00008 #define OP_HEADER_SECOND_BYTE 42
00009 #define OP_DEFAULT_BAUD 115200
00010 
00011 class OmniPosition : public RawSerial {
00012  public:
00013   OmniPosition(PinName serialTX, PinName serialRX);
00014 
00015   int16_t getX();
00016   int16_t getY();
00017   float getTheta();
00018 
00019   void reset();
00020 
00021  private:
00022   DigitalOut debugled;
00023   void receiveByte();
00024   void checkData();
00025 
00026   uint8_t buffer[9];
00027   uint8_t bufferSize;
00028   uint8_t bufferPoint;
00029   uint8_t receivedBytes;
00030   int16_t X;
00031   int16_t Y;
00032   int16_t theta;
00033 };
00034 
00035 #endif
00036