From b072190cf801b51fcc2a9f3e9409e4e37308aee7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 14 Jan 2020 17:25:07 +1100 Subject: [PATCH] SITL: added betaflight-rev-x frame --- libraries/SITL/SIM_Frame.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libraries/SITL/SIM_Frame.cpp b/libraries/SITL/SIM_Frame.cpp index d2da87ed67..5d1e082998 100644 --- a/libraries/SITL/SIM_Frame.cpp +++ b/libraries/SITL/SIM_Frame.cpp @@ -49,6 +49,15 @@ static Motor quad_bf_x_motors[] = Motor(AP_MOTORS_MOT_4, -45, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 4), }; +// motor order to match betaflight conventions, reversed direction +static Motor quad_bf_x_rev_motors[] = +{ + Motor(AP_MOTORS_MOT_1, 135, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 2), + Motor(AP_MOTORS_MOT_2, 45, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 1), + Motor(AP_MOTORS_MOT_3, -135, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 3), + Motor(AP_MOTORS_MOT_4, -45, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 4), +}; + // motor order to match DJI conventions // See: https://forum44.djicdn.com/data/attachment/forum/201711/26/172348bppvtt1ot1nrtp5j.jpg static Motor quad_dji_x_motors[] = @@ -190,6 +199,7 @@ static Frame supported_frames[] = Frame("quad", 4, quad_plus_motors), Frame("copter", 4, quad_plus_motors), Frame("x", 4, quad_x_motors), + Frame("bfxrev", 4, quad_bf_x_rev_motors), Frame("bfx", 4, quad_bf_x_motors), Frame("djix", 4, quad_dji_x_motors), Frame("cwx", 4, quad_cw_x_motors),