paparazzi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[paparazzi-commits] [5965] remove booz2_ prefix in autopilot variables,


From: Felix Ruess
Subject: [paparazzi-commits] [5965] remove booz2_ prefix in autopilot variables, functions, etc.
Date: Mon, 27 Sep 2010 22:55:13 +0000

Revision: 5965
          http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=5965
Author:   flixr
Date:     2010-09-27 22:55:12 +0000 (Mon, 27 Sep 2010)
Log Message:
-----------
remove booz2_ prefix in autopilot variables, functions, etc. ..

Modified Paths:
--------------
    paparazzi3/trunk/conf/autopilot/subsystems/fixedwing/autopilot.makefile
    paparazzi3/trunk/conf/settings/booz_dc.xml
    paparazzi3/trunk/conf/settings/settings_booz2.xml
    paparazzi3/trunk/sw/airborne/booz/booz2_navigation.c
    paparazzi3/trunk/sw/airborne/booz/booz2_navigation.h
    paparazzi3/trunk/sw/airborne/booz/booz2_telemetry.h
    paparazzi3/trunk/sw/airborne/firmwares/rotorcraft/autopilot.c
    paparazzi3/trunk/sw/airborne/firmwares/rotorcraft/autopilot.h
    paparazzi3/trunk/sw/airborne/firmwares/rotorcraft/main.c

Modified: 
paparazzi3/trunk/conf/autopilot/subsystems/fixedwing/autopilot.makefile
===================================================================
--- paparazzi3/trunk/conf/autopilot/subsystems/fixedwing/autopilot.makefile     
2010-09-27 22:55:01 UTC (rev 5964)
+++ paparazzi3/trunk/conf/autopilot/subsystems/fixedwing/autopilot.makefile     
2010-09-27 22:55:12 UTC (rev 5965)
@@ -1,5 +1,5 @@
 #
-# $Id: booz2_autopilot.makefile 4827 2010-04-21 08:02:18Z poine $
+# $Id: autopilot.makefile 4827 2010-04-21 08:02:18Z poine $
 #
 # Copyright (C) 2008 Antoine Drouin
 #

Modified: paparazzi3/trunk/conf/settings/booz_dc.xml
===================================================================
--- paparazzi3/trunk/conf/settings/booz_dc.xml  2010-09-27 22:55:01 UTC (rev 
5964)
+++ paparazzi3/trunk/conf/settings/booz_dc.xml  2010-09-27 22:55:12 UTC (rev 
5965)
@@ -3,7 +3,7 @@
 <settings>
   <dl_settings>
     <dl_settings NAME="DC">
-      <dl_setting MAX="1" MIN="0" STEP="1" VAR="booz2_autopilot_power_switch" 
module="autopilot" handler="SetPowerSwitch" shortname="Shutter">
+      <dl_setting MAX="1" MIN="0" STEP="1" VAR="autopilot_power_switch" 
module="autopilot" handler="SetPowerSwitch" shortname="Shutter">
        <strip_button name="Photo" icon="digital-camera.png" value="1"/>
        <strip_button name="Photo Off" icon="digital-camera-off.png" value="0"/>
       </dl_setting>

Modified: paparazzi3/trunk/conf/settings/settings_booz2.xml
===================================================================
--- paparazzi3/trunk/conf/settings/settings_booz2.xml   2010-09-27 22:55:01 UTC 
(rev 5964)
+++ paparazzi3/trunk/conf/settings/settings_booz2.xml   2010-09-27 22:55:12 UTC 
(rev 5965)
@@ -9,13 +9,13 @@
          <key_press key="v" value="7"/>
          <key_press key="h" value="8"/>
        </dl_setting>
-       <dl_setting var="booz2_autopilot_mode_auto2" min="0" step="1" max="12" 
module="autopilot" shortname="auto2" 
values="Fail|Kill|Rate|Att|Rate_rcC|Att_rcC|Att_C|Rate_Z|Att_Z|Hover|Hover_C|Hover_Z|Nav"/>
+       <dl_setting var="autopilot_mode_auto2" min="0" step="1" max="12" 
module="autopilot" shortname="auto2" 
values="Fail|Kill|Rate|Att|Rate_rcC|Att_rcC|Att_C|Rate_Z|Att_Z|Hover|Hover_C|Hover_Z|Nav"/>
       <dl_setting var="kill_throttle" min="0" step="1" max="1" 
