Handling of gorrazopteres while compiling

This commit is contained in:
Pascal Brisset
2005-08-22 15:49:49 +00:00
parent 925d04fb01
commit a0a7f2efd5
9 changed files with 111 additions and 25 deletions
@@ -1,6 +1,5 @@
<airframe name="Gorazoptere_brushless_3DMG" ctl_board="V1_2_1" gps="SAM_LS"> <airframe name="Gorazoptere_brushless_3DMG" ctl_board="V1_2_1" gps="SAM_LS">
<section name="imu" prefix="IMU_"> <section name="IMU_3DMG" prefix="IMU_">
<define name="TYPE_3DMG" value="1"/>
</section> </section>
<section name="rate_loop"> <section name="rate_loop">
<define name="ROLL_DOT_PGAIN" value="-192."/> <define name="ROLL_DOT_PGAIN" value="-192."/>
@@ -1,11 +1,10 @@
<airframe name="Gorazoptere_brushless_ANALOG" ctl_board="V1_2_1" gps="SAM_LS"> <airframe name="Gorazoptere_brushless_ANALOG" ctl_board="V1_2_1" gps="SAM_LS">
<section name="imu" prefix="IMU_"> <section name="IMU_ANALOG" prefix="IMU_">
<define name="TYPE_ANALOG" value="1"/>
<define name="ADC_ROLL_DOT" value="1"/> <define name="ADC_ROLL_DOT" value="1"/>
<define name="ADC_PITCH_DOT" value="2"/> <define name="ADC_PITCH_DOT" value="2"/>
<define name="ADC_YAW_DOT" value="3"/> <define name="ADC_YAW_DOT" value="3"/>
</section> </section>
<section name="rate_loop"> <section name="RATE_LOOP">
<define name="ROLL_DOT_PGAIN" value="-192."/> <define name="ROLL_DOT_PGAIN" value="-192."/>
<define name="ROLL_DOT_IGAIN" value="0."/> <define name="ROLL_DOT_IGAIN" value="0."/>
<define name="ROLL_DOT_DGAIN" value="0."/> <define name="ROLL_DOT_DGAIN" value="0."/>
-9
View File
@@ -70,15 +70,6 @@ extern uint8_t ir_estim_mode;
#define STICK_PUSHED(pprz) (pprz < TRESHOLD1 || pprz > TRESHOLD2) #define STICK_PUSHED(pprz) (pprz < TRESHOLD1 || pprz > TRESHOLD2)
#define TRIM_PPRZ(pprz) (pprz < MIN_PPRZ ? MIN_PPRZ : \
(pprz > MAX_PPRZ ? MAX_PPRZ : \
pprz))
#define TRIM_UPPRZ(pprz) (pprz < 0 ? 0 : \
(pprz > MAX_PPRZ ? MAX_PPRZ : \
pprz))
#define FLOAT_OF_PPRZ(pprz, center, travel) ((float)pprz / (float)MAX_PPRZ * travel + center) #define FLOAT_OF_PPRZ(pprz, center, travel) ((float)pprz / (float)MAX_PPRZ * travel + center)
extern uint8_t fatal_error_nb; extern uint8_t fatal_error_nb;
+30
View File
@@ -1,4 +1,32 @@
/*
* Paparazzi $Id$
*
* Copyright (C) 2005 Pascal Brisset, Antoine Drouin
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.
*
*/
#include "airframe.h"
#ifdef SECTION_IMU_3DMG
#warning "Compiling 3dmg.c"
#include "std.h" #include "std.h"
#include <avr/interrupt.h> #include <avr/interrupt.h>
@@ -138,3 +166,5 @@ static inline void on_3dmg_receive(uint8_t c) {
ReceiveUart(on_3dmg_receive); ReceiveUart(on_3dmg_receive);
#endif // IMU_3DMG
+2
View File
@@ -6,6 +6,8 @@
void _3dmg_capture_gyro_bias ( void ); void _3dmg_capture_gyro_bias ( void );
void _3dmg_set_continuous_mode ( void ); void _3dmg_set_continuous_mode ( void );
void _3dmg_capture_neutral ( void );
extern volatile bool_t _3dmg_data_ready; extern volatile bool_t _3dmg_data_ready;
extern int16_t _3dmg_roll, _3dmg_pitch, _3dmg_yaw; extern int16_t _3dmg_roll, _3dmg_pitch, _3dmg_yaw;
extern int16_t _3dmg_roll_dot, _3dmg_pitch_dot, _3dmg_yaw_dot; extern int16_t _3dmg_roll_dot, _3dmg_pitch_dot, _3dmg_yaw_dot;
+32 -6
View File
@@ -1,11 +1,35 @@
#include "control.h" /*
#include "imu.h" * Paparazzi $Id$
*
* Copyright (C) 2005 Pascal Brisset, Antoine Drouin
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.
*
*/
#include "airframe.h" #include "airframe.h"
/* WARNING : taken from ../autopilot/autopilot.h */ #ifdef SECTION_RATE_LOOP
#define TRIM_PPRZ(pprz) (pprz < MIN_PPRZ ? MIN_PPRZ : \ #warning "Compiling control.c"
(pprz > MAX_PPRZ ? MAX_PPRZ : \
pprz)) #include "control.h"
#include "imu.h"
int16_t desired_roll_dot; int16_t desired_roll_dot;
float roll_dot_pgain = ROLL_DOT_PGAIN; float roll_dot_pgain = ROLL_DOT_PGAIN;
@@ -73,3 +97,5 @@ void control_set_desired ( const pprz_t values[] ) {
desired_yaw_dot = DESIRED_OF_RADIO_YAW_DOT*values[RADIO_YAW]; desired_yaw_dot = DESIRED_OF_RADIO_YAW_DOT*values[RADIO_YAW];
desired_throttle = values[RADIO_THROTTLE]; desired_throttle = values[RADIO_THROTTLE];
} }
#endif
+36 -5
View File
@@ -1,10 +1,39 @@
#include "imu.h" /*
* Paparazzi $Id$
*
* Copyright (C) 2005 Pascal Brisset, Antoine Drouin
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* 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.
*
*/
#include "airframe.h" #include "airframe.h"
#if defined(SECTION_IMU_3DMG) && defined(SECTION_IMU_ANALOG)
#error "IMU_3DMG and IMU_ANALOG cannot be defined simultaneously
#endif
#include "imu.h"
int16_t roll_dot, pitch_dot, yaw_dot; int16_t roll_dot, pitch_dot, yaw_dot;
#ifdef IMU_TYPE_3DMG #ifdef SECTION_IMU_3DMG
#warning "Compiling imu.c for 3DMG"
#include "3dmg.h" #include "3dmg.h"
int16_t roll, pitch, yaw; int16_t roll, pitch, yaw;
@@ -26,9 +55,10 @@ void imu_capture_neutral ( void ) {
_3dmg_capture_neutral(); _3dmg_capture_neutral();
} }
#endif #endif // 3DMG
#ifdef IMU_TYPE_ANALOG #ifdef SECTION_IMU_ANALOG
#warning "Compiling imu.c for ANALOG"
#include "adc_fbw.h" #include "adc_fbw.h"
struct adc_buf buf_roll_dot; struct adc_buf buf_roll_dot;
@@ -64,4 +94,5 @@ void imu_capture_neutral ( void ) {
raw_yaw_dot_neutral = raw_yaw_dot; raw_yaw_dot_neutral = raw_yaw_dot;
} }
#endif #endif // ANALOG
+7
View File
@@ -40,6 +40,13 @@ typedef int16_t pprz_t; // type of commands
/* !!!!!!!!!!!!!!!!!!! Value used in gen_airframe.ml !!!!!!!!!!!!!!!!! */ /* !!!!!!!!!!!!!!!!!!! Value used in gen_airframe.ml !!!!!!!!!!!!!!!!! */
#define MAX_PPRZ (600 * CLOCK) #define MAX_PPRZ (600 * CLOCK)
#define MIN_PPRZ -MAX_PPRZ #define MIN_PPRZ -MAX_PPRZ
#define TRIM_PPRZ(pprz) (pprz < MIN_PPRZ ? MIN_PPRZ : \
(pprz > MAX_PPRZ ? MAX_PPRZ : \
pprz))
#define TRIM_UPPRZ(pprz) (pprz < 0 ? 0 : \
(pprz > MAX_PPRZ ? MAX_PPRZ : \
pprz))
struct inter_mcu_msg { struct inter_mcu_msg {
pprz_t channels[RADIO_CTL_NB]; pprz_t channels[RADIO_CTL_NB];
+1
View File
@@ -106,6 +106,7 @@ let parse_section = fun s ->
match Xml.tag s with match Xml.tag s with
"section" -> "section" ->
let prefix = ExtXml.attrib_or_default s "prefix" "" in let prefix = ExtXml.attrib_or_default s "prefix" "" in
define ("SECTION_"^ExtXml.attrib s "name") "1";
List.iter (parse_element prefix) (Xml.children s); List.iter (parse_element prefix) (Xml.children s);
nl () nl ()
| "servos" -> | "servos" ->