2019NHK_teamA_auto_measuring wheel

Dependencies:   QEI R1370MeasuringWheel

measuring_wheel.h

Committer:
tanabe2000
Date:
2018-09-18
Revision:
7:e74a1688680d
Parent:
3:30045028d27e

File content as of revision 7:e74a1688680d:

#ifndef MEASURING_WHEEL_H
#define MEASURING_WHEEL_H

#include "mbed.h"
#include "QEI.h"
#include "R1370.h"
#include "pin_config.h"
#include "SerialMultiByte.h"
#define PI 3.141592653589793

#define FIRST_HEDDER 0xEE
#define SECOND_HEDDER 0xFF
#define BUFFER_SIZE 6

class MeasuringWheel
{
public :
    MeasuringWheel(PinName channel1_1, PinName channel1_2, PinName channel2_1, PinName channel2_2, PinName channel3_1, PinName channel3_2);

    bool wheelDiameter(float diameter1, float diameter2, float diameter3);

    float getOutX();
    float getOutY();
    void transmissionXY();
    float getWheel1(),getWheel2(),getWheel3();
    float getjyroAngle();

private :
    float diameter[3];
    float radian[3];
    float wheel[3],r,X,Y,subX,subY;
    void computeXY();
    void threadloop();
    
       

    QEI w1;
    QEI w2;
    QEI w3;
    R1370 r1370;
    float Cdif, yaw, yawdegree;
    Thread thread;
    uint16_t X_, Y_,ofsetX, ofsetY, yawdegree_;
    char upBitX, upBitY, upBitAngle;
    char downBitX,downBitY, downBitAngle;
    char get;
    void resetposition(); 
    float beforeYaw, nowYaw;
    int yawMode;
    uint8_t txdata[BUFFER_SIZE];
    SerialMultiByte serial;
    
    
    
};

#endif