module="autopilot" values="Resurrect|Kill" handler="KillThrottle"/>
-      <dl_setting var="booz2_autopilot_power_switch" min="0" step="1" max="1" 
module="autopilot" values="OFF|ON" handler="SetPowerSwitch">
+      <dl_setting var="autopilot_power_switch" min="0" step="1" max="1" 
module="autopilot" values="OFF|ON" handler="SetPowerSwitch">
         <strip_button name="POWER ON" icon="on.png" value="1"/>
         <strip_button name="POWER OFF" icon="off.png" value="0"/>
       </dl_setting>
-      <dl_setting var="booz2_autopilot_rc" min="0" step="1" max="1" 
module="autopilot" values="RC OFF|RC ON">
+      <dl_setting var="autopilot_rc" min="0" step="1" max="1" 
module="autopilot" values="RC OFF|RC ON">
         <strip_button name="RC ON" value="1"/>
         <strip_button name="RC OFF" value="0"/>
       </dl_setting>

Modified: paparazzi3/trunk/sw/airborne/booz/booz2_navigation.c
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz2_navigation.c        2010-09-27 
22:55:01 UTC (rev 5964)
+++ paparazzi3/trunk/sw/airborne/booz/booz2_navigation.c        2010-09-27 
22:55:12 UTC (rev 5965)
@@ -335,8 +335,8 @@
 }
 
 bool_t nav_detect_ground(void) {
-  if (!booz2_autopilot_detect_ground) return FALSE;
-  booz2_autopilot_detect_ground = FALSE;
+  if (!autopilot_detect_ground) return FALSE;
+  autopilot_detect_ground = FALSE;
   return TRUE;
 }
 

Modified: paparazzi3/trunk/sw/airborne/booz/booz2_navigation.h
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz2_navigation.h        2010-09-27 
22:55:01 UTC (rev 5964)
+++ paparazzi3/trunk/sw/airborne/booz/booz2_navigation.h        2010-09-27 
22:55:12 UTC (rev 5965)
@@ -82,8 +82,8 @@
 
 void nav_home(void);
 
-#define NavKillThrottle() ({ if (booz2_autopilot_mode == BOOZ2_AP_MODE_NAV) { 
kill_throttle = 1; booz2_autopilot_motors_on = 0; } FALSE; })
-#define NavResurrect() ({ if (booz2_autopilot_mode == BOOZ2_AP_MODE_NAV) { 
kill_throttle = 0; booz2_autopilot_motors_on = 1; } FALSE; })
+#define NavKillThrottle() ({ if (autopilot_mode == BOOZ2_AP_MODE_NAV) { 
kill_throttle = 1; autopilot_motors_on = 0; } FALSE; })
+#define NavResurrect() ({ if (autopilot_mode == BOOZ2_AP_MODE_NAV) { 
kill_throttle = 0; autopilot_motors_on = 1; } FALSE; })
 
 #define InitStage() nav_init_stage();
 
@@ -195,7 +195,7 @@
   nav_roll = ANGLE_BFP_OF_REAL(_roll); \
 }
 
-#define NavStartDetectGround() ({ booz2_autopilot_detect_ground_once = TRUE; 
FALSE; })
+#define NavStartDetectGround() ({ autopilot_detect_ground_once = TRUE; FALSE; 
})
 #define NavDetectGround() nav_detect_ground()
 
 #define nav_IncreaseShift(x) {}

Modified: paparazzi3/trunk/sw/airborne/booz/booz2_telemetry.h
===================================================================
--- paparazzi3/trunk/sw/airborne/booz/booz2_telemetry.h 2010-09-27 22:55:01 UTC 
(rev 5964)
+++ paparazzi3/trunk/sw/airborne/booz/booz2_telemetry.h 2010-09-27 22:55:12 UTC 
(rev 5965)
@@ -64,9 +64,9 @@
                              &_twi_blmc_nb_err,                        \
                              &radio_control.status,                    \
                              &booz_gps_state.fix,                      \
-                             &booz2_autopilot_mode,                    \
-                             &booz2_autopilot_in_flight,               \
-                             &booz2_autopilot_motors_on,               \
+                             &autopilot_mode,                  \
+                             &autopilot_in_flight,             \
+                             &autopilot_motors_on,             \
                              &booz2_guidance_h_mode,                   \
                              &booz2_guidance_v_mode,                   \
                              &booz2_battery_voltage,                   \
