[telemetry] fix some include and remove unnecessary files

This commit is contained in:
Gautier Hattenberger
2013-06-19 18:56:42 +02:00
parent 116faaeda6
commit 09680b07e9
15 changed files with 61 additions and 134 deletions
@@ -78,7 +78,7 @@ nps.srcs += subsystems/settings.c
nps.srcs += $(SRC_ARCH)/subsystems/settings_arch.c
nps.CFLAGS += -DDOWNLINK -DDOWNLINK_TRANSPORT=IvyTransport
nps.srcs += $(SRC_FIRMWARE)/telemetry.c \
nps.srcs += $(SRC_FIRMWARE)/rotorcraft_telemetry.c \
subsystems/datalink/downlink.c \
$(SRC_ARCH)/ivy_transport.c
@@ -11,4 +11,4 @@ ap.CFLAGS += -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD)
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_DEVICE=$(MODEM_PORT) -DPPRZ_UART=$(MODEM_PORT)
ap.CFLAGS += -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ -DDefaultPeriodic='&telemetry_Main'
ap.srcs += subsystems/datalink/downlink.c subsystems/datalink/pprz_transport.c subsystems/datalink/telemetry.c
ap.srcs += $(SRC_FIRMWARE)/datalink.c $(SRC_FIRMWARE)/telemetry.c
ap.srcs += $(SRC_FIRMWARE)/datalink.c $(SRC_FIRMWARE)/rotorcraft_telemetry.c
@@ -5,7 +5,7 @@ ifeq ($(ARCH), lpc21)
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_DEVICE=UsbS -DPPRZ_UART=UsbS
ap.CFLAGS += -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=PPRZ -DUSE_USB_SERIAL -DDefaultPeriodic='&telemetry_Main'
ap.srcs += subsystems/datalink/downlink.c subsystems/datalink/pprz_transport.c subsystems/datalink/telemetry.c
ap.srcs += $(SRC_FIRMWARE)/datalink.c $(SRC_FIRMWARE)/telemetry.c
ap.srcs += $(SRC_FIRMWARE)/datalink.c $(SRC_FIRMWARE)/rotorcraft_telemetry.c
ap.srcs += $(SRC_ARCH)/usb_ser_hw.c $(SRC_ARCH)/lpcusb/usbhw_lpc.c $(SRC_ARCH)/lpcusb/usbcontrol.c
ap.srcs += $(SRC_ARCH)/lpcusb/usbstdreq.c $(SRC_ARCH)/lpcusb/usbinit.c
else
@@ -4,5 +4,5 @@
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_DEVICE=Udp
ap.CFLAGS += -DDOWNLINK_TRANSPORT=PprzTransport -DDATALINK=UDP -DDefaultPeriodic='&telemetry_Main'
ap.srcs += subsystems/datalink/downlink.c subsystems/datalink/udp.c subsystems/datalink/pprz_transport.c subsystems/datalink/telemetry.c
ap.srcs += $(SRC_FIRMWARE)/datalink.c $(SRC_FIRMWARE)/telemetry.c
ap.srcs += $(SRC_FIRMWARE)/datalink.c $(SRC_FIRMWARE)/rotorcraft_telemetry.c
ap.srcs += fms/fms_network.c
@@ -12,4 +12,4 @@ ap.CFLAGS += -D$(MODEM_PORT)_BAUD=$(MODEM_BAUD) -DXBEE_BAUD=$(MODEM_BAUD)
ap.CFLAGS += -DDOWNLINK -DDOWNLINK_DEVICE=$(MODEM_PORT) -DXBEE_UART=$(MODEM_PORT)
ap.CFLAGS += -DDOWNLINK_TRANSPORT=XBeeTransport -DDATALINK=XBEE -DDefaultPeriodic='&telemetry_Main'
ap.srcs += subsystems/datalink/downlink.c subsystems/datalink/xbee.c subsystems/datalink/telemetry.c
ap.srcs += $(SRC_FIRMWARE)/datalink.c $(SRC_FIRMWARE)/telemetry.c
ap.srcs += $(SRC_FIRMWARE)/datalink.c $(SRC_FIRMWARE)/rotorcraft_telemetry.c
+1 -1
View File
@@ -20,9 +20,9 @@
#include "firmwares/fixedwing/guidance/guidance_v.h"
#include "subsystems/commands.h"
#include "firmwares/fixedwing/main_ap.h"
#include "ap_downlink.h"
#include "sim_uart.h"
#include "subsystems/datalink/datalink.h"
#include "subsystems/datalink/telemetry.h"
#include "generated/flight_plan.h"
#include "generated/modules.h"
+1 -1
View File
@@ -29,7 +29,7 @@
#include "firmwares/fixedwing/autopilot.h"
#include "state.h"
#include "firmwares/fixedwing/ap_downlink.h"
#include "subsystems/datalink/telemetry.h"
#include "subsystems/nav.h"
#include "generated/settings.h"
+1 -5
View File
@@ -53,12 +53,8 @@
#include "generated/settings.h"
#include "math/pprz_geodetic_float.h"
#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
#endif
#include "mcu_periph/uart.h"
#include "subsystems/datalink/downlink.h"
#include "ap_downlink.h"
#include "subsystems/datalink/telemetry.h"
#if USE_JOYSTICK
@@ -1,48 +0,0 @@
/*
* Copyright (C) 2006- 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.
*/
/**
* @file firmwares/fixedwing/fbw_downlink.h
*
* Set of macros defining the periodic telemetry messages of FBW process.
*
* The PeriodicSendAp() macro is generated from the telemetry description
* (named in conf.xml, usually in conf/telemetry directory). This macro
* is a sequence of calls to PERIODIC_SEND_message() which have to be defined
* in the present file.
*
*/
#ifndef FBW_DOWNLINK_H
#define FBW_DOWNLINK_H
#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_FBW_DEVICE
#endif
#include "subsystems/datalink/downlink.h"
#include "generated/periodic_telemetry.h"
static inline void fbw_downlink_periodic_task(void) {
periodic_telemetry_send_Fbw();
}
#endif /* FBW_DOWNLINK_H */
+1 -1
View File
@@ -70,10 +70,10 @@
// datalink & telemetry
#include "subsystems/datalink/datalink.h"
#include "subsystems/datalink/telemetry.h"
#include "subsystems/settings.h"
#include "subsystems/datalink/xbee.h"
#include "subsystems/datalink/w5100.h"
#include "firmwares/fixedwing/ap_downlink.h"
// modules & settings
#include "generated/modules.h"
+20 -7
View File
@@ -41,10 +41,13 @@
#include "subsystems/electrical.h"
#include "subsystems/radio_control.h"
#include "firmwares/fixedwing/autopilot.h"
#include "fbw_downlink.h"
#include "paparazzi.h"
#include "mcu_periph/i2c.h"
#if DOWNLINK
#include "subsystems/datalink/telemetry.h"
#endif
#ifdef MCU_SPI_LINK
#include "link_mcu_spi.h"
#endif
@@ -79,6 +82,7 @@ tid_t fbw_periodic_tid; ///< id for periodic_task_fbw() timer
tid_t electrical_tid; ///< id for electrical_periodic() timer
/********** PERIODIC MESSAGES ************************************************/
#if DOWNLINK
static void send_commands(void) {
DOWNLINK_SEND_COMMANDS(DefaultChannel, DefaultDevice, COMMANDS_NB, commands);
}
@@ -107,6 +111,8 @@ static void send_actuators(void) {
}
#endif
#endif
/********** INIT *************************************************************/
void init_fbw( void ) {
@@ -116,19 +122,14 @@ void init_fbw( void ) {
electrical_init();
#endif
register_periodic_telemetry(&telemetry_Fbw, "FBW_STATUS", send_fbw_status);
register_periodic_telemetry(&telemetry_Fbw, "COMMANDS", send_commands);
#ifdef ACTUATORS
actuators_init();
/* Load the failsafe defaults */
SetCommands(commands_failsafe);
fbw_new_actuators = 1;
register_periodic_telemetry(&telemetry_Fbw, "ACTUATORS", send_actuators);
#endif
#ifdef RADIO_CONTROL
radio_control_init();
register_periodic_telemetry(&telemetry_Fbw, "RC", send_rc);
#endif
#ifdef INTER_MCU
inter_mcu_init();
@@ -151,6 +152,18 @@ void init_fbw( void ) {
#ifndef SINGLE_MCU
mcu_int_enable();
#endif
#if DOWNLINK
register_periodic_telemetry(&telemetry_Fbw, "FBW_STATUS", send_fbw_status);
register_periodic_telemetry(&telemetry_Fbw, "COMMANDS", send_commands);
#ifdef ACTUATORS
register_periodic_telemetry(&telemetry_Fbw, "ACTUATORS", send_actuators);
#endif
#ifdef RADIO_CONTROL
register_periodic_telemetry(&telemetry_Fbw, "RC", send_rc);
#endif
#endif
}
@@ -297,7 +310,7 @@ set_failsafe_mode();
#endif
#ifdef DOWNLINK
fbw_downlink_periodic_task();
periodic_telemetry_send_Fbw();
#endif
}
@@ -126,6 +126,27 @@ static void send_href(void) {
&guidance_h_pos_sp.y, &guidance_h_pos_ref.y,
&guidance_h_speed_ref.y, &guidance_h_accel_ref.y);
}
// FIXME no idea where to put this one
//#ifndef AHRS_FLOAT
//#define PERIODIC_SEND_ROTORCRAFT_TUNE_HOVER(DefaultChannel, DefaultDevice) {
// DOWNLINK_SEND_ROTORCRAFT_TUNE_HOVER(DefaultChannel, DefaultDevice,
// &radio_control.values[RADIO_ROLL],
// &radio_control.values[RADIO_PITCH],
// &radio_control.values[RADIO_YAW],
// &stabilization_cmd[COMMAND_ROLL],
// &stabilization_cmd[COMMAND_PITCH],
// &stabilization_cmd[COMMAND_YAW],
// &stabilization_cmd[COMMAND_THRUST],
// &ahrs_impl.ltp_to_imu_euler.phi,
// &ahrs_impl.ltp_to_imu_euler.theta,
// &ahrs_impl.ltp_to_imu_euler.psi,
// &(stateGetNedToBodyEulers_i()->phi),
// &(stateGetNedToBodyEulers_i()->theta),
// &(stateGetNedToBodyEulers_i()->psi));
//}
//#endif
#endif
void guidance_h_init(void) {
@@ -1,53 +0,0 @@
/*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* 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.
*/
#ifndef TELEMETRY_H
#define TELEMETRY_H
#include "std.h"
#include "messages.h"
#include "mcu_periph/uart.h"
#include "subsystems/datalink/downlink.h"
#include "generated/periodic_telemetry.h"
// FIXME no idea where to put this one
//#ifndef AHRS_FLOAT
//#define PERIODIC_SEND_ROTORCRAFT_TUNE_HOVER(DefaultChannel, DefaultDevice) {
// DOWNLINK_SEND_ROTORCRAFT_TUNE_HOVER(DefaultChannel, DefaultDevice,
// &radio_control.values[RADIO_ROLL],
// &radio_control.values[RADIO_PITCH],
// &radio_control.values[RADIO_YAW],
// &stabilization_cmd[COMMAND_ROLL],
// &stabilization_cmd[COMMAND_PITCH],
// &stabilization_cmd[COMMAND_YAW],
// &stabilization_cmd[COMMAND_THRUST],
// &ahrs_impl.ltp_to_imu_euler.phi,
// &ahrs_impl.ltp_to_imu_euler.theta,
// &ahrs_impl.ltp_to_imu_euler.psi,
// &(stateGetNedToBodyEulers_i()->phi),
// &(stateGetNedToBodyEulers_i()->theta),
// &(stateGetNedToBodyEulers_i()->psi));
//}
//#endif
#endif /* TELEMETRY_H */
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2006-2013 Pascal Brisset, Antoine Drouin, Gautier Hattenberger
* Copyright (C) 2013 Gautier Hattenberger
*
* This file is part of paparazzi.
*
@@ -19,23 +19,21 @@
* Boston, MA 02111-1307, USA.
*/
#ifndef TELEMETRY_H
#define TELEMETRY_H
/**
* @file firmwares/fixedwing/ap_downlink.h
* @file subsystems/datalink/telemetry.h
*
* The periodic function is generated from the telemetry xml file.
* Each subsystem of the autopilot can register function that
* will be called if needed.
* Periodic telemetry system header.
*
* include downlink utility and generated code
*/
#ifndef AP_DOWNLINK_H
#define AP_DOWNLINK_H
#ifndef DOWNLINK_DEVICE
#define DOWNLINK_DEVICE DOWNLINK_AP_DEVICE
#endif
#include "std.h"
#include "messages.h"
#include "mcu_periph/uart.h"
#include "subsystems/datalink/downlink.h"
#include "generated/periodic_telemetry.h"
#endif /* AP_DOWNLINK_H */
#endif /* TELEMETRY_H */