not include takeoff
Dependencies: HCSR04_2 MPU6050_2 mbed SDFileSystem3
Fork of AutoFlight2017_now2 by
Revision 2:f5f33eb8d44b, committed 2018-09-09
- Comitter:
- HARUKIDELTA
- Date:
- Sun Sep 09 14:26:38 2018 +0000
- Parent:
- 1:f31e17341659
- Commit message:
- a
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r f31e17341659 -r f5f33eb8d44b main.cpp --- a/main.cpp Tue Aug 28 07:12:16 2018 +0000 +++ b/main.cpp Sun Sep 09 14:26:38 2018 +0000 @@ -33,7 +33,7 @@ #define RIGHT_PITCH -6.3 #define LEFT_ROLL 16.0 #define LEFT_PITCH -6.0 -#define STRAIGHT_ROLL 2.0 +#define STRAIGHT_ROLL 0.0 #define STRAIGHT_PITCH -3.0 #define TAKEOFF_THR 1.0 #define LOOP_THR 0.58 @@ -789,7 +789,7 @@ pwm[i] = sbuspwm[i]; } oldTHR = sbuspwm[THR]; - + pc.printf("%d",pwm[RUD]); //pc.printf("update_manual\r\n"); break; @@ -1036,12 +1036,13 @@ //離陸-投下-着陸一連 void Take_off_and_landing(float targetAngle[3]){ - if(!CheckSW_Up(Ch7)) bombing_mode = Takeoff; + //if(!CheckSW_Up(Ch7)) bombing_mode = Takeoff; - switch(bombing_mode){ - case Takeoff: + //switch(bombing_mode){ + /* case Takeoff: static bool flg_setFirstYaw = false; static int TakeoffCount = 0; + autopwm[RUD]=1409; if(!flg_setFirstYaw && CheckSW_Up(Ch7)){ FirstYAW = nowAngle[YAW] + FirstYAW; @@ -1067,7 +1068,7 @@ case Chicken: break; */ - case Transition: + /* case Transition: /* static int ApproachCount = 0; targetAngle[YAW]=180.0; @@ -1075,22 +1076,23 @@ if(Judge==0) ApproachCount++; if(ApproachCount>5) bombing_mode = Approach; - */ - break; - case Approach: + break;*/ + //case Approach: + autopwm[THR] = SetTHRinRatio(g_loopTHR); //0.7;スロットルの割合 UpdateTargetAngle_Approach(targetAngle); - break; + //break; - default: - bombing_mode = Takeoff; - break; - } + //default: + //bombing_mode = Takeoff; + //break; + //} } //離陸モード void UpdateTargetAngle_Takeoff(float targetAngle[3]){ static int tELE_start = 0; + autopwm[RUD]=1409; static bool flg_ELEup = false; int t_def = 0; if(!flg_ELEup && CheckSW_Up(Ch7)){ @@ -1185,6 +1187,7 @@ void UpdateTargetAngle_Approach(float targetAngle[3]){ static char rotatemode = 'G'; if(output_status == Manual) rotatemode = 'G'; + //autopwm[THR] = SetTHRinRatio(g_loopTHR); //0.7;スロットルの割合 //pc.putc(g_landingcommand); switch(g_landingcommand){