@@ -83,9 +83,9 @@
                              &twi_blmc_nb_err,                         \
                              &radio_control.status,                    \
                              &fix,                                     \
-                             &booz2_autopilot_mode,                    \
-                             &booz2_autopilot_in_flight,               \
-                             &booz2_autopilot_motors_on,               \
+                             &autopilot_mode,                  \
+                             &autopilot_in_flight,             \
+                             &autopilot_motors_on,             \
                              &booz2_guidance_h_mode,                   \
                              &booz2_guidance_v_mode,                   \
                              &booz2_battery_voltage,                   \
@@ -678,7 +678,7 @@
                            &carrot_up,                                 \
                            &booz2_guidance_h_command_body.psi,         \
                            &booz_stabilization_cmd[COMMAND_THRUST], \
-          &booz2_autopilot_flight_time);       \
+          &autopilot_flight_time);     \
   }
 
 #ifdef USE_GPS

Modified: paparazzi3/trunk/sw/airborne/firmwares/rotorcraft/autopilot.c
===================================================================
--- paparazzi3/trunk/sw/airborne/firmwares/rotorcraft/autopilot.c       
2010-09-27 22:55:01 UTC (rev 5964)
+++ paparazzi3/trunk/sw/airborne/firmwares/rotorcraft/autopilot.c       
2010-09-27 22:55:12 UTC (rev 5965)
@@ -31,74 +31,74 @@
 #include "booz_stabilization.h"
 #include "led.h"
 
-uint8_t booz2_autopilot_mode;
-uint8_t booz2_autopilot_mode_auto2;
-bool_t  booz2_autopilot_motors_on;
-bool_t  booz2_autopilot_in_flight;
-uint32_t booz2_autopilot_motors_on_counter;
-uint32_t booz2_autopilot_in_flight_counter;
+uint8_t autopilot_mode;
+uint8_t autopilot_mode_auto2;
+bool_t  autopilot_motors_on;
+bool_t  autopilot_in_flight;
+uint32_t autopilot_motors_on_counter;
+uint32_t autopilot_in_flight_counter;
 bool_t kill_throttle;
-bool_t booz2_autopilot_rc;
+bool_t autopilot_rc;
 
-bool_t booz2_autopilot_power_switch;
+bool_t autopilot_power_switch;
 
-bool_t booz2_autopilot_detect_ground;
-bool_t booz2_autopilot_detect_ground_once;
+bool_t autopilot_detect_ground;
+bool_t autopilot_detect_ground_once;
 
-uint16_t booz2_autopilot_flight_time;
+uint16_t autopilot_flight_time;
 
-#define BOOZ2_AUTOPILOT_MOTOR_ON_TIME     40
-#define BOOZ2_AUTOPILOT_IN_FLIGHT_TIME    40
-#define BOOZ2_AUTOPILOT_THROTTLE_TRESHOLD (MAX_PPRZ / 20)
-#define BOOZ2_AUTOPILOT_YAW_TRESHOLD      (MAX_PPRZ * 19 / 20)
+#define AUTOPILOT_MOTOR_ON_TIME     40
+#define AUTOPILOT_IN_FLIGHT_TIME    40
+#define AUTOPILOT_THROTTLE_TRESHOLD (MAX_PPRZ / 20)
+#define AUTOPILOT_YAW_TRESHOLD      (MAX_PPRZ * 19 / 20)
 
