mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-26 17:53:59 -04:00
AP_Motors: add dodeca-hexa
This commit is contained in:
parent
d00725b2ed
commit
66fc49889b
@ -583,6 +583,44 @@ void AP_MotorsMatrix::setup_motors(motor_frame_class frame_class, motor_frame_ty
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MOTOR_FRAME_DODECAHEXA: {
|
||||||
|
switch (frame_type) {
|
||||||
|
case MOTOR_FRAME_TYPE_PLUS:
|
||||||
|
add_motor(AP_MOTORS_MOT_1, 0, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 1); // forward-top
|
||||||
|
add_motor(AP_MOTORS_MOT_2, 0, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 2); // forward-bottom
|
||||||
|
add_motor(AP_MOTORS_MOT_3, 60, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 3); // forward-right-top
|
||||||
|
add_motor(AP_MOTORS_MOT_4, 60, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 4); // forward-right-bottom
|
||||||
|
add_motor(AP_MOTORS_MOT_5, 120, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 5); // back-right-top
|
||||||
|
add_motor(AP_MOTORS_MOT_6, 120, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 6); // back-right-bottom
|
||||||
|
add_motor(AP_MOTORS_MOT_7, 180, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 7); // back-top
|
||||||
|
add_motor(AP_MOTORS_MOT_8, 180, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 8); // back-bottom
|
||||||
|
add_motor(AP_MOTORS_MOT_9, -120, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 9); // back-left-top
|
||||||
|
add_motor(AP_MOTORS_MOT_10, -120, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 10); // back-left-bottom
|
||||||
|
add_motor(AP_MOTORS_MOT_11, -60, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 11); // forward-left-top
|
||||||
|
add_motor(AP_MOTORS_MOT_12, -60, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 12); // forward-left-bottom
|
||||||
|
success = true;
|
||||||
|
break;
|
||||||
|
case MOTOR_FRAME_TYPE_X:
|
||||||
|
add_motor(AP_MOTORS_MOT_1, 30, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 1); // forward-right-top
|
||||||
|
add_motor(AP_MOTORS_MOT_2, 30, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 2); // forward-right-bottom
|
||||||
|
add_motor(AP_MOTORS_MOT_3, 90, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 3); // right-top
|
||||||
|
add_motor(AP_MOTORS_MOT_4, 90, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 4); // right-bottom
|
||||||
|
add_motor(AP_MOTORS_MOT_5, 150, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 5); // back-right-top
|
||||||
|
add_motor(AP_MOTORS_MOT_6, 150, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 6); // back-right-bottom
|
||||||
|
add_motor(AP_MOTORS_MOT_7, -150, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 7); // back-left-top
|
||||||
|
add_motor(AP_MOTORS_MOT_8, -150, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 8); // back-left-bottom
|
||||||
|
add_motor(AP_MOTORS_MOT_9, -90, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 9); // left-top
|
||||||
|
add_motor(AP_MOTORS_MOT_10, -90, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 10); // left-bottom
|
||||||
|
add_motor(AP_MOTORS_MOT_11, -30, AP_MOTORS_MATRIX_YAW_FACTOR_CW, 11); // forward-left-top
|
||||||
|
add_motor(AP_MOTORS_MOT_12, -30, AP_MOTORS_MATRIX_YAW_FACTOR_CCW, 12); // forward-left-bottom
|
||||||
|
success = true;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// dodeca-hexa frame class does not support this frame type
|
||||||
|
break;
|
||||||
|
}}
|
||||||
|
break;
|
||||||
|
|
||||||
case MOTOR_FRAME_Y6:
|
case MOTOR_FRAME_Y6:
|
||||||
switch (frame_type) {
|
switch (frame_type) {
|
||||||
case MOTOR_FRAME_TYPE_Y6B:
|
case MOTOR_FRAME_TYPE_Y6B:
|
||||||
|
@ -15,8 +15,12 @@
|
|||||||
#define AP_MOTORS_MOT_6 5U
|
#define AP_MOTORS_MOT_6 5U
|
||||||
#define AP_MOTORS_MOT_7 6U
|
#define AP_MOTORS_MOT_7 6U
|
||||||
#define AP_MOTORS_MOT_8 7U
|
#define AP_MOTORS_MOT_8 7U
|
||||||
|
#define AP_MOTORS_MOT_9 8U
|
||||||
|
#define AP_MOTORS_MOT_10 9U
|
||||||
|
#define AP_MOTORS_MOT_11 10U
|
||||||
|
#define AP_MOTORS_MOT_12 11U
|
||||||
|
|
||||||
#define AP_MOTORS_MAX_NUM_MOTORS 8
|
#define AP_MOTORS_MAX_NUM_MOTORS 12
|
||||||
|
|
||||||
// motor update rate
|
// motor update rate
|
||||||
#define AP_MOTORS_SPEED_DEFAULT 490 // default output rate to the motors
|
#define AP_MOTORS_SPEED_DEFAULT 490 // default output rate to the motors
|
||||||
@ -38,6 +42,7 @@ public:
|
|||||||
MOTOR_FRAME_COAX = 9,
|
MOTOR_FRAME_COAX = 9,
|
||||||
MOTOR_FRAME_TAILSITTER = 10,
|
MOTOR_FRAME_TAILSITTER = 10,
|
||||||
MOTOR_FRAME_HELI_DUAL = 11,
|
MOTOR_FRAME_HELI_DUAL = 11,
|
||||||
|
MOTOR_FRAME_DODECAHEXA = 12,
|
||||||
};
|
};
|
||||||
enum motor_frame_type {
|
enum motor_frame_type {
|
||||||
MOTOR_FRAME_TYPE_PLUS = 0,
|
MOTOR_FRAME_TYPE_PLUS = 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user