From 9a47d7b8e134bb74dd499c11e6790013fb516ec4 Mon Sep 17 00:00:00 2001 From: "james.goppert" Date: Sun, 1 May 2011 03:05:15 +0000 Subject: [PATCH] Example cleanup for APO. git-svn-id: https://arducopter.googlecode.com/svn/trunk@1938 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- .../examples/AutopilotCar/AutopilotCar.pde | 24 +++---------------- .../examples/AutopilotQuad/AutopilotQuad.pde | 24 +++---------------- 2 files changed, 6 insertions(+), 42 deletions(-) diff --git a/libraries/APO/examples/AutopilotCar/AutopilotCar.pde b/libraries/APO/examples/AutopilotCar/AutopilotCar.pde index 4654ff9465..084f9b8cb8 100644 --- a/libraries/APO/examples/AutopilotCar/AutopilotCar.pde +++ b/libraries/APO/examples/AutopilotCar/AutopilotCar.pde @@ -167,7 +167,7 @@ void setup() { * initialize them and NULL will be assigned to those corresponding pointers. * On detecting NULL assigned to any ultrasonic sensor, its corresponding block of code * will not be executed by the navigator. - * The coordinate system is assigned by the right hand screw rule with the thumb pointing down. + * The coordinate system is assigned by the right hand rule with the thumb pointing down. * In set_orientation, it is defind as (front/back,left/right,down,up) */ @@ -220,28 +220,11 @@ void setup() { } /* - * Navigator + * Select guidance, navigation, control algorithms */ AP_Navigator * navigator = new DcmNavigator(hal); - - /* - * Guide - */ AP_Guide * guide = new MavlinkGuide(k_guide,navigator,hal); - - /* - * Controller Initialization - */ - AP_Controller * controller = NULL; - switch(vehicle) - { - case VEHICLE_CAR: - controller = new CarController(k_cntrl,k_pidStr,k_pidThr,navigator,guide,hal); - break; - case VEHICLE_QUAD: - controller = new QuadController(navigator,guide,hal); - break; - } + AP_Controller * controller = new CarController(k_cntrl,k_pidStr,k_pidThr,navigator,guide,hal); /* * CommLinks @@ -254,7 +237,6 @@ void setup() { */ hal->debug->printf_P(PSTR("initializing ArduPilotOne\n")); hal->debug->printf_P(PSTR("free ram: %d bytes\n"),freeMemory()); - autoPilot = new apo::AP_Autopilot(navigator,guide,controller,hal); } diff --git a/libraries/APO/examples/AutopilotQuad/AutopilotQuad.pde b/libraries/APO/examples/AutopilotQuad/AutopilotQuad.pde index 0fd42ea18c..15e3d3bf1f 100644 --- a/libraries/APO/examples/AutopilotQuad/AutopilotQuad.pde +++ b/libraries/APO/examples/AutopilotQuad/AutopilotQuad.pde @@ -167,7 +167,7 @@ void setup() { * initialize them and NULL will be assigned to those corresponding pointers. * On detecting NULL assigned to any ultrasonic sensor, its corresponding block of code * will not be executed by the navigator. - * The coordinate system is assigned by the right hand screw rule with the thumb pointing down. + * The coordinate system is assigned by the right hand rule with the thumb pointing down. * In set_orientation, it is defind as (front/back,left/right,down,up) */ @@ -220,28 +220,11 @@ void setup() { } /* - * Navigator + * Select guidance, navigation, control algorithms */ AP_Navigator * navigator = new DcmNavigator(hal); - - /* - * Guide - */ AP_Guide * guide = new MavlinkGuide(k_guide,navigator,hal); - - /* - * Controller Initialization - */ - AP_Controller * controller = NULL; - switch(vehicle) - { - case VEHICLE_CAR: - controller = new CarController(k_cntrl,k_pidStr,k_pidThr,navigator,guide,hal); - break; - case VEHICLE_QUAD: - controller = new QuadController(navigator,guide,hal); - break; - } + AP_Controller * controller = new QuadController(navigator,guide,hal); /* * CommLinks @@ -254,7 +237,6 @@ void setup() { */ hal->debug->printf_P(PSTR("initializing ArduPilotOne\n")); hal->debug->printf_P(PSTR("free ram: %d bytes\n"),freeMemory()); - autoPilot = new apo::AP_Autopilot(navigator,guide,controller,hal); }