diff --git a/ArduCopterMega/motors_hexa.pde b/ArduCopterMega/motors_hexa.pde index 009bde589d..35511bbfb8 100644 --- a/ArduCopterMega/motors_hexa.pde +++ b/ArduCopterMega/motors_hexa.pde @@ -19,8 +19,8 @@ void output_motors_armed() g.rc_4.calc_pwm(); if(g.frame_orientation == X_FRAME){ - roll_out = (float)g.rc_1.pwm_out * .866; - pitch_out = g.rc_2.pwm_out / 2; + roll_out = g.rc_1.pwm_out / 2; + pitch_out = (float)g.rc_2.pwm_out * .866; //left side motor_out[CH_2] = g.rc_3.radio_out + g.rc_1.pwm_out; // CCW Middle @@ -33,7 +33,7 @@ void output_motors_armed() motor_out[CH_4] = g.rc_3.radio_out - roll_out - pitch_out; // CCW Back }else{ - roll_out = g.rc_1.pwm_out; + roll_out = (float)g.rc_1.pwm_out * .866; pitch_out = g.rc_2.pwm_out / 2; //Front side diff --git a/ArduCopterMega/system.pde b/ArduCopterMega/system.pde index dacd9785c6..bfded12549 100644 --- a/ArduCopterMega/system.pde +++ b/ArduCopterMega/system.pde @@ -37,7 +37,7 @@ const struct Menu::command main_menu_commands[] PROGMEM = { }; // Create the top-level menu object. -MENU(main_menu, "AC 2.0.22 Beta", main_menu_commands); +MENU(main_menu, "AC 2.0.23 Beta", main_menu_commands); void init_ardupilot() { diff --git a/ArduCopterMega/test.pde b/ArduCopterMega/test.pde index 59a06cc847..715997ba54 100644 --- a/ArduCopterMega/test.pde +++ b/ArduCopterMega/test.pde @@ -18,9 +18,9 @@ static int8_t test_tuning(uint8_t argc, const Menu::arg *argv); static int8_t test_current(uint8_t argc, const Menu::arg *argv); static int8_t test_relay(uint8_t argc, const Menu::arg *argv); static int8_t test_wp(uint8_t argc, const Menu::arg *argv); -static int8_t test_altitude(uint8_t argc, const Menu::arg *argv); +static int8_t test_baro(uint8_t argc, const Menu::arg *argv); static int8_t test_mag(uint8_t argc, const Menu::arg *argv); -//static int8_t test_sonar(uint8_t argc, const Menu::arg *argv); +static int8_t test_sonar(uint8_t argc, const Menu::arg *argv); static int8_t test_xbee(uint8_t argc, const Menu::arg *argv); static int8_t test_eedump(uint8_t argc, const Menu::arg *argv); static int8_t test_rawgps(uint8_t argc, const Menu::arg *argv); @@ -64,9 +64,9 @@ const struct Menu::command test_menu_commands[] PROGMEM = { {"relay", test_relay}, {"waypoints", test_wp}, #if HIL_MODE != HIL_MODE_ATTITUDE - {"altitude", test_altitude}, + {"altitude", test_baro}, #endif - //{"sonar", test_sonar}, + {"sonar", test_sonar}, {"compass", test_mag}, {"xbee", test_xbee}, {"eedump", test_eedump}, @@ -814,10 +814,9 @@ test_xbee(uint8_t argc, const Menu::arg *argv) #if HIL_MODE != HIL_MODE_ATTITUDE static int8_t -test_altitude(uint8_t argc, const Menu::arg *argv) +test_baro(uint8_t argc, const Menu::arg *argv) { print_hit_enter(); - init_barometer(); while(1){ @@ -825,14 +824,7 @@ test_altitude(uint8_t argc, const Menu::arg *argv) baro_alt = read_barometer(); - if(g.sonar_enabled){ - // decide which sensor we're usings - sonar_alt = sonar.read(); - } - - Serial.printf_P(PSTR("B_alt: %d, S_alt: %d\n"), - baro_alt, - sonar_alt); + Serial.printf_P(PSTR("Baro: %dcm\n"), baro_alt); if(Serial.available() > 0){ return (0); @@ -877,22 +869,21 @@ test_mag(uint8_t argc, const Menu::arg *argv) /* test the sonar */ -/*static int8_t +static int8_t test_sonar(uint8_t argc, const Menu::arg *argv) { print_hit_enter(); - delay(1000); - while(1) { - Serial.printf_P(PSTR("%d cm\n"), sonar.read()); delay(100); + + Serial.printf_P(PSTR("Sonar: %d cm\n"), sonar.read()); + if(Serial.available() > 0){ return (0); } } return (0); } -*/ static int8_t test_mission(uint8_t argc, const Menu::arg *argv)