-void booz2_autopilot_init(void) {
-  booz2_autopilot_mode = BOOZ2_AP_MODE_KILL;
-  booz2_autopilot_motors_on = FALSE;
-  booz2_autopilot_in_flight = FALSE;
-  kill_throttle = ! booz2_autopilot_motors_on;
-  booz2_autopilot_motors_on_counter = 0;
-  booz2_autopilot_in_flight_counter = 0;
-  booz2_autopilot_mode_auto2 = BOOZ2_MODE_AUTO2;
-  booz2_autopilot_detect_ground = FALSE;
-  booz2_autopilot_detect_ground_once = FALSE;
-  booz2_autopilot_flight_time = 0;
-  booz2_autopilot_rc = TRUE;
-  booz2_autopilot_power_switch = FALSE;
+void autopilot_init(void) {
+  autopilot_mode = BOOZ2_AP_MODE_KILL;
+  autopilot_motors_on = FALSE;
+  autopilot_in_flight = FALSE;
+  kill_throttle = ! autopilot_motors_on;
+  autopilot_motors_on_counter = 0;
+  autopilot_in_flight_counter = 0;
+  autopilot_mode_auto2 = BOOZ2_MODE_AUTO2;
+  autopilot_detect_ground = FALSE;
+  autopilot_detect_ground_once = FALSE;
+  autopilot_flight_time = 0;
+  autopilot_rc = TRUE;
+  autopilot_power_switch = FALSE;
   LED_ON(POWER_SWITCH_LED); // POWER OFF
 }
 
 
-void booz2_autopilot_periodic(void) {
+void autopilot_periodic(void) {
 
   RunOnceEvery(BOOZ2_NAV_PRESCALER, nav_periodic_task());
 #ifdef BOOZ_FAILSAFE_GROUND_DETECT
-  if (booz2_autopilot_mode == BOOZ2_AP_MODE_FAILSAFE && 
booz2_autopilot_detect_ground) {
-    booz2_autopilot_set_mode(BOOZ2_AP_MODE_KILL);
-    booz2_autopilot_detect_ground = FALSE;
+  if (autopilot_mode == BOOZ2_AP_MODE_FAILSAFE && autopilot_detect_ground) {
+    autopilot_set_mode(BOOZ2_AP_MODE_KILL);
+    autopilot_detect_ground = FALSE;
   }
 #endif
-  if ( !booz2_autopilot_motors_on ||
+  if ( !autopilot_motors_on ||
 #ifndef BOOZ_FAILSAFE_GROUND_DETECT
-       booz2_autopilot_mode == BOOZ2_AP_MODE_FAILSAFE ||
+       autopilot_mode == BOOZ2_AP_MODE_FAILSAFE ||
 #endif
-       booz2_autopilot_mode == BOOZ2_AP_MODE_KILL ) {
+       autopilot_mode == BOOZ2_AP_MODE_KILL ) {
     SetCommands(booz2_commands_failsafe,
-               booz2_autopilot_in_flight, booz2_autopilot_motors_on);
+               autopilot_in_flight, autopilot_motors_on);
   }
   else {
-    booz2_guidance_v_run( booz2_autopilot_in_flight );
-    booz2_guidance_h_run( booz2_autopilot_in_flight );
+    booz2_guidance_v_run( autopilot_in_flight );
+    booz2_guidance_h_run( autopilot_in_flight );
     SetCommands(booz_stabilization_cmd,
-        booz2_autopilot_in_flight, booz2_autopilot_motors_on);
+        autopilot_in_flight, autopilot_motors_on);
   }
 
 }
 
 
-void booz2_autopilot_set_mode(uint8_t new_autopilot_mode) {
+void autopilot_set_mode(uint8_t new_autopilot_mode) {
 
-  if (new_autopilot_mode != booz2_autopilot_mode) {
+  if (new_autopilot_mode != autopilot_mode) {
     /* horizontal mode */
     switch (new_autopilot_mode) {
     case BOOZ2_AP_MODE_FAILSAFE:
@@ -109,7 +109,7 @@
       break;
 #endif
     case BOOZ2_AP_MODE_KILL:
-      booz2_autopilot_motors_on = FALSE;
+      autopilot_motors_on = FALSE;
       booz2_guidance_h_mode_changed(BOOZ2_GUIDANCE_H_MODE_KILL);
       break;
     case BOOZ2_AP_MODE_RATE_DIRECT:
@@ -167,93 +167,93 @@
     default:
       break;
     }
-    booz2_autopilot_mode = new_autopilot_mode;
+    autopilot_mode = new_autopilot_mode;
   }
 
 }
 
 #define THROTTLE_STICK_DOWN()                                          \
-  (radio_control.values[RADIO_CONTROL_THROTTLE] < 
BOOZ2_AUTOPILOT_THROTTLE_TRESHOLD)
+  (radio_control.values[RADIO_CONTROL_THROTTLE] < AUTOPILOT_THROTTLE_TRESHOLD)
 #define YAW_STICK_PUSHED()                                             \
-  (radio_control.values[RADIO_CONTROL_YAW] > BOOZ2_AUTOPILOT_YAW_TRESHOLD || \
-   radio_control.values[RADIO_CONTROL_YAW] < -BOOZ2_AUTOPILOT_YAW_TRESHOLD)
+  (radio_control.values[RADIO_CONTROL_YAW] > AUTOPILOT_YAW_TRESHOLD || \
+   radio_control.values[RADIO_CONTROL_YAW] < -AUTOPILOT_YAW_TRESHOLD)
 
-static inline void booz2_autopilot_check_in_flight( void) {
-  if (booz2_autopilot_in_flight) {
-    if (booz2_autopilot_in_flight_counter > 0) {
+static inline void autopilot_check_in_flight( void) {
+  if (autopilot_in_flight) {
+    if (autopilot_in_flight_counter > 0) {
       if (THROTTLE_STICK_DOWN()) {
-        booz2_autopilot_in_flight_counter--;
-        if (booz2_autopilot_in_flight_counter == 0) {
-          booz2_autopilot_in_flight = FALSE;
+        autopilot_in_flight_counter--;
+        if (autopilot_in_flight_counter == 0) {
+          autopilot_in_flight = FALSE;
         }
       }
       else {   /* !THROTTLE_STICK_DOWN */
-        booz2_autopilot_in_flight_counter = BOOZ2_AUTOPILOT_IN_FLIGHT_TIME;
+        autopilot_in_flight_counter = AUTOPILOT_IN_FLIGHT_TIME;
       }
     }
   }
   else { /* not in flight */
-    if (booz2_autopilot_in_flight_counter < BOOZ2_AUTOPILOT_IN_FLIGHT_TIME &&
-        booz2_autopilot_motors_on) {
+    if (autopilot_in_flight_counter < AUTOPILOT_IN_FLIGHT_TIME &&
+        autopilot_motors_on) {
       if (!THROTTLE_STICK_DOWN()) {
-        booz2_autopilot_in_flight_counter++;
-        if (booz2_autopilot_in_flight_counter == 
BOOZ2_AUTOPILOT_IN_FLIGHT_TIME)
-          booz2_autopilot_in_flight = TRUE;
+        autopilot_in_flight_counter++;
+        if (autopilot_in_flight_counter == AUTOPILOT_IN_FLIGHT_TIME)
+          autopilot_in_flight = TRUE;
       }
       else { /*  THROTTLE_STICK_DOWN */
-        booz2_autopilot_in_flight_counter = 0;
+        autopilot_in_flight_counter = 0;
       }
     }
   }
 }
 
-static inline void booz2_autopilot_check_motors_on( void ) {
-  if (booz2_autopilot_motors_on) {
+static inline void autopilot_check_motors_on( void ) {
+  if (autopilot_motors_on) {
     if (THROTTLE_STICK_DOWN() && YAW_STICK_PUSHED()) {
-      if ( booz2_autopilot_motors_on_counter > 0) {
-        booz2_autopilot_motors_on_counter--;
-        if (booz2_autopilot_motors_on_counter == 0)
-          booz2_autopilot_motors_on = FALSE;
+      if ( autopilot_motors_on_counter > 0) {
+        autopilot_motors_on_counter--;
+        if (autopilot_motors_on_counter == 0)
+          autopilot_motors_on = FALSE;
       }
     }
     else { /* sticks not in the corner */
-      booz2_autopilot_motors_on_counter = BOOZ2_AUTOPILOT_MOTOR_ON_TIME;
+      autopilot_motors_on_counter = AUTOPILOT_MOTOR_ON_TIME;
     }
   }
   else { /* motors off */
     if (THROTTLE_STICK_DOWN() && YAW_STICK_PUSHED()) {
-      if ( booz2_autopilot_motors_on_counter <  BOOZ2_AUTOPILOT_MOTOR_ON_TIME) 
{
-        booz2_autopilot_motors_on_counter++;
-        if (booz2_autopilot_motors_on_counter == BOOZ2_AUTOPILOT_MOTOR_ON_TIME)
-          booz2_autopilot_motors_on = TRUE;
+      if ( autopilot_motors_on_counter <  AUTOPILOT_MOTOR_ON_TIME) {
+        autopilot_motors_on_counter++;
+        if (autopilot_motors_on_counter == AUTOPILOT_MOTOR_ON_TIME)
+          autopilot_motors_on = TRUE;
       }
     }
     else {
-      booz2_autopilot_motors_on_counter = 0;
+      autopilot_motors_on_counter = 0;
     }
   }
 }
 
 
 
-void booz2_autopilot_on_rc_frame(void) {
+void autopilot_on_rc_frame(void) {
 
   uint8_t new_autopilot_mode = 0;
   BOOZ_AP_MODE_OF_PPRZ(radio_control.values[RADIO_CONTROL_MODE], 
new_autopilot_mode);
-  booz2_autopilot_set_mode(new_autopilot_mode);
+  autopilot_set_mode(new_autopilot_mode);
 
 #ifdef RADIO_CONTROL_KILL_SWITCH
   if (radio_control.values[RADIO_CONTROL_KILL_SWITCH] < 0)
-    booz2_autopilot_set_mode(BOOZ2_AP_MODE_KILL);
+    autopilot_set_mode(BOOZ2_AP_MODE_KILL);
 #endif
 
-  booz2_autopilot_check_motors_on();
-  booz2_autopilot_check_in_flight();
-  kill_throttle = !booz2_autopilot_motors_on;
+  autopilot_check_motors_on();
+  autopilot_check_in_flight();
+  kill_throttle = !autopilot_motors_on;
 
-  if (booz2_autopilot_mode > BOOZ2_AP_MODE_FAILSAFE) {
+  if (autopilot_mode > BOOZ2_AP_MODE_FAILSAFE) {
     booz2_guidance_v_read_rc();
-    booz2_guidance_h_read_rc(booz2_autopilot_in_flight);
+    booz2_guidance_h_read_rc(autopilot_in_flight);
   }
 
 }

Modified: paparazzi3/trunk/sw/airborne/firmwares/rotorcraft/autopilot.h
===================================================================
--- paparazzi3/trunk/sw/airborne/firmwares/rotorcraft/autopilot.h       
2010-09-27 22:55:01 UTC (rev 5964)
+++ paparazzi3/trunk/sw/airborne/firmwares/rotorcraft/autopilot.h       
2010-09-27 22:55:12 UTC (rev 5965)
@@ -47,24 +47,24 @@
 #define BOOZ2_AP_MODE_NAV               12
 
 
-extern uint8_t booz2_autopilot_mode;
-extern uint8_t booz2_autopilot_mode_auto2;
-extern bool_t  booz2_autopilot_motors_on;
-extern bool_t  booz2_autopilot_in_flight;
+extern uint8_t autopilot_mode;
+extern uint8_t autopilot_mode_auto2;
+extern bool_t  autopilot_motors_on;
+extern bool_t  autopilot_in_flight;
 extern bool_t kill_throttle;
-extern bool_t booz2_autopilot_rc;
+extern bool_t autopilot_rc;
 
-extern bool_t booz2_autopilot_power_switch;
+extern bool_t autopilot_power_switch;
 
-extern void booz2_autopilot_init(void);
-extern void booz2_autopilot_periodic(void);
-extern void booz2_autopilot_on_rc_frame(void);
-extern void booz2_autopilot_set_mode(uint8_t new_autopilot_mode);
+extern void autopilot_init(void);
+extern void autopilot_periodic(void);
+extern void autopilot_on_rc_frame(void);
+extern void autopilot_set_mode(uint8_t new_autopilot_mode);
 
-extern bool_t booz2_autopilot_detect_ground;
-extern bool_t booz2_autopilot_detect_ground_once;
+extern bool_t autopilot_detect_ground;
+extern bool_t autopilot_detect_ground_once;
 
-extern uint16_t booz2_autopilot_flight_time;
+extern uint16_t autopilot_flight_time;
 
 #ifndef BOOZ2_MODE_MANUAL
 #define BOOZ2_MODE_MANUAL BOOZ2_AP_MODE_RATE_DIRECT
@@ -82,7 +82,7 @@
 
 #define BOOZ_AP_MODE_OF_PPRZ(_rc, _booz_mode) {                                
\
     if      (_rc > TRESHOLD_2_PPRZ)                                    \
-      _booz_mode = booz2_autopilot_mode_auto2;                         \
+      _booz_mode = autopilot_mode_auto2;                               \
     else if (_rc > TRESHOLD_1_PPRZ)                                    \
       _booz_mode = BOOZ2_MODE_AUTO1;                                   \
     else                                                               \
@@ -91,12 +91,12 @@
 
 #define autopilot_KillThrottle(_v) {                           \
     kill_throttle = _v;                                                        
\
-    if (kill_throttle) booz2_autopilot_motors_on = FALSE;                      
        \
-    else booz2_autopilot_motors_on = TRUE; \
+    if (kill_throttle) autopilot_motors_on = FALSE;                            
\
+    else autopilot_motors_on = TRUE; \
   }
 
 #define autopilot_SetPowerSwitch(_v) { \
-  booz2_autopilot_power_switch = _v; \
+  autopilot_power_switch = _v; \
   if (_v) { LED_OFF(POWER_SWITCH_LED); } \
   else { LED_ON(POWER_SWITCH_LED); } \
 }
@@ -105,11 +105,11 @@
 #define TRESHOLD_GROUND_DETECT ACCEL_BFP_OF_REAL(15.)
 #endif
 static inline void BoozDetectGroundEvent(void) {
-  if (booz2_autopilot_mode == BOOZ2_AP_MODE_FAILSAFE || 
booz2_autopilot_detect_ground_once) {
+  if (autopilot_mode == BOOZ2_AP_MODE_FAILSAFE || 
autopilot_detect_ground_once) {
     if (booz_ins_ltp_accel.z < -TRESHOLD_GROUND_DETECT ||
         booz_ins_ltp_accel.z > TRESHOLD_GROUND_DETECT) {
-      booz2_autopilot_detect_ground = TRUE;
-      booz2_autopilot_detect_ground_once = FALSE;
+      autopilot_detect_ground = TRUE;
+      autopilot_detect_ground_once = FALSE;
     }
   }
 }

Modified: paparazzi3/trunk/sw/airborne/firmwares/rotorcraft/main.c
===================================================================
--- paparazzi3/trunk/sw/airborne/firmwares/rotorcraft/main.c    2010-09-27 
22:55:01 UTC (rev 5964)
+++ paparazzi3/trunk/sw/airborne/firmwares/rotorcraft/main.c    2010-09-27 
22:55:12 UTC (rev 5965)
@@ -113,7 +113,7 @@
   booz_imu_init();
 
   booz_fms_init();
-  booz2_autopilot_init();
+  autopilot_init();
   booz2_nav_init();
   booz2_guidance_h_init();
   booz2_guidance_v_init();
@@ -140,17 +140,17 @@
   booz_imu_periodic();
 
   /* run control loops */
-  booz2_autopilot_periodic();
+  autopilot_periodic();
   /* set actuators     */
-  actuators_set(booz2_autopilot_motors_on);
+  actuators_set(autopilot_motors_on);
 
   PeriodicPrescaleBy10(                                                        
\
     {                                                                  \
       radio_control_periodic();                                                
\
       if (radio_control.status != RADIO_CONTROL_OK &&                  \
-          booz2_autopilot_mode != BOOZ2_AP_MODE_KILL &&                        
\
-          booz2_autopilot_mode != BOOZ2_AP_MODE_NAV)                   \
-        booz2_autopilot_set_mode(BOOZ2_AP_MODE_FAILSAFE);              \
+          autopilot_mode != BOOZ2_AP_MODE_KILL &&                      \
+          autopilot_mode != BOOZ2_AP_MODE_NAV)                 \
+        autopilot_set_mode(BOOZ2_AP_MODE_FAILSAFE);            \
     },                                                                 \
     {                                                                  \
       booz_fms_periodic();                                             \
@@ -174,8 +174,8 @@
   
 #ifdef USE_GPS
   if (radio_control.status != RADIO_CONTROL_OK &&                      \
-      booz2_autopilot_mode == BOOZ2_AP_MODE_NAV && GpsIsLost())                
\
-    booz2_autopilot_set_mode(BOOZ2_AP_MODE_FAILSAFE);                  \
+      autopilot_mode == BOOZ2_AP_MODE_NAV && GpsIsLost())              \
+    autopilot_set_mode(BOOZ2_AP_MODE_FAILSAFE);                        \
   booz_gps_periodic();
 #endif
 
@@ -185,8 +185,8 @@
 
   modules_periodic_task();
 
-  if (booz2_autopilot_in_flight) {
-    RunOnceEvery(512, { booz2_autopilot_flight_time++; datalink_time++; });
+  if (autopilot_in_flight) {
+    RunOnceEvery(512, { autopilot_flight_time++; datalink_time++; });
   }
 
 }
@@ -195,8 +195,8 @@
 
   DatalinkEvent();
 
-  if (booz2_autopilot_rc) {
-    RadioControlEvent(booz2_autopilot_on_rc_frame);
+  if (autopilot_rc) {
+    RadioControlEvent(autopilot_on_rc_frame);
   }
 
   BoozImuEvent(on_gyro_accel_event, on_mag_event);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]