|
|
@ -26,9 +26,10 @@ void Copter::arm_motors_check() |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int16_t yaw_in = channel_yaw->get_control_in(); |
|
|
|
int16_t yaw_in = channel_yaw->get_control_in(); |
|
|
|
int16_t pitch_in = channel_pitch->get_control_in(); |
|
|
|
// int16_t pitch_in = channel_pitch->get_control_in();
|
|
|
|
int16_t roll_in = channel_roll->get_control_in(); |
|
|
|
// int16_t roll_in = channel_roll->get_control_in();
|
|
|
|
int16_t throttle_in = channel_throttle->get_control_in(); |
|
|
|
int16_t throttle_in = channel_throttle->get_control_in(); |
|
|
|
static const uint16_t trim_trg_value = arming.get_rudder_arm_value()*40; |
|
|
|
static const uint16_t trim_trg_value = arming.get_rudder_arm_value()*40; |
|
|
|
static const int8_t con_arm_delay = arming.get_rudder_arm_time(); |
|
|
|
static const int8_t con_arm_delay = arming.get_rudder_arm_time(); |
|
|
@ -45,7 +46,8 @@ void Copter::arm_motors_check() |
|
|
|
|
|
|
|
|
|
|
|
// full right
|
|
|
|
// full right
|
|
|
|
// if (yaw_in > 4000) {
|
|
|
|
// if (yaw_in > 4000) {
|
|
|
|
if(yaw_in>trim_trg_value&&pitch_in>trim_trg_value&&roll_in< -trim_trg_value){ |
|
|
|
// if(yaw_in>trim_trg_value&&pitch_in>trim_trg_value&&roll_in< -trim_trg_value){
|
|
|
|
|
|
|
|
if(yaw_in>trim_trg_value){ |
|
|
|
// increase the arming counter to a maximum of 1 beyond the auto trim counter
|
|
|
|
// increase the arming counter to a maximum of 1 beyond the auto trim counter
|
|
|
|
if (arming_counter <= AUTO_TRIM_DELAY) { |
|
|
|
if (arming_counter <= AUTO_TRIM_DELAY) { |
|
|
|
arming_counter++; |
|
|
|
arming_counter++; |
|
|
@ -69,11 +71,12 @@ void Copter::arm_motors_check() |
|
|
|
|
|
|
|
|
|
|
|
// full left and rudder disarming is enabled
|
|
|
|
// full left and rudder disarming is enabled
|
|
|
|
// } else if ((yaw_in < -4000) && (arming_rudder == AP_Arming::RudderArming::ARMDISARM)) {
|
|
|
|
// } else if ((yaw_in < -4000) && (arming_rudder == AP_Arming::RudderArming::ARMDISARM)) {
|
|
|
|
} else if((yaw_in<-trim_trg_value&&pitch_in>trim_trg_value&&roll_in>trim_trg_value)&&(arming_rudder==AP_Arming::RudderArming::ARMDISARM)){ |
|
|
|
// } else if((yaw_in<-trim_trg_value&&pitch_in>trim_trg_value&&roll_in>trim_trg_value)&&(arming_rudder==AP_Arming::RudderArming::ARMDISARM)){
|
|
|
|
|
|
|
|
} else if((yaw_in<-trim_trg_value)&&(arming_rudder==AP_Arming::RudderArming::ARMDISARM)){ |
|
|
|
if (!flightmode->has_manual_throttle() && !ap.land_complete) { |
|
|
|
if (!flightmode->has_manual_throttle() && !ap.land_complete) { |
|
|
|
arming_counter = 0; |
|
|
|
arming_counter = 0; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// increase the counter to a maximum of 1 beyond the disarm delay
|
|
|
|
// increase the counter to a maximum of 1 beyond the disarm delay
|
|
|
|
// if (arming_counter <= DISARM_DELAY) {
|
|
|
|
// if (arming_counter <= DISARM_DELAY) {
|
|
|
|