Merge pull request #2047 from OpenUAS/add_pixracer_fixedwing

Full reatured fixedwing example for Pixracer AP board
This commit is contained in:
OpenUAS
2017-05-30 09:17:47 +02:00
committed by GitHub
14 changed files with 1426 additions and 471 deletions
+2 -2
View File
@@ -56,10 +56,10 @@ paparazzi.sublime-workspace
/paparazzi /paparazzi
# /conf/ # /conf/
/conf/conf.xml /conf/conf.xml~
/conf/conf.xml.20* /conf/conf.xml.20*
/conf/conf_personal.xml.20* /conf/conf_personal.xml.20*
/conf/control_panel.xml /conf/control_panel.xml~
/conf/control_panel.xml.20* /conf/control_panel.xml.20*
/conf/%gconf.xml /conf/%gconf.xml
/conf/maps_data/* /conf/maps_data/*
File diff suppressed because it is too large Load Diff
+6
View File
@@ -57,3 +57,9 @@ GPS_BAUD ?= B38400
# e.g. <servo driver="Ppm"> # e.g. <servo driver="Ppm">
# #
ACTUATORS ?= actuators_pwm ACTUATORS ?= actuators_pwm
#
# default External Current and Volt Sensor configuration
#
# ADC_CURRENT_SENSOR ?= ADC_3
# ADC_VOLTAGE_SENSOR ?= ADC_2
+1
View File
@@ -0,0 +1 @@
userconf/OPENUAS/openuas_conf.xml
+1
View File
@@ -0,0 +1 @@
userconf/OPENUAS/openuas_control_panel.xml
+2 -2
View File
@@ -23,8 +23,8 @@
<rc_settings> <rc_settings>
<rc_mode NAME="AUTO1"> <rc_mode NAME="AUTO1">
<rc_setting VAR="infrared_pitch_neutral" RANGE="0.2" RC="gain_1_up" TYPE="float"/> <rc_setting VAR="ins_pitch_neutral" RANGE="0.2" RC="gain_1_up" TYPE="float"/>
<rc_setting VAR="infrared_roll_neutral" RANGE="-0.2" RC="gain_1_down" TYPE="float"/> <rc_setting VAR="ins_roll_neutral" RANGE="-0.2" RC="gain_1_down" TYPE="float"/>
</rc_mode> </rc_mode>
<rc_mode NAME="AUTO2"> <rc_mode NAME="AUTO2">
<rc_setting VAR="h_ctl_course_pgain" RANGE="0.5" RC="gain_1_up" TYPE="float"/> <rc_setting VAR="h_ctl_course_pgain" RANGE="0.5" RC="gain_1_up" TYPE="float"/>
@@ -0,0 +1,124 @@
<?xml version="1.0"?>
<!DOCTYPE telemetry SYSTEM "../telemetry.dtd">
<telemetry>
<process name="Ap">
<mode name="default" key_press="d">
<message name="ADC_GENERIC" period="0.25"/>
<message name="AIRSPEED" period="1"/>
<message name="ALIVE" period="5.1"/>
<message name="GPS" period="0.25"/>
<message name="NAVIGATION" period="0.5"/>
<message name="ATTITUDE" period="0.1"/>
<message name="ESTIMATOR" period="0.5"/>
<message name="ENERGY" period="2.4"/>
<message name="WP_MOVED" period="0.25"/>
<message name="CIRCLE" period="1.05"/>
<message name="DESIRED" period="0.2"/>
<message name="BAT" period="1.1"/>
<message name="SEGMENT" period="1.2"/>
<message name="CALIBRATION" period="2.1"/>
<message name="NAVIGATION_REF" period="4.0"/>
<message name="PPRZ_MODE" period="1.0"/>
<message name="SETTINGS" period="3."/>
<message name="STATE_FILTER_STATUS" period="2.2"/>
<message name="DATALINK_REPORT" period="5.1"/>
<message name="DL_VALUE" period="1.5"/>
<message name="SURVEY" period="2.1"/>
<message name="GPS_SOL" period="2.0"/>
<message name="IMU_ACCEL" period=".6"/>
<message name="IMU_GYRO" period=".6"/>
<message name="IMU_MAG" period="0.7"/>
<message name="CAM" period="0.5"/>
<message name="CAM_POINT" period="1.0"/>
<message name="COMMANDS" period="5"/>
<message name="FBW_STATUS" period="2"/>
<message name="AIR_DATA" period="1.3"/>
</mode>
<mode name="minimal" key_press="m">
<message name="ALIVE" period="5"/>
<message name="ATTITUDE" period="4"/>
<message name="GPS" period="1.05"/>
<message name="ESTIMATOR" period="1.3"/>
<message name="WP_MOVED" period="1.4"/>
<message name="CIRCLE" period="3.05"/>
<message name="DESIRED" period="4.05"/>
<message name="BAT" period="1.1"/>
<message name="SEGMENT" period="3.2"/>
<message name="CALIBRATION" period="5.1"/>
<message name="NAVIGATION_REF" period="9."/>
<message name="NAVIGATION" period="3."/>
<message name="PPRZ_MODE" period="5."/>
<message name="STATE_FILTER_STATUS" period="5."/>
<message name="DATALINK_REPORT" period="5.1"/>
<message name="DL_VALUE" period="1.5"/>
<message name="IR_SENSORS" period="5.2"/>
<message name="SURVEY" period="2.1"/>
<message name="GPS_SOL" period="5.0"/>
</mode>
<mode name="extremal" key_press="e">
<message name="ALIVE" period="5"/>
<message name="GPS" period="5.1"/>
<message name="ESTIMATOR" period="5.3"/>
<message name="BAT" period="10.1"/>
<message name="DESIRED" period="10.2"/>
<message name="NAVIGATION" period="5.4"/>
<message name="PPRZ_MODE" period="7.5"/>
<message name="STATE_FILTER_STATUS" period="8."/>
<message name="DATALINK_REPORT" period="5.7"/>
</mode>
<mode name="raw_sensors" key_press="r">
<message name="DL_VALUE" period="0.5"/>
<message name="ALIVE" period="2.1"/>
<message name="IMU_ACCEL_RAW" period="0.05"/>
<message name="IMU_GYRO_RAW" period="0.05"/>
<message name="IMU_MAG_RAW" period="0.05"/>
<message name="BARO_RAW" period="0.25"/>
</mode>
<mode name="scaled_sensors" key_press="s">
<message name="DL_VALUE" period="0.5"/>
<message name="ALIVE" period="2.1"/>
<message name="IMU_GYRO" period="0.075"/>
<message name="IMU_ACCEL" period="0.075"/>
<message name="IMU_MAG" period="0.1"/>
</mode>
<mode name="debug_imu" key_press="i">
<message name="ATTITUDE" period="0.1"/>
<message name="ALIVE" period="5.0"/>
<message name="GPS" period="5.1"/>
<message name="ESTIMATOR" period="5.3"/>
<message name="BAT" period="10.1"/>
<message name="DESIRED" period="10.2"/>
<message name="NAVIGATION" period="5.4"/>
<message name="PPRZ_MODE" period="5.5"/>
<message name="STATE_FILTER_STATUS" period="5.0"/>
<message name="DATALINK_REPORT" period="5.7"/>
<message name="IMU_ACCEL" period="0.5"/>
<message name="IMU_GYRO" period="0.5"/>
<message name="IMU_MAG" period="0.5"/>
<message name="IMU_ACCEL_RAW" period="0.5"/>
<message name="IMU_GYRO_RAW" period="0.5"/>
<message name="IMU_MAG_RAW" period="0.5"/>
</mode>
<mode name="debug_rc" key_press="c">
<message name="PPM" period="0.25"/>
<message name="RC" period="0.25"/>
<message name="COMMANDS" period="0.25"/>
<message name="FBW_STATUS" period="1.0"/>
<message name="ACTUATORS" period="0.5"/> <!-- For trimming -->
</mode>
</process>
<process name="Fbw">
<mode name="default">
<message name="COMMANDS" period="5.0"/>
<message name="FBW_STATUS" period="2.0"/>
<message name="ACTUATORS" period="5.0"/> <!-- For trimming -->
</mode>
<mode name="debug">
<message name="PPM" period="0.5"/>
<message name="RC" period="0.5"/>
<message name="COMMANDS" period="0.5"/>
<message name="FBW_STATUS" period="1.0"/>
<message name="ACTUATORS" period="5.0"/> <!-- For trimming -->
</mode>
</process>
</telemetry>
+11
View File
@@ -1,4 +1,15 @@
<conf> <conf>
<aircraft
name="EFlite-T28"
ac_id="252"
airframe="airframes/OPENUAS/openuas_eflite_t28.xml"
radio="radios/spektrum.xml"
telemetry="telemetry/OPENUAS/openuas_fixedwing_imu_rc.xml"
flight_plan="flight_plans/versatile.xml"
settings="settings/fixedwing_basic.xml [settings/estimation/ac_char.xml] [settings/control/ctl_energy.xml] settings/rc_settings_ins.xml [settings/control/tune_agr_climb.xml] [settings/control/ctl_energyadaptive.xml] settings/OPENUAS/openuas_tuning_rc.xml"
settings_modules="modules/nav_smooth.xml modules/nav_survey_poly_osam.xml modules/geo_mag.xml modules/air_data.xml modules/gps.xml modules/nav_basic_fw.xml modules/guidance_basic_fw.xml modules/stabilization_attitude_fw.xml modules/ahrs_float_cmpl_quat.xml [modules/ahrs_int_cmpl_quat.xml] modules/imu_common.xml"
gui_color="#ffffffffffff"
/>
<aircraft <aircraft
name="Itsy-Bitsy" name="Itsy-Bitsy"
ac_id="229" ac_id="229"
File diff suppressed because it is too large Load Diff
@@ -52,8 +52,12 @@
#ifndef RADIO_YAW #ifndef RADIO_YAW
#define RADIO_YAW 3 #define RADIO_YAW 3
#endif #endif
#ifndef RADIO_GEAR
#define RADIO_GEAR 4 #define RADIO_GEAR 4
#endif
#ifndef RADIO_FLAP
#define RADIO_FLAP 5 #define RADIO_FLAP 5
#endif
#define RADIO_AUX1 5 #define RADIO_AUX1 5
#define RADIO_AUX2 6 #define RADIO_AUX2 6
#define RADIO_AUX3 7 #define RADIO_AUX3 7
+54 -41
View File
@@ -6,12 +6,15 @@
/* PX4FMU_V4 a.k.a. Pixracer board has a 24MHz external clock and 168MHz internal. */ /* PX4FMU_V4 a.k.a. Pixracer board has a 24MHz external clock and 168MHz internal. */
/* STM32F4 STM32F427VIT6 */ /* STM32F4 STM32F427VIT6 */
#define EXT_CLK 24000000 //OK #define EXT_CLK 24000000
#define AHB_CLK 168000000 //OK #define AHB_CLK 168000000
//#define STM32F4 //to debug ADC on F4 does no work
//#define ADC_SAMPLE_TIME ADC_SMPR_SMP_56CYC //to debug ADC on F4 does no work
/* On PCB there is a Multicolor LED */
/* On PCB Multicolor LED */
/* Red */ /* Red */
//OK
#ifndef USE_LED_1 #ifndef USE_LED_1
#define USE_LED_1 1 #define USE_LED_1 1
#endif #endif
@@ -22,7 +25,6 @@
#define LED_1_AFIO_REMAP ((void)0) #define LED_1_AFIO_REMAP ((void)0)
/* Green */ /* Green */
//OK
#ifndef USE_LED_2 #ifndef USE_LED_2
#define USE_LED_2 1 #define USE_LED_2 1
#endif #endif
@@ -33,7 +35,6 @@
#define LED_2_AFIO_REMAP ((void)0) #define LED_2_AFIO_REMAP ((void)0)
/* Blue */ /* Blue */
//OK
#ifndef USE_LED_3 #ifndef USE_LED_3
#define USE_LED_3 1 #define USE_LED_3 1
#endif #endif
@@ -49,6 +50,7 @@
/* UART SCHTUFFFF*/ /* UART SCHTUFFFF*/
/* -WiFi ESP Connector, it is just a serial port*/ /* -WiFi ESP Connector, it is just a serial port*/
//TODO: Test
#define UART1_GPIO_AF GPIO_AF7 #define UART1_GPIO_AF GPIO_AF7
#define UART1_GPIO_PORT_RX GPIOB #define UART1_GPIO_PORT_RX GPIOB
#define UART1_GPIO_RX GPIO7 #define UART1_GPIO_RX GPIO7
@@ -84,12 +86,12 @@
#define UART4_GPIO_PORT_TX GPIOA #define UART4_GPIO_PORT_TX GPIOA
#define UART4_GPIO_TX GPIO0 #define UART4_GPIO_TX GPIO0
/* Spektrum (only rx)*/ /* e.g. for a Spektrum satellite receiver rx only)*/
#define UART6_GPIO_AF GPIO_AF8 #define UART6_GPIO_AF GPIO_AF8
#define UART6_GPIO_PORT_RX GPIOC #define UART6_GPIO_PORT_RX GPIOC
#define UART6_GPIO_RX GPIO7 #define UART6_GPIO_RX GPIO7
/* Serial Debugging Connector, not used with PPRZ, use JTAG, can be put to other good use */ /* Serial Debugging Connector, not used with PPRZ as of now, use JTAG, can be put to other good use */
#define UART7_GPIO_AF GPIO_AF8 #define UART7_GPIO_AF GPIO_AF8
#define UART7_GPIO_PORT_RX GPIOE #define UART7_GPIO_PORT_RX GPIOE
#define UART7_GPIO_RX GPIO7 #define UART7_GPIO_RX GPIO7
@@ -97,6 +99,7 @@
#define UART7_GPIO_TX GPIO8 #define UART7_GPIO_TX GPIO8
/* Connector -FRS FrSky */ /* Connector -FRS FrSky */
//TODO: Test
#define UART8_GPIO_AF GPIO_AF8 #define UART8_GPIO_AF GPIO_AF8
#define UART8_GPIO_PORT_RX GPIOE #define UART8_GPIO_PORT_RX GPIOE
#define UART8_GPIO_RX GPIO0 #define UART8_GPIO_RX GPIO0
@@ -104,24 +107,23 @@
#define UART8_GPIO_TX GPIO1 #define UART8_GPIO_TX GPIO1
/* Soft binding Spektrum */ /* Soft binding Spektrum */
//ok //TODO: Test and or FIXME:
#define RADIO_CONTROL_POWER_PORT GPIOE #define RADIO_CONTROL_POWER_PORT GPIOE
#define RADIO_CONTROL_POWER_PIN GPIO4 //SPEKTRUM POWER #define RADIO_CONTROL_POWER_PIN GPIO4 //SPEKTRUM POWER
#define RADIO_CONTROL_POWER_ON gpio_clear // yes, inverted #define RADIO_CONTROL_POWER_ON gpio_clear // yes, inverted
#define RADIO_CONTROL_POWER_OFF gpio_set #define RADIO_CONTROL_POWER_OFF gpio_set
//A receiver on powered on 3.3v
#define PERIPHERAL3V3_ENABLE_PORT GPIOC //VDD_3V3_PERIPHERAL_EN #define PERIPHERAL3V3_ENABLE_PORT GPIOC //VDD_3V3_PERIPHERAL_EN
#define PERIPHERAL3V3_ENABLE_PIN GPIO5 #define PERIPHERAL3V3_ENABLE_PIN GPIO5
#define PERIPHERAL3V3_ENABLE_ON gpio_set #define PERIPHERAL3V3_ENABLE_ON gpio_set
#define PERIPHERAL3V3_ENABLE_OFF gpio_clear #define PERIPHERAL3V3_ENABLE_OFF gpio_clear
/* Turn SBUS invert */ /* Turn SBUS invert */
//ok //TODO: Test
#define RC_POLARITY_GPIO_PORT GPIOC #define RC_POLARITY_GPIO_PORT GPIOC
#define RC_POLARITY_GPIO_PIN GPIO13 #define RC_POLARITY_GPIO_PIN GPIO13
//ok
#define SPEKTRUM_UART6_RCC RCC_USART6 #define SPEKTRUM_UART6_RCC RCC_USART6
#define SPEKTRUM_UART6_BANK GPIOC #define SPEKTRUM_UART6_BANK GPIOC
#define SPEKTRUM_UART6_PIN GPIO7 #define SPEKTRUM_UART6_PIN GPIO7
@@ -133,7 +135,6 @@
/* SPI */ /* SPI */
/* SPI1 for MPU and extra accel/gyro/mag */ /* SPI1 for MPU and extra accel/gyro/mag */
// OK
#define SPI1_GPIO_AF GPIO_AF5 #define SPI1_GPIO_AF GPIO_AF5
#define SPI1_GPIO_PORT_MISO GPIOA #define SPI1_GPIO_PORT_MISO GPIOA
#define SPI1_GPIO_MISO GPIO6 #define SPI1_GPIO_MISO GPIO6
@@ -143,7 +144,6 @@
#define SPI1_GPIO_SCK GPIO5 #define SPI1_GPIO_SCK GPIO5
/* SPI2 for FRAM, connects to BARO */ /* SPI2 for FRAM, connects to BARO */
// OK
#define SPI2_GPIO_AF GPIO_AF5 #define SPI2_GPIO_AF GPIO_AF5
#define SPI2_GPIO_PORT_MISO GPIOB #define SPI2_GPIO_PORT_MISO GPIOB
#define SPI2_GPIO_MISO GPIO14 #define SPI2_GPIO_MISO GPIO14
@@ -164,8 +164,9 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
* SPI slave pin declaration * SPI slave pin declaration
*/ */
//So use best speced sensors as second or ref the other or determine it on task type? //So use best spec'd sensors as second or ref the other or determine it on task type?
/* EXTRA ACC_GYRO_CS on SPI1 ICM 20609-G*/ /* EXTRA ACC_GYRO_CS on SPI1 ICM 20609-G*/
// TODO: Make it useful
#define SPI_SELECT_SLAVE0_PORT GPIOC #define SPI_SELECT_SLAVE0_PORT GPIOC
#define SPI_SELECT_SLAVE0_PIN GPIO15 #define SPI_SELECT_SLAVE0_PIN GPIO15
@@ -174,17 +175,16 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define SPI_SELECT_SLAVE1_PORT GPIOE #define SPI_SELECT_SLAVE1_PORT GPIOE
#define SPI_SELECT_SLAVE1_PIN GPIO15 #define SPI_SELECT_SLAVE1_PIN GPIO15
/* MDL /* MDL */
#define SPI_SELECT_SLAVE1_PORT GPIOE // FIXME: Test n fix or emoveal
#define SPI_SELECT_SLAVE1_PIN GPIO15 */ //#define SPI_SELECT_SLAVE1_PORT GPIOE
//#define SPI_SELECT_SLAVE1_PIN GPIO15
/* MPU_9250_CS on SPI1 */ /* MPU_9250_CS on SPI1 */
//OK
#define SPI_SELECT_SLAVE2_PORT GPIOC #define SPI_SELECT_SLAVE2_PORT GPIOC
#define SPI_SELECT_SLAVE2_PIN GPIO2 #define SPI_SELECT_SLAVE2_PIN GPIO2
/* MS5611 BARO_CS on SPI2 - FRAM*/ /* MS5611 BARO_CS on SPI2 - FRAM*/
//OK
#define SPI_SELECT_SLAVE3_PORT GPIOD #define SPI_SELECT_SLAVE3_PORT GPIOD
#define SPI_SELECT_SLAVE3_PIN GPIO7 #define SPI_SELECT_SLAVE3_PIN GPIO7
@@ -193,11 +193,13 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define SPI_SELECT_SLAVE4_PIN GPIO10 #define SPI_SELECT_SLAVE4_PIN GPIO10
/* SPI3 NSS on microSD connector */ /* SPI3 NSS on microSD connector */
//#define SPI_SELECT_SLAVE4_PORT GPIOA //FIXME: not tested
//#define SPI_SELECT_SLAVE4_PIN GPIO4 //#define SPI_SELECT_SLAVE5_PORT GPIOA
//#define SPI_SELECT_SLAVE5_PIN GPIO4
/* SDIO to microSD card connector */ /* SDIO to microSD card connector */
//FIXME: Fix and test
#define SDIO_AF GPIO_AF12 #define SDIO_AF GPIO_AF12
#define SDIO_D0_PORT GPIOC #define SDIO_D0_PORT GPIOC
#define SDIO_D0_PIN GPIO8 #define SDIO_D0_PIN GPIO8
@@ -218,11 +220,12 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#endif #endif
#define USE_AD_TIM3 1 #define USE_AD_TIM3 1
// Internal ADC for voltage level measurement
// Internal ADC for battery ////FIXME: test and fix if still not working
#ifndef USE_ADC_1 #ifndef USE_ADC_1
#define USE_ADC_1 1 #define USE_ADC_1 1
#endif #endif
#if USE_ADC_1 #if USE_ADC_1
#define AD1_1_CHANNEL 4 //ADC12_IN4 #define AD1_1_CHANNEL 4 //ADC12_IN4
#define ADC_1 AD1_1 #define ADC_1 AD1_1
@@ -230,7 +233,8 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define ADC_1_GPIO_PIN GPIO4 #define ADC_1_GPIO_PIN GPIO4
#endif #endif
// External ADC for battery // Per default for the board to sense voltage level via external sensor on ADC
//FIXME: test and fix if still not working
#ifndef USE_ADC_2 #ifndef USE_ADC_2
#define USE_ADC_2 1 #define USE_ADC_2 1
#endif #endif
@@ -241,8 +245,7 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define ADC_2_GPIO_PIN GPIO2 #define ADC_2_GPIO_PIN GPIO2
#endif #endif
// Per default for the board to sense current via external sensor on ADC
// external current sens
#ifndef USE_ADC_3 #ifndef USE_ADC_3
#define USE_ADC_3 1 #define USE_ADC_3 1
#endif #endif
@@ -252,17 +255,24 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define ADC_3_GPIO_PORT GPIOA #define ADC_3_GPIO_PORT GPIOA
#define ADC_3_GPIO_PIN GPIO3 #define ADC_3_GPIO_PIN GPIO3
#endif #endif
#define MilliAmpereOfAdc(adc)((float)adc) * (3.3f / 4096.0f) * (90.0f / 5.0f) #define MilliAmpereOfAdc(adc)((float)adc) * (3.3f / 4096.0f) * (90.0f / 5.0f) //TODO: test if valid
/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/ /* Allow to define ADC_CHANNEL_VSUPPLY in the airframe file */
#ifndef ADC_CHANNEL_VSUPPLY #ifndef ADC_CHANNEL_VSUPPLY
#define ADC_CHANNEL_VSUPPLY ADC_2 #define ADC_CHANNEL_VSUPPLY ADC_2
#endif #endif
/* Allow to define another ADC for Current measurement in the airframe file */
#ifndef ADC_CHANNEL_CURRENT
#define ADC_CHANNEL_CURRENT ADC_3
#endif
//??FT = Five-volt tolerant. In order to sustain a voltage higher than VDD+0.3 the internal pull-up/pull-down resistors must be disabled.
//FIXME: Determine best stock values
#if USE_ADC_2 #if USE_ADC_2
#define DefaultVoltageOfAdc(adc) (0.00827*adc) #define DefaultVoltageOfAdc(adc) (0.004f * (float)adc) // FIXME: Value scale for a common PowerBrick
#else #else
#define DefaultVoltageOfAdc(adc) (0.0021*adc) // scale internal vdd to 5V #define DefaultVoltageOfAdc(adc) (0.004f * (float)adc) // FIXME: Value scale internal vdd to 5V
#endif #endif
/* I2C mapping */ /* I2C mapping */
@@ -270,12 +280,13 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define I2C1_GPIO_SCL GPIO8 #define I2C1_GPIO_SCL GPIO8
#define I2C1_GPIO_SDA GPIO9 #define I2C1_GPIO_SDA GPIO9
//Onboard Barometer
#ifndef USE_BARO_BOARD #ifndef USE_BARO_BOARD
#define USE_BARO_BOARD 1 #define USE_BARO_BOARD 1
#endif #endif
/* Another Magnetometer on board a HMC5983 not the one in the IMU 9250*/ /* Another Magnetometer on board a HMC5983 not the one in the IMU 9250*/
//TODO //FIXME: better default option for use of maybe fuse data
#ifndef USE_MAGNETOMETER_B #ifndef USE_MAGNETOMETER_B
#define USE_MAGNETOMETER_B 0 #define USE_MAGNETOMETER_B 0
#endif #endif
@@ -290,6 +301,10 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define PWM_USE_TIM1 1 #define PWM_USE_TIM1 1
#define PWM_USE_TIM4 1 #define PWM_USE_TIM4 1
//TODO: ifdef USE_SERVO6 for PPM out to e.g. servo extender board ...
// Basically a inter mcu Extra device;)
#define USE_PWM1 1 #define USE_PWM1 1
#define USE_PWM2 1 #define USE_PWM2 1
#define USE_PWM3 1 #define USE_PWM3 1
@@ -297,7 +312,7 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define USE_PWM5 1 #define USE_PWM5 1
#define USE_PWM6 1 #define USE_PWM6 1
/* -ESC Servo 1 */ /* Servo 1 */
#if USE_PWM1 #if USE_PWM1
#define PWM_SERVO_1 0 #define PWM_SERVO_1 0
#define PWM_SERVO_1_TIMER TIM1 #define PWM_SERVO_1_TIMER TIM1
@@ -310,7 +325,7 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define PWM_SERVO_1_OC_BIT 0 #define PWM_SERVO_1_OC_BIT 0
#endif #endif
/* -ESC Servo 2 */ /* Servo 2 */
#if USE_PWM2 #if USE_PWM2
#define PWM_SERVO_2 1 #define PWM_SERVO_2 1
#define PWM_SERVO_2_TIMER TIM1 #define PWM_SERVO_2_TIMER TIM1
@@ -323,7 +338,7 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define PWM_SERVO_2_OC_BIT 0 #define PWM_SERVO_2_OC_BIT 0
#endif #endif
/* -ESC Servo 3 */ /* Servo 3 */
#if USE_PWM3 #if USE_PWM3
#define PWM_SERVO_3 2 //#define PWM_SERVO_3_IDX 2 #define PWM_SERVO_3 2 //#define PWM_SERVO_3_IDX 2
#define PWM_SERVO_3_TIMER TIM1 #define PWM_SERVO_3_TIMER TIM1
@@ -336,7 +351,7 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define PWM_SERVO_3_OC_BIT 0 #define PWM_SERVO_3_OC_BIT 0
#endif #endif
/* -ESC Servo 4 */ /* Servo 4 */
#if USE_PWM4 #if USE_PWM4
#define PWM_SERVO_4 3 #define PWM_SERVO_4 3
#define PWM_SERVO_4_TIMER TIM1 #define PWM_SERVO_4_TIMER TIM1
@@ -349,7 +364,7 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define PWM_SERVO_4_OC_BIT 0 #define PWM_SERVO_4_OC_BIT 0
#endif #endif
/* -ESC Servo 5 */ /* Servo 5 */
#if USE_PWM5 #if USE_PWM5
#define PWM_SERVO_5 4 #define PWM_SERVO_5 4
#define PWM_SERVO_5_TIMER TIM4 #define PWM_SERVO_5_TIMER TIM4
@@ -362,7 +377,7 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define PWM_SERVO_5_OC_BIT 0 #define PWM_SERVO_5_OC_BIT 0
#endif #endif
/* -ESC Servo 6 */ /* Servo 6 */
#if USE_PWM6 #if USE_PWM6
#define PWM_SERVO_6 5 #define PWM_SERVO_6 5
#define PWM_SERVO_6_TIMER TIM4 #define PWM_SERVO_6_TIMER TIM4
@@ -379,7 +394,7 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define PWM_TIM4_CHAN_MASK (PWM_SERVO_5_OC_BIT|PWM_SERVO_6_OC_BIT) #define PWM_TIM4_CHAN_MASK (PWM_SERVO_5_OC_BIT|PWM_SERVO_6_OC_BIT)
/* Buzzer (A.k.a. Alarm) */ /* Buzzer (A.k.a. Alarm) */
//TODO: Test
#if USE_BUZZER #if USE_BUZZER
#define PWM_BUZZER #define PWM_BUZZER
#define PWM_BUZZER_TIMER TIM2 #define PWM_BUZZER_TIMER TIM2
@@ -393,6 +408,4 @@ When a read-operation of an RTD resistance data register occurs, DRDY returns hi
#define PWM_BUZZER_OC_BIT 0 #define PWM_BUZZER_OC_BIT 0
#endif #endif
#endif /* CONFIG_PX4FMU_4_0_H */ #endif /* CONFIG_PX4FMU_4_0_H */
+56 -8
View File
@@ -29,11 +29,59 @@ void periodic_auto1_commands(void)
{ {
// Copy Radio commands in AUTO1 // Copy Radio commands in AUTO1
if (autopilot_get_mode() == AP_MODE_AUTO1) { if (autopilot_get_mode() == AP_MODE_AUTO1) {
#ifdef COMMAND_HATCH #ifdef COMMAND_GEAR
#ifndef RADIO_HATCH #ifndef RADIO_GEAR
#error auto1_commands COMMAND_HATCH needs RADIO_HATCH channel #error auto1_commands COMMAND_GEAR needs RADIO_GEAR channel
#endif #endif
imcu_set_command(COMMAND_HATCH, imcu_get_radio(RADIO_HATCH)); imcu_set_command(COMMAND_GEAR, imcu_get_radio(RADIO_GEAR));
#endif
#ifdef COMMAND_FLAP
#ifndef RADIO_FLAP
#error auto1_commands COMMAND_FLAP needs RADIO_FLAP channel
#endif
imcu_set_command(COMMAND_FLAP, imcu_get_radio(RADIO_FLAP));
#endif
#ifdef COMMAND_AUX1
#ifndef RADIO_AUX1
#error auto1_commands COMMAND_AUX1 needs RADIO_AUX1 channel
#endif
imcu_set_command(COMMAND_AUX1, imcu_get_radio(RADIO_AUX1));
#endif
#ifdef COMMAND_AUX2
#ifndef RADIO_AUX2
#error auto1_commands COMMAND_AUX2 needs RADIO_AUX2 channel
#endif
imcu_set_command(COMMAND_AUX2, imcu_get_radio(RADIO_AUX2));
#endif
#ifdef COMMAND_AUX3
#ifndef RADIO_AUX3
#error auto1_commands COMMAND_AUX1 needs RADIO_AUX3 channel
#endif
imcu_set_command(COMMAND_AUX3, imcu_get_radio(RADIO_AUX3));
#endif
#ifdef COMMAND_AUX4
#ifndef RADIO_AUX4
#error auto1_commands COMMAND_AUX4 needs RADIO_AUX4 channel
#endif
imcu_set_command(COMMAND_AUX4, imcu_get_radio(RADIO_AUX4));
#endif
#ifdef COMMAND_AUX5
#ifndef RADIO_AUX5
#error auto1_commands COMMAND_AUX5 needs RADIO_AUX5 channel
#endif
imcu_set_command(COMMAND_AUX5, imcu_get_radio(RADIO_AUX5));
#endif
#ifdef COMMAND_AUX6
#ifndef RADIO_AUX6
#error auto1_commands COMMAND_AUX6 needs RADIO_AUX6 channel
#endif
imcu_set_command(COMMAND_AUX6, imcu_get_radio(RADIO_AUX6));
#endif
#ifdef COMMAND_AUX7
#ifndef RADIO_AUX7
#error auto1_commands COMMAND_AUX7 needs RADIO_AUX7 channel
#endif
imcu_set_command(COMMAND_AUX7, imcu_get_radio(RADIO_AUX7));
#endif #endif
#ifdef COMMAND_BRAKE #ifdef COMMAND_BRAKE
#ifndef RADIO_BRAKE #ifndef RADIO_BRAKE
@@ -41,11 +89,11 @@ void periodic_auto1_commands(void)
#endif #endif
imcu_set_command(COMMAND_BRAKE, imcu_get_radio(RADIO_BRAKE)); imcu_set_command(COMMAND_BRAKE, imcu_get_radio(RADIO_BRAKE));
#endif #endif
#ifdef COMMAND_FLAPS #ifdef COMMAND_HATCH
#ifndef RADIO_FLAPS #ifndef RADIO_HATCH
#error auto1_commands COMMAND_FLAPS needs RADIO_FLAPS channel #error auto1_commands COMMAND_HATCH needs RADIO_HATCH channel
#endif #endif
imcu_set_command(COMMAND_FLAPS, imcu_get_radio(RADIO_FLAPS)); imcu_set_command(COMMAND_HATCH, imcu_get_radio(RADIO_HATCH));
#endif #endif
} }
} }
+1 -1
View File
@@ -38,7 +38,7 @@ SERVERCMO = server_globals.cmo aircraft.cmo wind.cmo airprox.cmo kml.cmo fw_serv
SERVERCMX = $(SERVERCMO:.cmo=.cmx) SERVERCMX = $(SERVERCMO:.cmo=.cmx)
all: link server messages settings ivy_tcp_aircraft ivy_tcp_controller broadcaster ivy2udp ivy2serial ivy_serial_bridge app_server ivy2nmea all: link server messages settings ivy_tcp_aircraft ivy_tcp_controller broadcaster ivy2udp ivy2serial ivy_serial_bridge app_server ivy2nmea gpsd2ivy
opt: server.opt opt: server.opt