library for omnidirectional planar positioning system

Dependents:   measuring_wheel 2018NHK_gakugaku_robo 2018NHK_gaku_ver2

OmniPosition.h

Committer:
UCHITAKE
Date:
2018-10-06
Revision:
10:a21aa2bd05c5
Parent:
9:222f7fcbd05a

File content as of revision 10:a21aa2bd05c5:

#ifndef OMNI_POSITION_H
#define OMNI_POSITION_H

#include "mbed.h"

#define OP_SERIAL_BUFFER_SIZE 9
#define OP_HEADER_FIRST_BYTE 72
#define OP_HEADER_SECOND_BYTE 42
#define OP_DEFAULT_BAUD 115200

class OmniPosition : public RawSerial {
 public:
  OmniPosition(PinName serialTX, PinName serialRX);

  int16_t getX();
  int16_t getY();
  float getTheta();

  void reset();

 private:
  DigitalOut debugled;
  void receiveByte();
  void checkData();

  uint8_t buffer[9];
  uint8_t bufferSize;
  uint8_t bufferPoint;
  uint8_t receivedBytes;
  int16_t X;
  int16_t Y;
  int16_t theta;
};

#endif