MEC-B / Mbed 2 deprecated AR_MastarNode_copy

Dependencies:   DriveConroller IMU MDD Mycan Odometer PID RotaryEncoder UART USS mbed

Fork of AR_MastarNode by MEC-B

hardwareConfig.h

Committer:
TanakaTarou
Date:
2018-10-07
Revision:
20:1957c67ab740
Parent:
12:91218718ae75
Child:
26:322309c42aa4

File content as of revision 20:1957c67ab740:

//オンボードLEDの使用宣言
DigitalOut LED[] = {DigitalOut(LED1),
                    DigitalOut(LED2),
                    DigitalOut(LED3),
                    DigitalOut(LED4),
                   };

//デバック用シリアル
Serial pc(USBTX, USBRX);

//CAN用 (rd, td)
Mycan can(p30, p29);

//メカナム逆運動学モデルのヤコビアン
float jacobian[4][3] = {{ 1, -1, -1},
                        { 1,  1, -1},
                        {-1,  1, -1},
                        {-1, -1, -1}
                       };
                       
//(逆運動学モデル, ホイールの計算100%定義)
DriveController mecanum(jacobian, 0.6);

//sbus用 (tx, rx)
SBUS sbus(p28, p27);

//(計算周期時間[s], sla, sld)
IMU imu(0.01, p9, p10);

//(pwmPin, direPin)
MDD Motor[4] = {  MDD(p24, p26),
                  MDD(p23, p25),
                  MDD(p22, p20),
                  MDD(p21, p19)
               };
               
Timer timer;

//(A相, B相)
RotaryEncoder enc[3] = {RotaryEncoder(p18 , p17 , &timer, 100),
                        RotaryEncoder(p16, p15, &timer, 100),
                        RotaryEncoder(p14, p13, &timer, 100)
                       };
                       
DigitalIn sw1(p5);
DigitalIn sw2(p6);

//(trig, echo)     
USS uss[2] = {USS(p11, p12), USS(p8, p7)};

             
//コントローラー入力のための構造体
typedef struct controller {
    float LX, LY, RX, RY;
    int A,B,C,D,E,F,G,H;
    int fail_safe;
} controller;