Cleanup and removed some old tests to save data flash.

git-svn-id: https://arducopter.googlecode.com/svn/trunk@3030 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
jasonshort 2011-08-05 16:47:44 +00:00
parent 99a327ccbf
commit de191b7bee
1 changed files with 28 additions and 32 deletions

View File

@ -30,7 +30,7 @@ static int8_t test_optflow(uint8_t argc, const Menu::arg *argv);
static int8_t test_xbee(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_eedump(uint8_t argc, const Menu::arg *argv);
static int8_t test_rawgps(uint8_t argc, const Menu::arg *argv); static int8_t test_rawgps(uint8_t argc, const Menu::arg *argv);
static int8_t test_mission(uint8_t argc, const Menu::arg *argv); //static int8_t test_mission(uint8_t argc, const Menu::arg *argv);
// This is the help function // This is the help function
// PSTR is an AVR macro to read strings from flash memory // PSTR is an AVR macro to read strings from flash memory
@ -80,7 +80,7 @@ const struct Menu::command test_menu_commands[] PROGMEM = {
{"xbee", test_xbee}, {"xbee", test_xbee},
{"eedump", test_eedump}, {"eedump", test_eedump},
{"rawgps", test_rawgps}, {"rawgps", test_rawgps},
{"mission", test_mission}, // {"mission", test_mission},
//{"reverse", test_reverse}, //{"reverse", test_reverse},
//{"wp", test_wp_nav}, //{"wp", test_wp_nav},
}; };
@ -271,9 +271,12 @@ test_wp_nav(uint8_t argc, const Menu::arg *argv)
} }
} }
*/ */
static int8_t static int8_t
test_failsafe(uint8_t argc, const Menu::arg *argv) test_failsafe(uint8_t argc, const Menu::arg *argv)
{ {
#if THROTTLE_FAILSAFE
byte fail_test; byte fail_test;
print_hit_enter(); print_hit_enter();
for(int i = 0; i < 50; i++){ for(int i = 0; i < 50; i++){
@ -318,6 +321,9 @@ test_failsafe(uint8_t argc, const Menu::arg *argv)
return (0); return (0);
} }
} }
#else
return (0);
#endif
} }
/*static int8_t /*static int8_t
@ -458,8 +464,8 @@ test_imu(uint8_t argc, const Menu::arg *argv)
// --- // ---
read_AHRS(); read_AHRS();
Vector3f accels = imu.get_accel(); //Vector3f accels = imu.get_accel();
Vector3f gyros = imu.get_gyro(); //Vector3f gyros = imu.get_gyro();
//Vector3f accel_filt = imu.get_accel_filtered(); //Vector3f accel_filt = imu.get_accel_filtered();
//accels_rot = dcm.get_dcm_matrix() * accel_filt; //accels_rot = dcm.get_dcm_matrix() * accel_filt;
@ -512,13 +518,8 @@ test_imu(uint8_t argc, const Menu::arg *argv)
cos_yaw_x, // x cos_yaw_x, // x
sin_yaw_y); // y sin_yaw_y); // y
//*/ //*/
//Log_Write_Raw();
//
#if HIL_MODE != HIL_MODE_ATTITUDE
Log_Write_Raw();
#endif
} }
if(Serial.available() > 0){ if(Serial.available() > 0){
return (0); return (0);
} }
@ -809,15 +810,15 @@ test_wp(uint8_t argc, const Menu::arg *argv)
delay(1000); delay(1000);
// save the alitude above home option // save the alitude above home option
Serial.printf_P(PSTR("Hold altitude ")); Serial.printf_P(PSTR("Hold alt "));
if(g.RTL_altitude < 0){ if(g.RTL_altitude < 0){
Serial.printf_P(PSTR("\n")); Serial.printf_P(PSTR("\n"));
}else{ }else{
Serial.printf_P(PSTR("of %dm\n"), (int)g.RTL_altitude / 100); Serial.printf_P(PSTR("of %dm\n"), (int)g.RTL_altitude / 100);
} }
Serial.printf_P(PSTR("%d waypoints\n"), (int)g.waypoint_total); Serial.printf_P(PSTR("%d wp\n"), (int)g.waypoint_total);
Serial.printf_P(PSTR("Hit radius: %d\n"), (int)g.waypoint_radius); Serial.printf_P(PSTR("Hit rad: %d\n"), (int)g.waypoint_radius);
//Serial.printf_P(PSTR("Loiter radius: %d\n\n"), (int)g.loiter_radius); //Serial.printf_P(PSTR("Loiter radius: %d\n\n"), (int)g.loiter_radius);
report_wp(); report_wp();
@ -871,11 +872,8 @@ test_baro(uint8_t argc, const Menu::arg *argv)
while(1){ while(1){
delay(100); delay(100);
baro_alt = read_barometer(); baro_alt = read_barometer();
Serial.printf_P(PSTR("Baro: %dcm\n"), baro_alt); Serial.printf_P(PSTR("Baro: %dcm\n"), baro_alt);
if(Serial.available() > 0){ if(Serial.available() > 0){
return (0); return (0);
} }
@ -896,14 +894,11 @@ test_mag(uint8_t argc, const Menu::arg *argv)
compass.read(); compass.read();
compass.calculate(dcm.get_dcm_matrix()); compass.calculate(dcm.get_dcm_matrix());
Vector3f maggy = compass.get_offsets(); Vector3f maggy = compass.get_offsets();
Serial.printf_P(PSTR("Heading: %ld, XYZ: %d, %d, %d,\tXYZoff: %6.2f, %6.2f, %6.2f\n"), Serial.printf_P(PSTR("Heading: %ld, XYZ: %d, %d, %d\n"),
(wrap_360(ToDeg(compass.heading) * 100)) /100, (wrap_360(ToDeg(compass.heading) * 100)) /100,
compass.mag_x, compass.mag_x,
compass.mag_y, compass.mag_y,
compass.mag_z, compass.mag_z);
maggy.x,
maggy.y,
maggy.z);
if(Serial.available() > 0){ if(Serial.available() > 0){
return (0); return (0);
@ -1012,19 +1007,20 @@ test_optflow(uint8_t argc, const Menu::arg *argv)
} }
#endif #endif
/*
static int8_t static int8_t
test_mission(uint8_t argc, const Menu::arg *argv) test_mission(uint8_t argc, const Menu::arg *argv)
{ {
//write out a basic mission to the EEPROM //write out a basic mission to the EEPROM
/*{ //{
uint8_t id; ///< command id // uint8_t id; ///< command id
uint8_t options; ///< options bitmask (1<<0 = relative altitude) // uint8_t options; ///< options bitmask (1<<0 = relative altitude)
uint8_t p1; ///< param 1 // uint8_t p1; ///< param 1
int32_t alt; ///< param 2 - Altitude in centimeters (meters * 100) // int32_t alt; ///< param 2 - Altitude in centimeters (meters * 100)
int32_t lat; ///< param 3 - Lattitude * 10**7 // int32_t lat; ///< param 3 - Lattitude * 10**7
int32_t lng; ///< param 4 - Longitude * 10**7 // int32_t lng; ///< param 4 - Longitude * 10**7
}*/ //}
// clear home // clear home
{Location t = {0, 0, 0, 0, 0, 0}; {Location t = {0, 0, 0, 0, 0, 0};
@ -1070,12 +1066,12 @@ test_mission(uint8_t argc, const Menu::arg *argv)
test_wp(NULL, NULL); test_wp(NULL, NULL);
return (0); return (0);
} }
*/
static void print_hit_enter() static void print_hit_enter()
{ {
Serial.printf_P(PSTR("Hit Enter to exit.\n\n")); Serial.printf_P(PSTR("Hit Enter to exit.\n\n"));
} }
/*
static void fake_out_gps() static void fake_out_gps()
{ {
static float rads; static float rads;
@ -1097,7 +1093,7 @@ static void fake_out_gps()
//next_WP.lat = home.lat + length * cos(rads); // Y //next_WP.lat = home.lat + length * cos(rads); // Y
} }
*/
static void print_motor_out(){ static void print_motor_out(){
Serial.printf("out: R: %d, L: %d F: %d B: %d\n", Serial.printf("out: R: %d, L: %d F: %d B: %d\n",