mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-28 09:58:23 +08:00
Merge fixes from preparation branch 'v3.9'
* fix typo: THRESHOLD and not TRESHOLD * enable seconds spektrum receiver via <configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="1"/>
This commit is contained in:
@@ -14,8 +14,7 @@
|
||||
<subsystem name="radio_control" type="spektrum"/>
|
||||
<define name="RADIO_MODE" value="RADIO_AUX1"/>
|
||||
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
||||
<define name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="UART5"/>
|
||||
<define name="OVERRIDE_UART5_IRQ_HANDLER"/>
|
||||
<configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="1"/>
|
||||
</target>
|
||||
|
||||
<target name="nps" board="pc">
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
<subsystem name="radio_control" type="spektrum"/>
|
||||
<define name="RADIO_MODE" value="RADIO_AUX1"/>
|
||||
<define name="RADIO_KILL_SWITCH" value="RADIO_GEAR"/>
|
||||
<define name="RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT" value="UART5"/>
|
||||
<define name="OVERRIDE_UART5_IRQ_HANDLER"/>
|
||||
<configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="1"/>
|
||||
</target>
|
||||
|
||||
<target name="nps" board="pc">
|
||||
|
||||
+16
-5
@@ -1,21 +1,32 @@
|
||||
<!DOCTYPE airframe SYSTEM "../airframe.dtd">
|
||||
|
||||
<!-- this is a quadrotor frame equiped with Lisa/M 2.0 and PWM motor controllers -->
|
||||
<!-- this is a quadrotor frame equiped with
|
||||
* Autopilot: Lisa/M 2.0 http://paparazzi.enac.fr/wiki/Lisa/M_v20
|
||||
* IMU: Aspirin 2.1 http://paparazzi.enac.fr/wiki/AspirinIMU
|
||||
* Actuators: PWM motor controllers http://paparazzi.enac.fr/wiki/Subsystem/actuators#PWM_Supervision
|
||||
* GPS: Ublox http://paparazzi.enac.fr/wiki/Subsystem/gps
|
||||
* RC: two Spektrum sats http://paparazzi.enac.fr/wiki/Subsystem/radio_control#Spektrum
|
||||
-->
|
||||
|
||||
<airframe name="fraser">
|
||||
<airframe name="Quadrotor LisaM_2.0 pwm">
|
||||
|
||||
<firmware name="rotorcraft">
|
||||
<target name="ap" board="lisa_m_2.0"/>
|
||||
<target name="ap" board="lisa_m_2.0">
|
||||
<subsystem name="radio_control" type="spektrum">
|
||||
<define name="RADIO_MODE" value="RADIO_AUX1"/>
|
||||
<configure name="USE_SECONDARY_SPEKTRUM_RECEIVER" value="1"/>
|
||||
</subsystem>
|
||||
</target>
|
||||
|
||||
<target name="nps" board="pc">
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="fdm" type="nps"/>
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
</target>
|
||||
|
||||
<subsystem name="actuators" type="pwm_supervision">
|
||||
<define name="SERVO_HZ" value="400"/>
|
||||
</subsystem>
|
||||
|
||||
<subsystem name="radio_control" type="ppm"/>
|
||||
<subsystem name="telemetry" type="transparent"/>
|
||||
<subsystem name="imu" type="aspirin_v2.1"/>
|
||||
<subsystem name="gps" type="ublox"/>
|
||||
@@ -1,8 +1,14 @@
|
||||
<!DOCTYPE airframe SYSTEM "../airframe.dtd">
|
||||
|
||||
<!-- this is a quadrotor frame equiped with Lisa/M 1.0 and MKK motor controllers -->
|
||||
<!-- this is a quadrotor frame equiped with
|
||||
* Autopilot: Lisa/M 1.0 http://paparazzi.enac.fr/wiki/Lisa/M_v10
|
||||
* IMU: Aspirin 1.5 http://paparazzi.enac.fr/wiki/AspirinIMU
|
||||
* Actuators: MKK motor controllers http://paparazzi.enac.fr/wiki/Subsystem/actuators#MKK
|
||||
* GPS: Ublox http://paparazzi.enac.fr/wiki/Subsystem/gps
|
||||
* RC: any PPM system http://paparazzi.enac.fr/wiki/Subsystem/radio_control#PPM
|
||||
-->
|
||||
|
||||
<airframe name="fraser">
|
||||
<airframe name="Quadrotor LisaM_1.0 mkk">
|
||||
|
||||
<firmware name="rotorcraft">
|
||||
<target name="ap" board="lisa_m_1.0">
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
gui_color="white"
|
||||
/>
|
||||
<aircraft
|
||||
name="Quad_LisaM"
|
||||
name="Quad_LisaM_2"
|
||||
ac_id="162"
|
||||
airframe="airframes/examples/quadrotor_lisa_m_2_pwm.xml"
|
||||
airframe="airframes/examples/quadrotor_lisa_m_2_pwm_spektrum.xml"
|
||||
radio="radios/cockpitSX.xml"
|
||||
telemetry="telemetry/default_rotorcraft.xml"
|
||||
flight_plan="flight_plans/rotorcraft_basic.xml"
|
||||
|
||||
@@ -16,6 +16,14 @@ endif
|
||||
ap.CFLAGS += -DRADIO_CONTROL_SPEKTRUM_PRIMARY_PORT=$(RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT)
|
||||
ap.CFLAGS += -DOVERRIDE_$(RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT)_IRQ_HANDLER -DUSE_TIM6_IRQ
|
||||
|
||||
# enable the second spektrum port if so configured
|
||||
ifdef USE_SECONDARY_SPEKTRUM_RECEIVER
|
||||
ifneq ($(USE_SECONDARY_SPEKTRUM_RECEIVER),0)
|
||||
ap.CFLAGS += -DRADIO_CONTROL_SPEKTRUM_SECONDARY_PORT=$(RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT)
|
||||
ap.CFLAGS += -DOVERRIDE_$(RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT)_IRQ_HANDLER
|
||||
endif
|
||||
endif
|
||||
|
||||
ap.srcs += $(SRC_SUBSYSTEMS)/radio_control.c \
|
||||
$(SRC_SUBSYSTEMS)/radio_control/spektrum.c \
|
||||
$(SRC_ARCH)/subsystems/radio_control/spektrum_arch.c
|
||||
|
||||
@@ -35,10 +35,10 @@
|
||||
#include "mcu_periph/sys_time.h"
|
||||
#include "estimator.h"
|
||||
|
||||
#define TRESHOLD_MANUAL_PPRZ (MIN_PPRZ / 2)
|
||||
#define THRESHOLD_MANUAL_PPRZ (MIN_PPRZ / 2)
|
||||
|
||||
#define TRESHOLD1 TRESHOLD_MANUAL_PPRZ
|
||||
#define TRESHOLD2 (MAX_PPRZ/2)
|
||||
#define THRESHOLD1 THRESHOLD_MANUAL_PPRZ
|
||||
#define THRESHOLD2 (MAX_PPRZ/2)
|
||||
|
||||
|
||||
#define PPRZ_MODE_MANUAL 0
|
||||
@@ -49,8 +49,8 @@
|
||||
#define PPRZ_MODE_NB 5
|
||||
|
||||
#define PPRZ_MODE_OF_PULSE(pprz) \
|
||||
(pprz > TRESHOLD2 ? PPRZ_MODE_AUTO2 : \
|
||||
(pprz > TRESHOLD1 ? PPRZ_MODE_AUTO1 : PPRZ_MODE_MANUAL))
|
||||
(pprz > THRESHOLD2 ? PPRZ_MODE_AUTO2 : \
|
||||
(pprz > THRESHOLD1 ? PPRZ_MODE_AUTO1 : PPRZ_MODE_MANUAL))
|
||||
|
||||
extern uint8_t pprz_mode;
|
||||
extern bool_t kill_throttle;
|
||||
@@ -64,8 +64,7 @@ extern bool_t kill_throttle;
|
||||
#define LATERAL_MODE_NB 4
|
||||
extern uint8_t lateral_mode;
|
||||
|
||||
#define STICK_PUSHED(pprz) (pprz < TRESHOLD1 || pprz > TRESHOLD2)
|
||||
|
||||
#define STICK_PUSHED(pprz) (pprz < THRESHOLD1 || pprz > THRESHOLD2)
|
||||
#define FLOAT_OF_PPRZ(pprz, center, travel) ((float)pprz / (float)MAX_PPRZ * travel + center)
|
||||
|
||||
#define THROTTLE_THRESHOLD_TAKEOFF (pprz_t)(MAX_PPRZ * 0.9)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* Paparazzi $Id$
|
||||
*
|
||||
* Copyright (C) 2005 Pascal Brisset, Antoine Drouin
|
||||
*
|
||||
* This file is part of paparazzi.
|
||||
@@ -22,8 +20,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/** \file main_fbw.h
|
||||
* \brief FBW ( FlyByWire ) process API
|
||||
/** @file main_fbw.h
|
||||
* @brief FBW ( FlyByWire ) process API
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -36,7 +34,7 @@
|
||||
#define FBW_MODE_MANUAL 0
|
||||
#define FBW_MODE_AUTO 1
|
||||
#define FBW_MODE_FAILSAFE 2
|
||||
#define FBW_MODE_OF_PPRZ(mode) ((mode) < TRESHOLD_MANUAL_PPRZ ? FBW_MODE_MANUAL : FBW_MODE_AUTO)
|
||||
#define FBW_MODE_OF_PPRZ(mode) ((mode) < THRESHOLD_MANUAL_PPRZ ? FBW_MODE_MANUAL : FBW_MODE_AUTO)
|
||||
|
||||
extern uint8_t fbw_mode;
|
||||
extern bool_t failsafe_mode;
|
||||
|
||||
@@ -78,13 +78,13 @@ extern uint16_t autopilot_flight_time;
|
||||
#endif
|
||||
|
||||
|
||||
#define TRESHOLD_1_PPRZ (MIN_PPRZ / 2)
|
||||
#define TRESHOLD_2_PPRZ (MAX_PPRZ / 2)
|
||||
#define THRESHOLD_1_PPRZ (MIN_PPRZ / 2)
|
||||
#define THRESHOLD_2_PPRZ (MAX_PPRZ / 2)
|
||||
|
||||
#define AP_MODE_OF_PPRZ(_rc, _mode) { \
|
||||
if (_rc > TRESHOLD_2_PPRZ) \
|
||||
if (_rc > THRESHOLD_2_PPRZ) \
|
||||
_mode = autopilot_mode_auto2; \
|
||||
else if (_rc > TRESHOLD_1_PPRZ) \
|
||||
else if (_rc > THRESHOLD_1_PPRZ) \
|
||||
_mode = MODE_AUTO1; \
|
||||
else \
|
||||
_mode = MODE_MANUAL; \
|
||||
@@ -106,13 +106,13 @@ extern uint16_t autopilot_flight_time;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef TRESHOLD_GROUND_DETECT
|
||||
#define TRESHOLD_GROUND_DETECT ACCEL_BFP_OF_REAL(15.)
|
||||
#ifndef THRESHOLD_GROUND_DETECT
|
||||
#define THRESHOLD_GROUND_DETECT ACCEL_BFP_OF_REAL(15.)
|
||||
#endif
|
||||
static inline void DetectGroundEvent(void) {
|
||||
if (autopilot_mode == AP_MODE_FAILSAFE || autopilot_detect_ground_once) {
|
||||
if (ins_ltp_accel.z < -TRESHOLD_GROUND_DETECT ||
|
||||
ins_ltp_accel.z > TRESHOLD_GROUND_DETECT) {
|
||||
if (ins_ltp_accel.z < -THRESHOLD_GROUND_DETECT ||
|
||||
ins_ltp_accel.z > THRESHOLD_GROUND_DETECT) {
|
||||
autopilot_detect_ground = TRUE;
|
||||
autopilot_detect_ground_once = FALSE;
|
||||
}
|
||||
|
||||
@@ -24,26 +24,26 @@
|
||||
|
||||
#include "subsystems/radio_control.h"
|
||||
|
||||
#define AUTOPILOT_THROTTLE_TRESHOLD (MAX_PPRZ / 20)
|
||||
#define AUTOPILOT_YAW_TRESHOLD (MAX_PPRZ * 19 / 20)
|
||||
#ifndef AUTOPILOT_STICK_CENTER_TRESHOLD
|
||||
#define AUTOPILOT_STICK_CENTER_TRESHOLD (MAX_PPRZ * 1 / 20)
|
||||
#define AUTOPILOT_THROTTLE_THRESHOLD (MAX_PPRZ / 20)
|
||||
#define AUTOPILOT_YAW_THRESHOLD (MAX_PPRZ * 19 / 20)
|
||||
#ifndef AUTOPILOT_STICK_CENTER_THRESHOLD
|
||||
#define AUTOPILOT_STICK_CENTER_THRESHOLD (MAX_PPRZ * 1 / 20)
|
||||
#endif
|
||||
|
||||
#define THROTTLE_STICK_DOWN() \
|
||||
(radio_control.values[RADIO_THROTTLE] < AUTOPILOT_THROTTLE_TRESHOLD)
|
||||
(radio_control.values[RADIO_THROTTLE] < AUTOPILOT_THROTTLE_THRESHOLD)
|
||||
#define YAW_STICK_PUSHED() \
|
||||
(radio_control.values[RADIO_YAW] > AUTOPILOT_YAW_TRESHOLD || \
|
||||
radio_control.values[RADIO_YAW] < -AUTOPILOT_YAW_TRESHOLD)
|
||||
(radio_control.values[RADIO_YAW] > AUTOPILOT_YAW_THRESHOLD || \
|
||||
radio_control.values[RADIO_YAW] < -AUTOPILOT_YAW_THRESHOLD)
|
||||
#define YAW_STICK_CENTERED() \
|
||||
(radio_control.values[RADIO_YAW] < AUTOPILOT_STICK_CENTER_TRESHOLD && \
|
||||
radio_control.values[RADIO_YAW] > -AUTOPILOT_STICK_CENTER_TRESHOLD)
|
||||
(radio_control.values[RADIO_YAW] < AUTOPILOT_STICK_CENTER_THRESHOLD && \
|
||||
radio_control.values[RADIO_YAW] > -AUTOPILOT_STICK_CENTER_THRESHOLD)
|
||||
#define PITCH_STICK_CENTERED() \
|
||||
(radio_control.values[RADIO_PITCH] < AUTOPILOT_STICK_CENTER_TRESHOLD && \
|
||||
radio_control.values[RADIO_PITCH] > -AUTOPILOT_STICK_CENTER_TRESHOLD)
|
||||
(radio_control.values[RADIO_PITCH] < AUTOPILOT_STICK_CENTER_THRESHOLD && \
|
||||
radio_control.values[RADIO_PITCH] > -AUTOPILOT_STICK_CENTER_THRESHOLD)
|
||||
#define ROLL_STICK_CENTERED() \
|
||||
(radio_control.values[RADIO_ROLL] < AUTOPILOT_STICK_CENTER_TRESHOLD && \
|
||||
radio_control.values[RADIO_ROLL] > -AUTOPILOT_STICK_CENTER_TRESHOLD)
|
||||
(radio_control.values[RADIO_ROLL] < AUTOPILOT_STICK_CENTER_THRESHOLD && \
|
||||
radio_control.values[RADIO_ROLL] > -AUTOPILOT_STICK_CENTER_THRESHOLD)
|
||||
|
||||
static inline bool_t rc_attitude_sticks_centered(void) {
|
||||
return ROLL_STICK_CENTERED() && PITCH_STICK_CENTERED() && YAW_STICK_CENTERED();
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
* Configuration:
|
||||
* Since the API of led.h is used, connected pins must be defined as led
|
||||
* numbers (usually in the airframe file):
|
||||
* <define name="DC_SHUTTER_LED" value="6"/>
|
||||
* <define name="DC_SHUTTER_LED" value="10"/>
|
||||
* <define name="DC_ZOOM_IN_LED" value="7"/>
|
||||
* <define name="DC_ZOOM_OUT_LED" value="8"/>
|
||||
* <define name="DC_POWER_LED" value="9"/>
|
||||
* Related bank and pin must also be defined:
|
||||
* <define name="LED_6_BANK" value="0"/>
|
||||
* <define name="LED_6_PIN" value="2"/>
|
||||
* <define name="LED_10_BANK" value="0"/>
|
||||
* <define name="LED_10_PIN" value="2"/>
|
||||
* The required initialization (dc_init()) and periodic (4Hz) process
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
* Configuration:
|
||||
* Since the API of led.h is used, connected pins must be defined as led
|
||||
* numbers (usually in the airframe file):
|
||||
* <define name="DC_SHUTTER_SERVO" value="6"/>
|
||||
* <define name="DC_SHUTTER_SERVO" value="10"/>
|
||||
* <define name="DC_ZOOM_IN_SERVO" value="7"/>
|
||||
* <define name="DC_ZOOM_OUT_SERVO" value="8"/>
|
||||
* <define name="DC_POWER_SERVO" value="9"/>
|
||||
* Related bank and pin must also be defined:
|
||||
* <define name="LED_6_BANK" value="0"/>
|
||||
* <define name="LED_6_PIN" value="2"/>
|
||||
* <define name="LED_10_BANK" value="0"/>
|
||||
* <define name="LED_10_PIN" value="2"/>
|
||||
* The required initialization (dc_init()) and periodic (4Hz) process
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -59,8 +59,8 @@ void rc_settings(bool_t mode_changed);
|
||||
|
||||
#define RcSettingsOff() (rc_settings_mode==RC_SETTINGS_MODE_NONE)
|
||||
|
||||
#define RC_SETTINGS_MODE_OF_PULSE(pprz) (pprz < TRESHOLD1 ? RC_SETTINGS_MODE_DOWN : \
|
||||
(pprz < TRESHOLD2 ? RC_SETTINGS_MODE_NONE : \
|
||||
#define RC_SETTINGS_MODE_OF_PULSE(pprz) (pprz < THRESHOLD1 ? RC_SETTINGS_MODE_DOWN : \
|
||||
(pprz < THRESHOLD2 ? RC_SETTINGS_MODE_NONE : \
|
||||
RC_SETTINGS_MODE_UP))
|
||||
|
||||
#define RcSettingsModeUpdate(_rc_channels) \
|
||||
|
||||
@@ -28,7 +28,7 @@ foreach my $example (sort keys%{$examples->{'aircraft'}})
|
||||
next unless scalar $airframe_config->{'firmware'}->{$process}->{'target'}->{$target}->{'board'};
|
||||
|
||||
# Exclude some builds on Mac as they are currently broken.
|
||||
next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1|LisaLv11_Aspirinv15_Overo_RC|Quad_LisaM|Booz2#i) and ($target =~ m#nps#i) );
|
||||
next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LisaLv11_Booz2v12_RC|LisaLv11_Aspirinv15_Overo_RC|Quad_LisaM_2|BOOZ2#i) and ($target =~ m#nps#i) );
|
||||
|
||||
#warn "EXAMPLE: [$example] TARGET: [$target]\n";
|
||||
my $make_options = "AIRCRAFT=$example clean_ac $target.compile";
|
||||
@@ -48,7 +48,7 @@ foreach my $example (sort keys%{$examples->{'aircraft'}})
|
||||
next unless scalar $airframe_config->{'firmware'}->{$process}->{$target}->{'board'};
|
||||
|
||||
# Exclude some builds on Mac as they are currently broken.
|
||||
next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1|LisaLv11_Aspirinv15_Overo_RC|Quad_LisaM|Booz2#i) and ($target =~ m#nps#i) );
|
||||
next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LisaLv11_Booz2v12_RC|LisaLv11_Aspirinv15_Overo_RC|Quad_LisaM_2|BOOZ2#i) and ($target =~ m#nps#i) );
|
||||
|
||||
#warn "EXAMPLET: [$example] TARGET: [$target]\n";
|
||||
my $make_options = "AIRCRAFT=$example clean_ac $target.compile";
|
||||
|
||||
Reference in New Issue
Block a user