removed old take off landing hack

This commit is contained in:
Felix Ruess
2009-08-14 17:04:34 +00:00
parent 4c4c86db6f
commit a6afcdb250
4 changed files with 27 additions and 49 deletions
+1 -2
View File
@@ -5,8 +5,7 @@
<dl_settings NAME="Misc">
<dl_setting var="telemetry_mode_Main" min="0" step="1" max="11" module="booz2_telemetry" shortname="telemetry" values="Default|PPM|Raw sensors|Scaled sensors|AHRS|Rate loop|Att loop|Vert loop|H loop|Aligner|HS_att_roll|Tune_hover"/>
<dl_setting var="booz2_autopilot_mode_auto2" min="0" step="1" max="12" module="booz2_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="booz2_autopilot_tol" min="0" step="1" max="2" module="booz2_autopilot" shortname="tol" values="RIEN|TO|LA" handler="SetTol"/>
<dl_setting var="booz2_autopilot_mode_auto2" min="0" step="1" max="12" module="booz2_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_settings>
<dl_settings NAME="Rate Loop">
+13 -15
View File
@@ -1,6 +1,6 @@
/*
* $Id$
*
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* This file is part of paparazzi.
@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* Boston, MA 02111-1307, USA.
*
*/
@@ -34,7 +34,6 @@ uint8_t booz2_autopilot_mode;
uint8_t booz2_autopilot_mode_auto2;
bool_t booz2_autopilot_motors_on;
bool_t booz2_autopilot_in_flight;
uint8_t booz2_autopilot_tol;
uint32_t booz2_autopilot_motors_on_counter;
uint32_t booz2_autopilot_in_flight_counter;
bool_t kill_throttle;
@@ -54,7 +53,6 @@ void booz2_autopilot_init(void) {
booz2_autopilot_motors_on_counter = 0;
booz2_autopilot_in_flight_counter = 0;
booz2_autopilot_mode_auto2 = BOOZ2_MODE_AUTO2;
booz2_autopilot_tol = 0;
booz2_autopilot_detect_ground = FALSE;
}
@@ -66,7 +64,7 @@ void booz2_autopilot_init(void) {
#endif
void booz2_autopilot_periodic(void) {
RunOnceEvery(50, nav_periodic_task_10Hz());
#ifdef BOOZ_FAILSAFE_GROUND_DETECT
if (booz2_autopilot_mode == BOOZ2_AP_MODE_FAILSAFE && booz2_autopilot_detect_ground) {
@@ -79,13 +77,13 @@ void booz2_autopilot_periodic(void) {
booz2_autopilot_mode == BOOZ2_AP_MODE_FAILSAFE ||
#endif
booz2_autopilot_mode == BOOZ2_AP_MODE_KILL ) {
SetCommands(booz2_commands_failsafe,
SetCommands(booz2_commands_failsafe,
booz2_autopilot_in_flight, booz2_autopilot_motors_on);
}
else {
booz2_guidance_v_run( booz2_autopilot_in_flight );
booz2_guidance_h_run( booz2_autopilot_in_flight );
SetCommands(booz_stabilization_cmd,
SetCommands(booz_stabilization_cmd,
booz2_autopilot_in_flight, booz2_autopilot_motors_on);
}
@@ -160,8 +158,8 @@ void booz2_autopilot_set_mode(uint8_t new_autopilot_mode) {
break;
}
booz2_autopilot_mode = new_autopilot_mode;
}
}
}
#define THROTTLE_STICK_DOWN() \
@@ -234,25 +232,25 @@ void booz2_autopilot_on_rc_frame(void) {
DOWNLINK_SEND_BOOZ_DEBUG(&rc_values[RADIO_THROTTLE], \
&rc_values[RADIO_ROLL], \
&rc_values[RADIO_PITCH], \
&rc_values[RADIO_YAW]);
&rc_values[RADIO_YAW]);
#endif
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);
#ifdef RADIO_CONTROL_KILL_SWITCH
if (radio_control.values[RADIO_CONTROL_KILL_SWITCH] < 0)
booz2_autopilot_set_mode(BOOZ2_AP_MODE_KILL);
#endif
BOOZ2_AUTOPILOT_CHECK_MOTORS_ON();
BOOZ2_AUTOPILOT_CHECK_IN_FLIGHT();
kill_throttle = !booz2_autopilot_motors_on;
if (booz2_autopilot_mode > BOOZ2_AP_MODE_FAILSAFE) {
booz2_guidance_v_read_rc();
booz2_guidance_h_read_rc(booz2_autopilot_in_flight);
}
}
+2 -19
View File
@@ -1,6 +1,6 @@
/*
* $Id$
*
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* This file is part of paparazzi.
@@ -18,7 +18,7 @@
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* Boston, MA 02111-1307, USA.
*
*/
@@ -48,7 +48,6 @@ 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 booz2_autopilot_tol;
extern bool_t kill_throttle;
extern void booz2_autopilot_init(void);
@@ -84,22 +83,6 @@ extern bool_t booz2_autopilot_detect_ground;
}
#define booz2_autopilot_SetTol(_v) { \
booz2_autopilot_tol = _v; \
if (_v == 1) { \
booz_ins_vff_realign = TRUE; \
booz2_guidance_v_z_sp = -POS_BFP_OF_REAL(2); \
booz2_autopilot_mode_auto2 = BOOZ2_AP_MODE_ATTITUDE_Z_HOLD; \
booz2_autopilot_set_mode(booz2_autopilot_mode_auto2); \
} \
if (_v == 2) { \
booz2_guidance_v_zd_sp = SPEED_BFP_OF_REAL(0.5); \
booz2_autopilot_mode_auto2 = BOOZ2_AP_MODE_ATTITUDE_CLIMB; \
booz2_autopilot_set_mode(booz2_autopilot_mode_auto2); \
} \
booz2_autopilot_tol = 0; \
}
#define TRESHOLD_GROUND_DETECT ACCEL_BFP_OF_REAL(15.)
#define BoozDetectGroundEvent() { \
+11 -13
View File
@@ -16,7 +16,7 @@
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
* Boston, MA 02111-1307, USA.
*
*/
@@ -34,7 +34,7 @@
#include "string.h"
#include "booz_radio_control.h"
#include "mercury_supervision.h"
#include "actuators.h"
#include "actuators.h"
#include "props_csc.h"
#include "csc_booz2_guidance_v.h"
@@ -48,7 +48,6 @@ uint8_t booz2_autopilot_mode;
uint8_t booz2_autopilot_mode_auto2;
bool_t booz2_autopilot_motors_on;
bool_t booz2_autopilot_in_flight;
uint8_t booz2_autopilot_tol;
uint32_t booz2_autopilot_motors_on_counter;
uint32_t booz2_autopilot_in_flight_counter;
@@ -71,7 +70,6 @@ void csc_ap_init(void) {
booz2_autopilot_motors_on_counter = 0;
booz2_autopilot_in_flight_counter = 0;
booz2_autopilot_mode_auto2 = BOOZ2_MODE_AUTO2;
booz2_autopilot_tol = 0;
props_throttle_pass = 0;
for(uint8_t i = 0; i < PROPS_NB; i++){
@@ -153,14 +151,14 @@ void csc_ap_periodic(uint8_t _in_flight, uint8_t kill) {
booz_stabilization_attitude_read_rc(booz2_autopilot_in_flight);
booz_stabilization_attitude_run(booz2_autopilot_in_flight);
booz2_guidance_v_run(booz2_autopilot_in_flight);
booz_stabilization_cmd[COMMAND_THRUST] = (int32_t)radio_control.values[RADIO_CONTROL_THROTTLE] * 105 / 7200 + 95;
CscSetCommands(booz_stabilization_cmd,
booz2_autopilot_in_flight,booz2_autopilot_motors_on);
BOOZ2_SUPERVISION_RUN(mixed_commands, commands, booz2_autopilot_motors_on);
@@ -168,7 +166,7 @@ void csc_ap_periodic(uint8_t _in_flight, uint8_t kill) {
Bound(booz_stabilization_cmd[COMMAND_THRUST],0,255);
for(uint8_t i = 0; i < PROPS_NB; i++)
mixed_commands[i] = booz_stabilization_cmd[COMMAND_THRUST];
}
for(uint8_t i = 0; i < PROPS_NB; i++){
@@ -179,13 +177,13 @@ void csc_ap_periodic(uint8_t _in_flight, uint8_t kill) {
}
props_commit();
MERCURY_SURFACES_SUPERVISION_RUN(Actuator,
booz_stabilization_cmd,
mixed_commands,
(!booz2_autopilot_in_flight));
ActuatorsCommit();
SendCscFromActuators();
}