yei

Dependencies:   interface mbed enc_1multi calPID motorout KondoServoLibrary

Fork of cat18_operate by Catch the GIANT Caplico!

Committer:
shimizuta
Date:
Tue Sep 04 12:00:39 2018 +0000
Revision:
28:bcfc84b481bc
Parent:
23:f45eb02433a5
Child:
29:ea48140fc85e
add manual

Who changed what in which revision?

UserRevisionLine numberNew contents of line
shimizuta 14:f5f6bba2e70f 1 #ifndef INCLUDED_GO_H
shimizuta 14:f5f6bba2e70f 2 #define INCLUDED_GO_H
shimizuta 14:f5f6bba2e70f 3 /** @file
shimizuta 14:f5f6bba2e70f 4 @brief 目標位置まで行くプログラム.
shimizuta 14:f5f6bba2e70f 5 */
shimizuta 14:f5f6bba2e70f 6 #include "state.h"
shimizuta 28:bcfc84b481bc 7 #include "calPID.h"
shimizuta 28:bcfc84b481bc 8 #include "motorout.h"
shimizuta 14:f5f6bba2e70f 9 extern const double kPIDTicker_s;
shimizuta 20:13934809e117 10 extern const double kCalTargetTicker_s ;
shimizuta 23:f45eb02433a5 11 extern const double kServoMoveTicker_s;
shimizuta 20:13934809e117 12 extern int cal_target_ticket;
shimizuta 18:05f5a3323bda 13 extern int motor_move_ticket;
shimizuta 23:f45eb02433a5 14 extern int servo_move_ticket;
shimizuta 28:bcfc84b481bc 15
shimizuta 28:bcfc84b481bc 16 extern double output;
shimizuta 28:bcfc84b481bc 17 extern CalPID calpid;
shimizuta 28:bcfc84b481bc 18 extern MotorOut motor;
shimizuta 20:13934809e117 19 ///@brief プログラム初期設定
shimizuta 14:f5f6bba2e70f 20 void GoSetup();
shimizuta 20:13934809e117 21 //tickerで呼ぶ
shimizuta 18:05f5a3323bda 22 inline void PIDInterrupt()
shimizuta 18:05f5a3323bda 23 {
shimizuta 18:05f5a3323bda 24 motor_move_ticket = 1;
shimizuta 18:05f5a3323bda 25 };
shimizuta 20:13934809e117 26 inline void CalTargetInterrupt()
shimizuta 18:05f5a3323bda 27 {
shimizuta 20:13934809e117 28 cal_target_ticket = 1;
shimizuta 18:05f5a3323bda 29 };
shimizuta 23:f45eb02433a5 30 inline void ServoMoveInterrupt(){
shimizuta 23:f45eb02433a5 31 servo_move_ticket = 1;
shimizuta 23:f45eb02433a5 32 }
shimizuta 20:13934809e117 33 //ワーク位置
shimizuta 14:f5f6bba2e70f 34 int Go(WorkState &workstate);
shimizuta 20:13934809e117 35 //少し上昇
shimizuta 18:05f5a3323bda 36 void Above(AreaName areaname);
shimizuta 14:f5f6bba2e70f 37 //ゆっくり0点に戻るときに使う
shimizuta 14:f5f6bba2e70f 38 void GoToZeroSlowly();
shimizuta 20:13934809e117 39 //最初の動作チェック
shimizuta 16:b2358fd35999 40 void StartCheck();
shimizuta 28:bcfc84b481bc 41 //行ける目標値、yaw,pitchからsafe.elbowを計算.特例としてelbowはサーボ2の位置とする。elbowそのものを示していないので注意
shimizuta 28:bcfc84b481bc 42 void AllTargetToElbow(LocateParam &safe);
shimizuta 28:bcfc84b481bc 43 //サーボ出力値計算
shimizuta 28:bcfc84b481bc 44 void CalServoMove(LocateParam safe, LocateParam now);
shimizuta 28:bcfc84b481bc 45 //motor出力値。リミット機構搭載
shimizuta 28:bcfc84b481bc 46 double GetMotorOutPutZ();
shimizuta 14:f5f6bba2e70f 47 #endif