From 9eb9f12fb094e9bb387db2dc1700f8186261fc1b Mon Sep 17 00:00:00 2001 From: jasonshort Date: Thu, 14 Jul 2011 02:01:51 +0000 Subject: [PATCH] minor cosmetics git-svn-id: https://arducopter.googlecode.com/svn/trunk@2846 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- ArduCopterMega/Camera.pde | 3 --- ArduCopterMega/Mavlink_Common.h | 2 +- ArduCopterMega/Parameters.h | 13 ++-------- ArduCopterMega/test.pde | 43 ++++++++++++++++++++++++++++++++- 4 files changed, 45 insertions(+), 16 deletions(-) diff --git a/ArduCopterMega/Camera.pde b/ArduCopterMega/Camera.pde index a42b1014ce..2d2bb42ba5 100644 --- a/ArduCopterMega/Camera.pde +++ b/ArduCopterMega/Camera.pde @@ -8,19 +8,16 @@ void init_camera() g.rc_camera_pitch.radio_min = 1000; g.rc_camera_pitch.radio_trim = 1500; g.rc_camera_pitch.radio_max = 2000; - g.rc_camera_pitch.set_reverse(g.cam_pitch_reverse); g.rc_camera_roll.set_angle(4500); g.rc_camera_roll.radio_min = 1000; g.rc_camera_roll.radio_trim = 1500; g.rc_camera_roll.radio_max = 2000; - g.rc_camera_roll.set_reverse(g.cam_roll_reverse); } void camera_stabilization() { - // PITCH // ----- // allow control mixing diff --git a/ArduCopterMega/Mavlink_Common.h b/ArduCopterMega/Mavlink_Common.h index 1f5167ab59..ea1bae729e 100644 --- a/ArduCopterMega/Mavlink_Common.h +++ b/ArduCopterMega/Mavlink_Common.h @@ -201,8 +201,8 @@ void mavlink_send_message(mavlink_channel_t chan, uint8_t id, uint32_t param, ui motor_out[2], motor_out[3], motor_out[4], + motor_out[6], motor_out[7], - motor_out[8], 0); break; } diff --git a/ArduCopterMega/Parameters.h b/ArduCopterMega/Parameters.h index 2db2b31860..631d573455 100644 --- a/ArduCopterMega/Parameters.h +++ b/ArduCopterMega/Parameters.h @@ -104,8 +104,6 @@ public: k_param_throttle_cruise, k_param_flight_modes, k_param_esc_calibrate, - k_param_cam_pitch_reverse, - k_param_cam_roll_reverse, #if FRAME_CONFIG == HELI_FRAME @@ -242,9 +240,6 @@ public: RC_Channel rc_camera_pitch; RC_Channel rc_camera_roll; - AP_Int8 cam_pitch_reverse; - AP_Int8 cam_roll_reverse; - // PID controllers PID pid_rate_roll; PID pid_rate_pitch; @@ -330,12 +325,8 @@ public: rc_6 (k_param_rc_6, PSTR("RC6_")), rc_7 (k_param_rc_7, PSTR("RC7_")), rc_8 (k_param_rc_8, PSTR("RC8_")), - rc_camera_pitch (k_param_rc_9, NULL), - rc_camera_roll (k_param_rc_10, NULL), - - cam_pitch_reverse (0, k_param_cam_pitch_reverse, PSTR("CAM_P_REV")), - cam_roll_reverse (0, k_param_cam_roll_reverse, PSTR("CAM_R_REV")), - + rc_camera_pitch (k_param_rc_9, PSTR("RC_CP_")), + rc_camera_roll (k_param_rc_10, PSTR("RC_CR_")), // PID controller group key name initial P initial I initial D initial imax //-------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/ArduCopterMega/test.pde b/ArduCopterMega/test.pde index e943fdea7e..20ec8d86b8 100644 --- a/ArduCopterMega/test.pde +++ b/ArduCopterMega/test.pde @@ -14,6 +14,7 @@ static int8_t test_imu(uint8_t argc, const Menu::arg *argv); //static int8_t test_omega(uint8_t argc, const Menu::arg *argv); static int8_t test_battery(uint8_t argc, const Menu::arg *argv); //static int8_t test_wp_nav(uint8_t argc, const Menu::arg *argv); +//static int8_t test_reverse(uint8_t argc, const Menu::arg *argv); 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); @@ -72,6 +73,7 @@ const struct Menu::command test_menu_commands[] PROGMEM = { {"eedump", test_eedump}, {"rawgps", test_rawgps}, {"mission", test_mission}, + //{"reverse", test_reverse}, //{"wp", test_wp_nav}, }; @@ -81,7 +83,7 @@ MENU(test_menu, "test", test_menu_commands); int8_t test_mode(uint8_t argc, const Menu::arg *argv) { - Serial.printf_P(PSTR("Test Mode\n\n")); + //Serial.printf_P(PSTR("Test Mode\n\n")); test_menu.run(); } @@ -899,6 +901,45 @@ test_mag(uint8_t argc, const Menu::arg *argv) return (0); } } +/* +static int8_t +test_reverse(uint8_t argc, const Menu::arg *argv) +{ + print_hit_enter(); + delay(1000); + + while(1){ + delay(20); + + // Filters radio input - adjust filters in the radio.pde file + // ---------------------------------------------------------- + g.rc_4.set_reverse(0); + g.rc_4.set_pwm(APM_RC.InputCh(CH_4)); + g.rc_4.servo_out = g.rc_4.control_in; + g.rc_4.calc_pwm(); + Serial.printf_P(PSTR("PWM:%d input: %d\toutput%d "), + APM_RC.InputCh(CH_4), + g.rc_4.control_in, + g.rc_4.radio_out); + APM_RC.OutputCh(CH_6, g.rc_4.radio_out); + + + g.rc_4.set_reverse(1); + g.rc_4.set_pwm(APM_RC.InputCh(CH_4)); + g.rc_4.servo_out = g.rc_4.control_in; + g.rc_4.calc_pwm(); + Serial.printf_P(PSTR("\trev input: %d\toutput%d\n"), + g.rc_4.control_in, + g.rc_4.radio_out); + + APM_RC.OutputCh(CH_7, g.rc_4.radio_out); + + if(Serial.available() > 0){ + g.rc_4.set_reverse(0); + return (0); + } + } +}*/ /* test the sonar