[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paparazzi-commits] [4281] rc telemetry tests
From: |
Martin Mueller |
Subject: |
[paparazzi-commits] [4281] rc telemetry tests |
Date: |
Mon, 19 Oct 2009 18:32:12 +0000 |
Revision: 4281
http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=4281
Author: mmm
Date: 2009-10-19 18:32:12 +0000 (Mon, 19 Oct 2009)
Log Message:
-----------
rc telemetry tests
Modified Paths:
--------------
paparazzi3/trunk/conf/airframes/miniwing.xml
paparazzi3/trunk/sw/airborne/datalink.c
paparazzi3/trunk/sw/airborne/ppm.h
paparazzi3/trunk/sw/logalizer/ctrlstick.c
Added Paths:
-----------
paparazzi3/trunk/conf/radios/generic_tm.xml
paparazzi3/trunk/sw/airborne/ppm_telemetry.c
paparazzi3/trunk/sw/airborne/ppm_telemetry.h
Modified: paparazzi3/trunk/conf/airframes/miniwing.xml
===================================================================
--- paparazzi3/trunk/conf/airframes/miniwing.xml 2009-10-19 13:22:28 UTC
(rev 4280)
+++ paparazzi3/trunk/conf/airframes/miniwing.xml 2009-10-19 18:32:12 UTC
(rev 4281)
@@ -12,8 +12,8 @@
<!-- commands section -->
<servos>
<servo name="MOTOR" no="0" min="1000" neutral="1000" max="2000"/>
- <servo name="AILEVON_LEFT" no="2" min="1720" neutral="1316" max="1000"/>
- <servo name="AILEVON_RIGHT" no="6" min="1220" neutral="1542" max="1840"/>
+ <servo name="AILEVON_LEFT" no="2" min="1720" neutral="1341" max="1000"/>
+ <servo name="AILEVON_RIGHT" no="6" min="1220" neutral="1523" max="1840"/>
</servos>
<commands>
@@ -172,10 +172,6 @@
<define name="DEVICE_ADDRESS" value="...."/>
</section>
- <section name="SIMU">
- <define name="YAW_RESPONSE_FACTOR" value="0.5"/>
- </section>
-
<makefile>
CONFIG = \"tiny_2_1.h\"
Added: paparazzi3/trunk/conf/radios/generic_tm.xml
===================================================================
--- paparazzi3/trunk/conf/radios/generic_tm.xml (rev 0)
+++ paparazzi3/trunk/conf/radios/generic_tm.xml 2009-10-19 18:32:12 UTC (rev
4281)
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+<!-- $Id: mc24.xml 3610 2009-07-02 16:35:18Z poine $
+--
+-- (c) 2003 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.
+-->
+
+<!--
+-- Attributes of root (Radio) tag :
+-- name: name of RC
+-- data_min: min width of a pulse to be considered as a data pulse
+-- data_max: max width of a pulse to be considered as a data pulse
+-- sync_min: min width of a pulse to be considered as a synchro pulse
+-- sync_max: max width of a pulse to be considered as a synchro pulse
+-- min, max and sync are expressed in micro-seconds
+-->
+
+<!--
+-- Attributes of channel tag :
+-- ctl: name of the command on the transmitter - only for displaying
+-- no: order in the PPM frame
+-- function: logical command
+-- averaged: channel filtered through several frames (for discrete commands)
+-- min: minimum pulse length (micro-seconds)
+-- max: maximum pulse length (micro-seconds)
+-- neutral: neutral pulse length (micro-seconds)
+-- Note: a command may be reversed by exchanging min and max values
+-->
+
+
+
+<!DOCTYPE radio SYSTEM "radio.dtd">
+<radio name="generic" data_min="800" data_max="2200" sync_min="5000"
sync_max="15000" pulse_type="POSITIVE">
+ <channel ctl="D" function="THROTTLE" min="1000" neutral="1000" max="2000"
average="0"/>
+ <channel ctl="C" function="ROLL" min="1000" neutral="1500" max="2000"
average="0"/>
+ <channel ctl="B" function="PITCH" min="2000" neutral="1500" max="1000"
average="0"/>
+ <channel ctl="A" function="YAW" min="1000" neutral="1500" max="2000"
average="0"/>
+ <channel ctl="G" function="SWITCH1" min="1000" neutral="1500" max="2000"
average="1"/>
+ <channel ctl="E" function="GAIN1" min="1000" neutral="1500" max="2000"
average="1"/>
+ <channel ctl="F" function="CALIB" min="1000" neutral="1500" max="2000"
average="0"/>
+ <channel ctl="H" function="MODE" min="1000" neutral="1500" max="2000"
average="1"/>
+ <channel ctl="I" function="SWITCH2" min="1000" neutral="1500" max="2000"
average="1"/>
+</radio>
+
Modified: paparazzi3/trunk/sw/airborne/datalink.c
===================================================================
--- paparazzi3/trunk/sw/airborne/datalink.c 2009-10-19 13:22:28 UTC (rev
4280)
+++ paparazzi3/trunk/sw/airborne/datalink.c 2009-10-19 18:32:12 UTC (rev
4281)
@@ -45,6 +45,10 @@
#include "joystick.h"
#endif
+#ifdef USE_RC_TELEMETRY
+#include "ppm.h"
+#endif
+
#ifdef USE_USB_SERIAL
#include "usb_serial.h"
#endif
@@ -165,6 +169,14 @@
DL_JOYSTICK_RAW_throttle(dl_buffer));
} else
#endif // USE_JOYSTICK
+#ifdef USE_RC_TELEMETRY
+ if (msg_id == DL_RC_3CH /*&& DL_RC_3CH_ac_id(dl_buffer) == TX_ID*/) {
+LED_TOGGLE(3);
+ ppm_datalink(DL_RC_3CH_throttle_mode(dl_buffer),
+ DL_RC_3CH_roll(dl_buffer),
+ DL_RC_3CH_pitch(dl_buffer));
+ } else
+#endif // USE_RC_TELEMETRY
{ /* Last else */
#ifdef USE_MODULES
/* Parse modules datalink */
Modified: paparazzi3/trunk/sw/airborne/ppm.h
===================================================================
--- paparazzi3/trunk/sw/airborne/ppm.h 2009-10-19 13:22:28 UTC (rev 4280)
+++ paparazzi3/trunk/sw/airborne/ppm.h 2009-10-19 18:32:12 UTC (rev 4281)
@@ -32,7 +32,11 @@
extern uint16_t ppm_pulses[ PPM_NB_PULSES ];
extern volatile bool_t ppm_valid;
+#ifdef USE_RC_TELEMETRY
+#include "ppm_telemetry.h"
+#else
#include "ppm_hw.h"
+#endif
#endif /* RADIO_CONTROL */
Added: paparazzi3/trunk/sw/airborne/ppm_telemetry.c
===================================================================
--- paparazzi3/trunk/sw/airborne/ppm_telemetry.c
(rev 0)
+++ paparazzi3/trunk/sw/airborne/ppm_telemetry.c 2009-10-19 18:32:12 UTC
(rev 4281)
@@ -0,0 +1,26 @@
+
+#include "ppm.h"
+#include "std.h"
+
+#define PPM_NB_CHANNEL PPM_NB_PULSES
+
+uint16_t ppm_pulses[PPM_NB_CHANNEL];
+volatile bool_t ppm_valid;
+
+
+void ppm_datalink( uint8_t throttle_mode,
+ int8_t roll,
+ int8_t pitch)
+{
+ int throttle = throttle_mode & 0xFC;
+ int mode = throttle_mode & 0x03;
+
+ ppm_pulses[RADIO_ROLL] = (roll * 4 + 1500) * 15;
+ ppm_pulses[RADIO_PITCH] = (pitch * 4 + 1500) * 15;
+ ppm_pulses[RADIO_THROTTLE] = (throttle * 4 + 1000) * 15;
+ ppm_pulses[RADIO_MODE] = (1000 + mode * 500) * 15;
+
+ ppm_valid = TRUE;
+}
+
+
Added: paparazzi3/trunk/sw/airborne/ppm_telemetry.h
===================================================================
--- paparazzi3/trunk/sw/airborne/ppm_telemetry.h
(rev 0)
+++ paparazzi3/trunk/sw/airborne/ppm_telemetry.h 2009-10-19 18:32:12 UTC
(rev 4281)
@@ -0,0 +1,21 @@
+#ifndef PPM_TELEMETRY_H
+#define PPM_TELEMETRY_H
+
+
+#include BOARD_CONFIG
+
+
+static inline void ppm_init ( void ) {
+ ppm_valid = FALSE;
+}
+
+#define PPM_ISR() {}
+
+#define PPM_IT 0x00
+
+void ppm_datalink( uint8_t throttle_mode,
+ int8_t roll,
+ int8_t pitch)
+;
+
+#endif /* PPM_TELEMETRY_H */
Modified: paparazzi3/trunk/sw/logalizer/ctrlstick.c
===================================================================
--- paparazzi3/trunk/sw/logalizer/ctrlstick.c 2009-10-19 13:22:28 UTC (rev
4280)
+++ paparazzi3/trunk/sw/logalizer/ctrlstick.c 2009-10-19 18:32:12 UTC (rev
4281)
@@ -21,7 +21,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-//#define DBG 1
+#define DBG 1
#include <stdio.h>
#include <stdlib.h>
@@ -62,19 +62,23 @@
#if 1
// e-sky 0905A simulator fms
-#define AXIS_YAW ABS_X
-#define AXIS_PITCH ABS_Y
-#define AXIS_ROLL ABS_Z
-#define AXIS_THROTTLE ABS_RY
+//#define AXIS_YAW ABS_X
+//#define AXIS_ROLL ABS_Z
+//#define AXIS_THROTTLE ABS_RY
+//#define AXIS_PITCH ABS_Y
+#define AXIS_YAW ABS_RY
+#define AXIS_ROLL ABS_Y
+#define AXIS_THROTTLE ABS_X
+#define AXIS_PITCH ABS_Z
#define THROTTLE_MIN (-90)
#define THROTTLE_NEUTRAL (0)
#define THROTTLE_MAX (90)
#define ROLL_MIN (-122)
-#define ROLL_NEUTRAL (-2)
+#define ROLL_NEUTRAL (-13)
#define ROLL_MAX (113)
#define PITCH_MIN (-109)
-#define PITCH_NEUTRAL (2)
+#define PITCH_NEUTRAL (-2)
#define PITCH_MAX (109)
#define YAW_MIN (125)
#define YAW_NEUTRAL (-13
@@ -315,8 +319,8 @@
{
dbgprintf(stdout, "pos %d %d %d %d\n", position[0], position[1],
position[2], position[3]);
- if (position[3] > 125) mode = 1;
- else if (position[3] < -125) mode = 2;
+ if (position[3] > 125) mode = 2;
+ else if (position[3] < -125) mode = 1;
else mode = 0;
throttle = ((position[0] - THROTTLE_NEUTRAL -THROTTLE_MIN) * 63) /
(THROTTLE_MAX-THROTTLE_MIN);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paparazzi-commits] [4281] rc telemetry tests,
Martin Mueller <=