mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-01 21:07:40 +08:00
Handling of gorrazopteres while compiling
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
<airframe name="Gorazoptere_brushless_3DMG" ctl_board="V1_2_1" gps="SAM_LS">
|
||||
<section name="imu" prefix="IMU_">
|
||||
<define name="TYPE_3DMG" value="1"/>
|
||||
<section name="IMU_3DMG" prefix="IMU_">
|
||||
</section>
|
||||
<section name="rate_loop">
|
||||
<define name="ROLL_DOT_PGAIN" value="-192."/>
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
<airframe name="Gorazoptere_brushless_ANALOG" ctl_board="V1_2_1" gps="SAM_LS">
|
||||
<section name="imu" prefix="IMU_">
|
||||
<define name="TYPE_ANALOG" value="1"/>
|
||||
<section name="IMU_ANALOG" prefix="IMU_">
|
||||
<define name="ADC_ROLL_DOT" value="1"/>
|
||||
<define name="ADC_PITCH_DOT" value="2"/>
|
||||
<define name="ADC_YAW_DOT" value="3"/>
|
||||
</section>
|
||||
<section name="rate_loop">
|
||||
<section name="RATE_LOOP">
|
||||
<define name="ROLL_DOT_PGAIN" value="-192."/>
|
||||
<define name="ROLL_DOT_IGAIN" value="0."/>
|
||||
<define name="ROLL_DOT_DGAIN" value="0."/>
|
||||
|
||||
@@ -70,15 +70,6 @@ extern uint8_t ir_estim_mode;
|
||||
#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)
|
||||
|
||||
extern uint8_t fatal_error_nb;
|
||||
|
||||
@@ -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 <avr/interrupt.h>
|
||||
@@ -138,3 +166,5 @@ static inline void on_3dmg_receive(uint8_t c) {
|
||||
|
||||
|
||||
ReceiveUart(on_3dmg_receive);
|
||||
|
||||
#endif // IMU_3DMG
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
void _3dmg_capture_gyro_bias ( void );
|
||||
void _3dmg_set_continuous_mode ( void );
|
||||
void _3dmg_capture_neutral ( void );
|
||||
|
||||
extern volatile bool_t _3dmg_data_ready;
|
||||
extern int16_t _3dmg_roll, _3dmg_pitch, _3dmg_yaw;
|
||||
extern int16_t _3dmg_roll_dot, _3dmg_pitch_dot, _3dmg_yaw_dot;
|
||||
|
||||
@@ -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"
|
||||
|
||||
/* WARNING : taken from ../autopilot/autopilot.h */
|
||||
#define TRIM_PPRZ(pprz) (pprz < MIN_PPRZ ? MIN_PPRZ : \
|
||||
(pprz > MAX_PPRZ ? MAX_PPRZ : \
|
||||
pprz))
|
||||
#ifdef SECTION_RATE_LOOP
|
||||
#warning "Compiling control.c"
|
||||
|
||||
#include "control.h"
|
||||
#include "imu.h"
|
||||
|
||||
|
||||
int16_t desired_roll_dot;
|
||||
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_throttle = values[RADIO_THROTTLE];
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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"
|
||||
|
||||
#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;
|
||||
|
||||
#ifdef IMU_TYPE_3DMG
|
||||
#ifdef SECTION_IMU_3DMG
|
||||
#warning "Compiling imu.c for 3DMG"
|
||||
#include "3dmg.h"
|
||||
int16_t roll, pitch, yaw;
|
||||
|
||||
@@ -26,9 +55,10 @@ void imu_capture_neutral ( void ) {
|
||||
_3dmg_capture_neutral();
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // 3DMG
|
||||
|
||||
#ifdef IMU_TYPE_ANALOG
|
||||
#ifdef SECTION_IMU_ANALOG
|
||||
#warning "Compiling imu.c for ANALOG"
|
||||
#include "adc_fbw.h"
|
||||
|
||||
struct adc_buf buf_roll_dot;
|
||||
@@ -64,4 +94,5 @@ void imu_capture_neutral ( void ) {
|
||||
raw_yaw_dot_neutral = raw_yaw_dot;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // ANALOG
|
||||
|
||||
|
||||
@@ -40,6 +40,13 @@ typedef int16_t pprz_t; // type of commands
|
||||
/* !!!!!!!!!!!!!!!!!!! Value used in gen_airframe.ml !!!!!!!!!!!!!!!!! */
|
||||
#define MAX_PPRZ (600 * CLOCK)
|
||||
#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 {
|
||||
pprz_t channels[RADIO_CTL_NB];
|
||||
|
||||
@@ -106,6 +106,7 @@ let parse_section = fun s ->
|
||||
match Xml.tag s with
|
||||
"section" ->
|
||||
let prefix = ExtXml.attrib_or_default s "prefix" "" in
|
||||
define ("SECTION_"^ExtXml.attrib s "name") "1";
|
||||
List.iter (parse_element prefix) (Xml.children s);
|
||||
nl ()
|
||||
| "servos" ->
|
||||
|
||||
Reference in New Issue
Block a user