2012-04-02 05:26:37 -03:00
|
|
|
/*
|
2012-08-17 03:20:26 -03:00
|
|
|
* AP_MotorsHexa.cpp - ArduCopter motors library
|
|
|
|
* Code by RandyMackay. DIYDrones.com
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*/
|
2012-04-02 05:26:37 -03:00
|
|
|
|
|
|
|
#include "AP_MotorsHexa.h"
|
|
|
|
|
|
|
|
// setup_motors - configures the motors for a hexa
|
|
|
|
void AP_MotorsHexa::setup_motors()
|
|
|
|
{
|
2012-08-17 03:20:26 -03:00
|
|
|
// call parent
|
|
|
|
AP_MotorsMatrix::setup_motors();
|
2012-04-02 05:26:37 -03:00
|
|
|
|
2012-08-17 03:20:26 -03:00
|
|
|
// hard coded config for supported frames
|
|
|
|
if( _frame_orientation == AP_MOTORS_PLUS_FRAME ) {
|
|
|
|
// plus frame set-up
|
2012-12-17 02:28:42 -04:00
|
|
|
add_motor(AP_MOTORS_MOT_1, 0, AP_MOTORS_MATRIX_MOTOR_CW, 1);
|
|
|
|
add_motor(AP_MOTORS_MOT_2, 180, AP_MOTORS_MATRIX_MOTOR_CCW, 4);
|
|
|
|
add_motor(AP_MOTORS_MOT_3,-120, AP_MOTORS_MATRIX_MOTOR_CW, 5);
|
|
|
|
add_motor(AP_MOTORS_MOT_4, 60, AP_MOTORS_MATRIX_MOTOR_CCW, 2);
|
|
|
|
add_motor(AP_MOTORS_MOT_5, -60, AP_MOTORS_MATRIX_MOTOR_CCW, 6);
|
|
|
|
add_motor(AP_MOTORS_MOT_6, 120, AP_MOTORS_MATRIX_MOTOR_CW, 3);
|
2012-08-17 03:20:26 -03:00
|
|
|
}else{
|
|
|
|
// X frame set-up
|
2012-12-17 02:28:42 -04:00
|
|
|
add_motor(AP_MOTORS_MOT_1, 90, AP_MOTORS_MATRIX_MOTOR_CW, 2);
|
|
|
|
add_motor(AP_MOTORS_MOT_2, -90, AP_MOTORS_MATRIX_MOTOR_CCW, 5);
|
|
|
|
add_motor(AP_MOTORS_MOT_3, -30, AP_MOTORS_MATRIX_MOTOR_CW, 6);
|
|
|
|
add_motor(AP_MOTORS_MOT_4, 150, AP_MOTORS_MATRIX_MOTOR_CCW, 3);
|
|
|
|
add_motor(AP_MOTORS_MOT_5, 30, AP_MOTORS_MATRIX_MOTOR_CCW, 1);
|
|
|
|
add_motor(AP_MOTORS_MOT_6,-150, AP_MOTORS_MATRIX_MOTOR_CW, 4);
|
2012-08-17 03:20:26 -03:00
|
|
|
}
|
2012-04-02 05:26:37 -03:00
|
|
|
}
|