NHK2017Ateamかにろぼ

Dependencies:   2017NHKpin_config mbed FEP HMC6352 MotorDriverController PID QEI omni

classDiagram

    \ ̄\                   / ̄/ 
/l     \  \             /  / lヽ  
| ヽ  ヽ   |           |  /  / | 
\ ` ‐ヽ  ヽ  ●        ●         /  / ‐  / 
  \ __ l  |  ||___|| /  l __ / 
     \  \ /      \/ 
      /\|   人__人  |/\       
    //\|             |/\\     
    //\|             |/\\     
    /     . \_____/         \ 

                               ┏┓        ┏━┓┏┓              
     ┏┓         ┏┓┏┓   ┏┓    ┏┓┗┛     ┏┓ ┗┓┃┗┛              
┏┛┗━┓  ┃┃┃┃    ┃┃┏━┛┗┓┏┓┏┛┗━┓┃┃┏┓┏┓┏━━━┓ 
┗┓┏━┛  ┃┃┗┛    ┃┃┗━┓┏┛┗┛┗┓┏┓┃┗┛┗┛┃┃┗━━━┛    
┏┛┃┏━┓┃┗━━┓┃┃┏━┛┗┓      ┏┛┃┃┃        ┃┃              
┃┏┛┗━┛┗━━┓┃┃┃┃┏┓┏┛      ┗━┛┃┃        ┃┃┏┓          
┃┃┏━━┓┏━━┛┃┃┃┃┗┛┃         ┏┛┃        ┃┃┃┗━━┓    
┗┛┗━━┛┗━━━┛┗┛┗━━┛         ┗━┛        ┗┛┗━━━┛  
Committer:
UCHITAKE
Date:
Tue Aug 22 11:56:47 2017 +0000
Revision:
2:ea151e05033a
Parent:
1:269914e0aa07
Child:
3:d25e7fb07ed2
???????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
UCHITAKE 0:757e9800c103 1 #ifndef CONTROLLER_H
UCHITAKE 0:757e9800c103 2 #define CONTROLLER_H
UCHITAKE 0:757e9800c103 3
UCHITAKE 0:757e9800c103 4 #include "mbed.h"
UCHITAKE 0:757e9800c103 5 #include "pin_config.h"
UCHITAKE 1:269914e0aa07 6 #include <math.h>
UCHITAKE 0:757e9800c103 7
UCHITAKE 0:757e9800c103 8 #include "FEP.h"
UCHITAKE 0:757e9800c103 9
UCHITAKE 1:269914e0aa07 10 #define M_PI 3.141592653589793
UCHITAKE 0:757e9800c103 11 #define ADDR 000
UCHITAKE 0:757e9800c103 12
UCHITAKE 1:269914e0aa07 13 /** @def
UCHITAKE 1:269914e0aa07 14 * FEP受信成功
UCHITAKE 1:269914e0aa07 15 */
UCHITAKE 1:269914e0aa07 16 #define FEP_SUCCESS 0
UCHITAKE 1:269914e0aa07 17
UCHITAKE 1:269914e0aa07 18 /** @def
UCHITAKE 1:269914e0aa07 19 * スティック生値を割る数
UCHITAKE 1:269914e0aa07 20 */
UCHITAKE 1:269914e0aa07 21 #define STICK_DIVIDE 255.0
UCHITAKE 1:269914e0aa07 22
UCHITAKE 1:269914e0aa07 23 /** @def
UCHITAKE 1:269914e0aa07 24 * スティックニュートラルの範囲
UCHITAKE 1:269914e0aa07 25 */
UCHITAKE 1:269914e0aa07 26 #define STICK_NEWTRAL 0.1
UCHITAKE 1:269914e0aa07 27
UCHITAKE 1:269914e0aa07 28 /** @def
UCHITAKE 1:269914e0aa07 29 * スティックの距離の限界
UCHITAKE 1:269914e0aa07 30 */
UCHITAKE 1:269914e0aa07 31 #define STICK_NORM_MAX 1.0
UCHITAKE 1:269914e0aa07 32
UCHITAKE 1:269914e0aa07 33 class Controller : public FEP
UCHITAKE 1:269914e0aa07 34 {
UCHITAKE 0:757e9800c103 35 public :
UCHITAKE 0:757e9800c103 36 Controller();
UCHITAKE 1:269914e0aa07 37
UCHITAKE 2:ea151e05033a 38 void receiveState();//need confirm
UCHITAKE 0:757e9800c103 39 private :
UCHITAKE 1:269914e0aa07 40 void getStickData();
UCHITAKE 1:269914e0aa07 41
UCHITAKE 1:269914e0aa07 42 char data[6];
UCHITAKE 1:269914e0aa07 43 uint8_t fepTemp;
UCHITAKE 1:269914e0aa07 44 protected :
UCHITAKE 1:269914e0aa07 45 bool Button1[7];
UCHITAKE 1:269914e0aa07 46 bool Button2[6];
UCHITAKE 1:269914e0aa07 47 double stick[4];
UCHITAKE 1:269914e0aa07 48 double degree[2];
UCHITAKE 1:269914e0aa07 49 double norm[2];
UCHITAKE 1:269914e0aa07 50 double vector[2];
UCHITAKE 2:ea151e05033a 51 double vector2[2];
UCHITAKE 0:757e9800c103 52 };
UCHITAKE 0:757e9800c103 53
UCHITAKE 0:757e9800c103 54 #endif//CONTROLLER_H