diff --git a/libraries/AP_Motors/AP_MotorsHeli.cpp b/libraries/AP_Motors/AP_MotorsHeli.cpp index de3f1ab9b7..d7a1054500 100644 --- a/libraries/AP_Motors/AP_MotorsHeli.cpp +++ b/libraries/AP_Motors/AP_MotorsHeli.cpp @@ -181,6 +181,9 @@ const AP_Param::GroupInfo AP_MotorsHeli::var_info[] = { // init void AP_MotorsHeli::init(motor_frame_class frame_class, motor_frame_type frame_type) { + // remember frame type + _frame_type = frame_type; + // set update rate set_update_rate(_speed_hz); diff --git a/libraries/AP_Motors/AP_MotorsHeli.h b/libraries/AP_Motors/AP_MotorsHeli.h index 811caa480e..fff7f40032 100644 --- a/libraries/AP_Motors/AP_MotorsHeli.h +++ b/libraries/AP_Motors/AP_MotorsHeli.h @@ -213,4 +213,6 @@ protected: // internal variables float _collective_mid_pct = 0.0f; // collective mid parameter value converted to 0 ~ 1 range uint8_t _servo_test_cycle_counter = 0; // number of test cycles left to run after bootup + + motor_frame_type _frame_type; }; diff --git a/libraries/AP_Motors/AP_MotorsHeli_Quad.cpp b/libraries/AP_Motors/AP_MotorsHeli_Quad.cpp index 286e4dc5b1..d91aa5fb75 100644 --- a/libraries/AP_Motors/AP_MotorsHeli_Quad.cpp +++ b/libraries/AP_Motors/AP_MotorsHeli_Quad.cpp @@ -165,13 +165,18 @@ void AP_MotorsHeli_Quad::calculate_roll_pitch_collective_factors() // assume X quad layout, with motors at 45, 135, 225 and 315 degrees // order FrontRight, RearLeft, FrontLeft, RearLeft const float angles[AP_MOTORS_HELI_QUAD_NUM_MOTORS] = { 45, 225, 315, 135 }; - const bool clockwise[AP_MOTORS_HELI_QUAD_NUM_MOTORS] = { false, false, true, true }; + const bool x_clockwise[AP_MOTORS_HELI_QUAD_NUM_MOTORS] = { false, false, true, true }; const float cos45 = cosf(radians(45)); for (uint8_t i=0; i