*** empty log message ***

This commit is contained in:
Pascal Brisset
2007-09-13 12:18:08 +00:00
parent de3bdd57f3
commit ca455c7e05
6 changed files with 269 additions and 4 deletions
+68
View File
@@ -0,0 +1,68 @@
<airframe name="Twisted Logic">
<!-- tiny airframe -->
<!-- commands section -->
<servos>
<servo name="AILERON" no="2" min="900" neutral="1500" max="2100"/>
<servo name="ELEVATOR" no="1" min="900" neutral="1500" max="2100"/>
<servo name="MOTOR_RIGHT" no="6" min="1250" neutral="1250" max="1850"/>
<servo name="MOTOR_LEFT" no="3" min="1250" neutral="1250" max="1850"/>
</servos>
<commands>
<axis name="THROTTLE" failsafe_value="0"/>
<axis name="ROLL" failsafe_value="0"/>
<axis name="PITCH" failsafe_value="0"/>
<axis name="YAW" failsafe_value="0"/>
</commands>
<rc_commands>
<set command="THROTTLE" value="@THROTTLE"/>
<set command="ROLL" value="@ROLL"/>
<set command="PITCH" value="@PITCH"/>
<set command="YAW" value="@YAW"/>
</rc_commands>
<section name="MIXER">
<define name="AILEVON_AILERON_RATE" value="0.8"/>
<define name="AILEVON_ELEVATOR_RATE" value="0.8"/>
</section>
<command_laws>
<let var="roll" value="1.0 * @ROLL"/>
<let var="yawtoroll" value="0.0001 * @YAW"/>
<let var="pitchtoroll" value="0.0001 * @PITCH"/>
<let var="pitch" value="1.0 * @PITCH"/>
<let var="yaw" value="0.1 * @YAW"/>
<let var="throttle" value="1.0 * @THROTTLE"/>
<set servo="AILERON" value="$roll"/>
<set servo="ELEVATOR" value="$pitch"/>
<set servo="MOTOR_LEFT" value="$throttle - $yaw - .06*$throttle"/> <!-- add trim term for Right -->
<set servo="MOTOR_RIGHT" value="$throttle + $yaw + .06*$throttle"/> <!-- subtract trim term for Right -->
</command_laws>
<makefile>
include $(PAPARAZZI_SRC)/conf/autopilot/tiny.makefile
FLASH_MODE=IAP
ap.CFLAGS += -DFBW -DAP -DCONFIG=\"tiny_1_1.h\" -DLED -DTIME_LED=1
ap.srcs = sys_time.c $(SRC_ARCH)/sys_time_hw.c $(SRC_ARCH)/armVIC.c main_fbw.c main_coax.c main.c
ap.CFLAGS += -DACTUATORS=\"servos_4015_MAT_hw.h\" -DSERVOS_4015_MAT
ap.srcs += $(SRC_ARCH)/servos_4015_MAT_hw.c actuators.c commands.c
ap.CFLAGS += -DRADIO_CONTROL -DRADIO_CONTROL_TYPE=RC_FUTABA
ap.srcs += radio_control.c $(SRC_ARCH)/ppm_hw.c
ap.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=PprzTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DPPRZ_UART=Uart0 -DDATALINK=PPRZ -DUART0_BAUD=B19200
ap.srcs += downlink.c $(SRC_ARCH)/uart_hw.c datalink.c pprz_transport.c
ap.CFLAGS += -DUSE_SPI -DSPI_MASTER -DUSE_SPI_SLAVE0 -DUSE_BARO_MS5534A
ap.srcs += spi.c $(SRC_ARCH)/spi_hw.c $(SRC_ARCH)/baro_MS5534A.c
ap.CFLAGS += -DALT_KALMAN
ap.srcs += estimator.c
</makefile>
</airframe>
+8
View File
@@ -0,0 +1,8 @@
<!DOCTYPE settings SYSTEM "settings.dtd">
<!-- A conf to use for standard operation (no tuning) -->
<settings>
<dl_settings>
</dl_settings>
</settings>
+4 -4
View File
@@ -8,9 +8,9 @@ Standards-Version: 3.6.1
Package: paparazzi-dev
Architecture: any
Suggests: mlview, lustre, paparazzi-avr, paparazzi-arm
Suggests: paparazzi-avr, paparazzi-arm7
Recommends: eagle, gs-common, tetex-extra, dia-gnome
Depends: ivy-c-dev, ivy-c, ivy-perl, ivy-ocaml, xml-light-ocaml, liblablgtk2-ocaml-dev, make, gcc, boa, gnuplot, libgnomecanvas2-dev, libxml-dom-perl, libsubject-perl, libfile-ncopy-perl, libpcre3-dev, bzip2, libexpect-perl, cvs, liblablgl-ocaml-dev, liblablgtk2-gl-ocaml-dev, liblablgtk2-gnome-ocaml-dev, libcamlimages-ocaml-dev, libusb-dev
Depends: ivy-c-dev, ivy-c, ivy-ocaml, xml-light-ocaml, liblablgtk2-ocaml-dev, make, gcc, boa, gnuplot, libgnomecanvas2-dev, bzip2, cvs, liblablgl-ocaml-dev, liblablgtk2-gl-ocaml-dev, liblablgtk2-gnome-ocaml-dev, libcamlimages-ocaml-dev, libusb-dev, speech-dispatcher, glade, gedit, imagemagick
Description: Paparazzi Meta Package : common support
@@ -22,12 +22,12 @@ Description: Paparazzi Meta Package. Atmel AVR support
Package: paparazzi-arm7
Architecture: any
Depends: lpc21isp, gcc-arm, binutils-arm, newlib-arm, libusb-dev
Depends: lpc21isp, gcc-arm, binutils-arm, libusb-dev
Description: Paparazzi Meta Package. Philips ARM7 support
Package: paparazzi-bin
Architecture: i386
Depends: ivy-c-dev, ivy-c, ivy-perl, ivy-ocaml, xml-light-ocaml, liblablgtk2-ocaml-dev, make, gcc, boa, gnuplot, libxml-dom-perl, libsubject-perl, libfile-ncopy-perl, libpcre3-dev, bzip2, libexpect-perl
Depends: ivy-c-dev, ivy-c, ivy-ocaml, xml-light-ocaml, liblablgtk2-ocaml-dev, make, gcc, boa, gnuplot, bzip2, liblablgtk2-gnome-ocaml-dev, speech-dispatcher, gedit, imagemagick
Description: Paparazzi main package
+93
View File
@@ -0,0 +1,93 @@
#include "std.h"
#include "init_hw.h"
#include "sys_time.h"
#include "led.h"
#include "interrupt_hw.h"
#include "uart.h"
#include "main_ap.h"
#include "airframe.h"
#include "messages.h"
#include "downlink.h"
#include "spi.h"
#include "baro_MS5534A.h"
#include "estimator.h"
float ground_alt;
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
static bool_t dl_msg_available;
static inline void main_dl_parse_msg( void );
void init_ap( void ) {
/** init done in main_fbw */
spi_init();
baro_MS5534A_init();
int_enable();
baro_MS5534A_init();
}
void periodic_task_ap( void ) {
// LED_TOGGLE(1);
// DOWNLINK_SEND_TAKEOFF(&cpu_time_sec);
static uint8_t _20Hz = 0;
_20Hz++;
if (_20Hz>=3) _20Hz=0;
if (!_20Hz) {
baro_MS5534A_send();
}
}
void event_task_ap( void ) {
if (PprzBuffer()) {
ReadPprzBuffer();
if (pprz_msg_received) {
pprz_parse_payload();
pprz_msg_received = FALSE;
}
}
if (dl_msg_available) {
main_dl_parse_msg();
dl_msg_available = FALSE;
LED_TOGGLE(1);
}
if (spi_message_received) {
/* Got a message on SPI. */
spi_message_received = FALSE;
baro_MS5534A_event_task();
if (baro_MS5534A_available) {
baro_MS5534A_available = FALSE;
baro_MS5534A_z = ground_alt +((float)baro_MS5534A_ground_pressure - baro_MS5534A_pressure)*0.084;
if (alt_baro_enabled) {
EstimatorSetAlt(baro_MS5534A_z);
}
}
}
}
#define MSG_SIZE 128
uint8_t dl_buffer[MSG_SIZE] __attribute__ ((aligned));
#include "settings.h"
#define IdOfMsg(x) (x[1])
static inline void main_dl_parse_msg(void) {
uint8_t msg_id = IdOfMsg(dl_buffer);
if (msg_id == DL_SETTING) {
uint8_t i = DL_SETTING_index(dl_buffer);
float var = DL_SETTING_value(dl_buffer);
DlSetting(i, var);
DOWNLINK_SEND_DL_VALUE(&i, &var);
}
}
+59
View File
@@ -0,0 +1,59 @@
/*
* $Id$
*
* Copyright (C) 2007 ENAC
*
* 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.
*
*/
/** \file baro_MS5534A.h
* \brief Handling of the MS5534a pressure sensor
*
*/
#ifndef BARO_MS5534A_H
#define BARO_MS5534A_H
#include "std.h"
#ifdef USE_BARO_MS5534A
extern bool_t spi_message_received;
extern bool_t baro_MS5534A_available;
extern uint32_t baro_MS5534A_pressure;
extern uint16_t baro_MS5534A_temp;
extern bool_t alt_baro_enabled;
extern uint32_t baro_MS5534A_ground_pressure;
extern float baro_MS5534A_r;
extern float baro_MS5534A_sigma2;
extern float baro_MS5534A_z;
void baro_MS5534A_init(void);
void baro_MS5534A_reset(void);
/* To be called not faster than 30Hz */
void baro_MS5534A_send(void);
/* Set baro_MS5534A_available when pressure and temp are readable */
void baro_MS5534A_event_task( void );
#endif // USE_BARO_MS5534A
#endif // BARO_MS5534A_H
+37
View File
@@ -0,0 +1,37 @@
#include <stdlib.h>
#include "estimator.h"
#include "nav.h"
#include "gps.h"
#include "baro_MS5534A.h"
bool_t alt_baro_enabled;
bool_t spi_message_received;
bool_t baro_MS5534A_available;
uint32_t baro_MS5534A_pressure;
uint32_t baro_MS5534A_ground_pressure;
uint16_t baro_MS5534A_temp;
float baro_MS5534A_r;
float baro_MS5534A_sigma2;
float baro_MS5534A_z;
void baro_MS5534A_init(void) {
baro_MS5534A_ground_pressure = 100000;
baro_MS5534A_r = 10.;
baro_MS5534A_sigma2 = 1;
}
// void baro_MS5534A_reset(void);
void baro_MS5534A_send(void) {
static bool_t even = FALSE;
even = !even;
spi_message_received = even;
}
void baro_MS5534A_event_task( void ) {
baro_MS5534A_pressure = baro_MS5534A_ground_pressure - (gps_alt/100.-ground_alt) / 0.08 + ((10.*random()) / RAND_MAX);
baro_MS5534A_temp = 10 + estimator_z;
baro_MS5534A_available = TRUE;
}