Merge branch 'dev' into 4.0_beta

* updated tests
* set quaternion setpoint in hover and attitude nav
This commit is contained in:
Felix Ruess
2012-03-25 17:25:26 +02:00
46 changed files with 1259 additions and 168 deletions
+1 -5
View File
@@ -238,7 +238,6 @@ clean:
$(Q)find . -mindepth 2 -name Makefile -exec sh -c 'echo "Cleaning {}"; $(MAKE) -C `dirname {}` $@' \;
$(Q)find . -name '*~' -exec rm -f {} \;
$(Q)rm -f paparazzi sw/simulator/launchsitl
$(Q)rm -rf tests/results/*
cleanspaces:
find ./sw/airborne -name '*.[ch]' -exec sed -i {} -e 's/[ \t]*$$//' \;
@@ -274,8 +273,5 @@ sw/simulator/launchsitl:
chmod a+x $@
test: all replace_current_conf_xml
cd tests; $(MAKE) $(@)
test_all_example_airframes: replace_current_conf_xml
cd tests; $(MAKE) $(@) TARGET_BOARD=examples
cd tests; $(MAKE) test
@@ -4,20 +4,282 @@
Powered via a plug 12V pack
Lisa/L v1.1 board
XBee connected to UART2 configured at 38400
Aspirin v1.5
overo
Booz2 v1.2
GPS connected to UART1 (Since this is inside in a metal box it won't ever get a solution)
-->
<airframe name="TestConfig">
<firmware name="rotorcraft">
<target name="sim" board="pc"/>
<target name="ap" board="lisa_l_1.1"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="telemetry" type="xbee_api">
<configure name="MODEM_BAUD" value="B38400"/>
</subsystem>
<subsystem name="control"/>
<subsystem name="navigation"/>
</firmware>
<firmware name="rotorcraft">
<target name="ap" board="lisa_l_1.1">
<!--define name="NO_RC_THRUST_LIMIT"/-->
<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"/>
<subsystem name="actuators" type="mkk"/>
<subsystem name="telemetry" type="transparent"/>
</target>
<target name="sim" board="pc">
<subsystem name="fdm" type="nps"/>
<subsystem name="radio_control" type="ppm"/>
<subsystem name="actuators" type="mkk"/>
</target>
<subsystem name="imu" type="aspirin_v1.5"/>
<subsystem name="gps" type="ublox">
<configure name="GPS_BAUD" value="B57600"/>
</subsystem>
<subsystem name="stabilization" type="euler"/>
<subsystem name="ahrs" type="int_cmpl_quat"/>
</firmware>
<!--
<firmware name="lisa_test_progs">
<target name="test_led" board="lisa_l_1.1"/>
<target name="test_uart" board="lisa_l_1.1"/>
<target name="test_servos" board="lisa_l_1.1"/>
<target name="test_telemetry" board="lisa_l_1.1"/>
<target name="test_baro" board="lisa_l_1.1"/>
<target name="test_imu_b2" board="lisa_l_1.1"/>
<target name="test_imu_b2_2" board="lisa_l_1.1"/>
<target name="test_imu_aspirin" board="lisa_l_1.1"/>
<target name="test_rc_spektrum" board="lisa_l_1.1"/>
<target name="test_rc_ppm" board="lisa_l_1.1"/>
<target name="test_adc" board="lisa_l_1.1"/>
<target name="test_hmc5843" board="lisa_l_1.1"/>
<target name="test_itg3200" board="lisa_l_1.1"/>
<target name="test_adxl345" board="lisa_l_1.1"/>
<target name="test_esc_mkk_simple" board="lisa_l_1.1"/>
<target name="test_esc_asctecv1_simple" board="lisa_l_1.1"/>
<target name="test_actuators_mkk" board="lisa_l_1.1"/>
<target name="test_actuators_asctecv1" board="lisa_l_1.1"/>
</firmware>
<firmware name="lisa_passthrough">
<target name="overo_test_passthrough" board="lisa_l_1.1" >
<configure name="HOST" value="A7"/>
<configure name="USER" value=""/>
<configure name="TARGET_DIR" value="~"/>
<configure name="PERIODIC_FREQ" value="512"/>
</target>
<target name="stm_passthrough" board="lisa_l_1.1">
<subsystem name="radio_control" type="spektrum"/>
<subsystem name="imu" type="b2_v1.2"/>
</target>
</firmware>
-->
<servos min="0" neutral="0" max="0xff">
<servo name="FRONT" no="0" min="0" neutral="0" max="255"/>
<servo name="BACK" no="1" min="0" neutral="0" max="255"/>
<servo name="RIGHT" no="2" min="0" neutral="0" max="255"/>
<servo name="LEFT" no="3" min="0" neutral="0" max="255"/>
</servos>
<commands>
<axis name="PITCH" failsafe_value="0"/>
<axis name="ROLL" failsafe_value="0"/>
<axis name="YAW" failsafe_value="0"/>
<axis name="THRUST" failsafe_value="0"/>
</commands>
<!-- for the sim -->
<section name="ACTUATORS_MKK" prefix="ACTUATORS_MKK_">
<define name="NB" value="4"/>
<define name="ADDR" value="{ 0x52, 0x54, 0x56, 0x58 }"/>
</section>
<section name="SUPERVISION" prefix="SUPERVISION_">
<define name="MIN_MOTOR" value="2"/>
<define name="MAX_MOTOR" value="210"/>
<define name="TRIM_A" value="0"/>
<define name="TRIM_E" value="0"/>
<define name="TRIM_R" value="0"/>
<define name="NB_MOTOR" value="4"/>
<define name="SCALE" value="256"/>
<define name="ROLL_COEF" value="{ 0, 0, -256, 256 }"/>
<define name="PITCH_COEF" value="{ 256, -256, 0, 0 }"/>
<define name="YAW_COEF" value="{ -256, -256, 256, 256 }"/>
<define name="THRUST_COEF" value="{ 256, 256, 256, 256 }"/>
</section>
<section name="IMU" prefix="IMU_">
<define name="GYRO_P_NEUTRAL" value="32581"/>
<define name="GYRO_Q_NEUTRAL" value="32008"/>
<define name="GYRO_R_NEUTRAL" value="33207"/>
<define name="GYRO_P_SENS" value=".903" integer="16"/>
<define name="GYRO_Q_SENS" value=".905" integer="16"/>
<define name="GYRO_R_SENS" value=".893" integer="16"/>
<define name="GYRO_PQ_SENS" value="0.0" integer="16"/>
<define name="GYRO_PR_SENS" value="0.0" integer="16"/>
<define name="GYRO_QR_SENS" value="0.0" integer="16"/>
<define name="ACCEL_X_NEUTRAL" value="25950"/>
<define name="ACCEL_Y_NEUTRAL" value="26351"/>
<define name="ACCEL_Z_NEUTRAL" value="25696"/>
<define name="ACCEL_X_SENS" value="1.86342150011" integer="16"/>
<define name="ACCEL_Y_SENS" value="1.88378993899" integer="16"/>
<define name="ACCEL_Z_SENS" value="1.86557913201" integer="16"/>
<define name="ACCEL_XY_SENS" value="0.0" integer="16"/>
<define name="ACCEL_XZ_SENS" value="0.0" integer="16"/>
<define name="ACCEL_YZ_SENS" value="0.0" integer="16"/>
<define name="MAG_X_NEUTRAL" value="0"/>
<define name="MAG_Y_NEUTRAL" value="0"/>
<define name="MAG_Z_NEUTRAL" value="0"/>
<define name="MAG_X_SENS" value="1." integer="16"/>
<define name="MAG_Y_SENS" value="1." integer="16"/>
<define name="MAG_Z_SENS" value="1." integer="16"/>
<define name="MAG_XY_SENS" value="0.0" integer="16"/>
<define name="MAG_XZ_SENS" value="0.0" integer="16"/>
<define name="MAG_YZ_SENS" value="0.0" integer="16"/>
<define name="BODY_TO_IMU_PHI" value="0." unit="deg"/>
<define name="BODY_TO_IMU_THETA" value="0." unit="deg"/>
<define name="BODY_TO_IMU_PSI" value="0." unit="deg"/>
</section>
<section name="AUTOPILOT">
<define name="MODE_AUTO1" value="AP_MODE_ATTITUDE_DIRECT"/>
<define name="MODE_MANUAL" value="AP_MODE_ATTITUDE_Z_HOLD"/>
<define name="MODE_AUTO2" value="AP_MODE_HOVER_Z_HOLD"/>
</section>
<section name="BAT">
<define name="CATASTROPHIC_BAT_LEVEL" value="12.4" unit="V"/>
<define name="MAX_BAT_LEVEL" value="16.8" unit="V" />
<define name="CRITIC_BAT_LEVEL" value="13.0" unit="V" />
<define name="LOW_BAT_LEVEL" value="14.0" unit="V" />
</section>
<section name="STABILIZATION_RATE" prefix="STABILIZATION_RATE_">
<define name="SP_MAX_P" value="10000"/>
<define name="SP_MAX_Q" value="10000"/>
<define name="SP_MAX_R" value="10000"/>
<define name="GAIN_P" value="-400"/>
<define name="GAIN_Q" value="-400"/>
<define name="GAIN_R" value="-350"/>
</section>
<section name="STABILIZATION_ATTITUDE" prefix="STABILIZATION_ATTITUDE_">
<!-- setpoints -->
<define name="SP_MAX_PHI" value="45." unit="deg"/>
<define name="SP_MAX_THETA" value="45." unit="deg"/>
<define name="SP_MAX_R" value="90." unit="deg/s"/>
<define name="DEADBAND_R" value="250"/>
<!-- reference -->
<define name="REF_OMEGA_P" value="800" unit="deg/s"/>
<define name="REF_ZETA_P" value="0.9"/>
<define name="REF_MAX_P" value="300." unit="deg/s"/>
<define name="REF_MAX_PDOT" value="RadOfDeg(7000.)"/>
<define name="REF_OMEGA_Q" value="800" unit="deg/s"/>
<define name="REF_ZETA_Q" value="0.9"/>
<define name="REF_MAX_Q" value="300." unit="deg/s"/>
<define name="REF_MAX_QDOT" value="RadOfDeg(7000.)"/>
<define name="REF_OMEGA_R" value="500" unit="deg/s"/>
<define name="REF_ZETA_R" value="0.9"/>
<define name="REF_MAX_R" value="180." unit="deg/s"/>
<define name="REF_MAX_RDOT" value="RadOfDeg(1800.)"/>
<!--
<define name="PHI_PGAIN" value="-2000"/>
<define name="PHI_DGAIN" value="-400"/>
<define name="PHI_IGAIN" value="-200"/>
<define name="THETA_PGAIN" value="-2000"/>
<define name="THETA_DGAIN" value="-400"/>
<define name="THETA_IGAIN" value="-200"/>
<define name="PSI_PGAIN" value="-2000"/>
<define name="PSI_DGAIN" value="-400"/>
<define name="PSI_IGAIN" value="-10"/>
<define name="PHI_DDGAIN" value=" 300"/>
<define name="THETA_DDGAIN" value=" 300"/>
<define name="PSI_DDGAIN" value=" 300"/>
-->
<!-- feedback -->
<define name="PHI_PGAIN" value="-900"/>
<define name="PHI_DGAIN" value="-200"/>
<define name="PHI_IGAIN" value="-200"/>
<define name="THETA_PGAIN" value="-900"/>
<define name="THETA_DGAIN" value="-200"/>
<define name="THETA_IGAIN" value="-200"/>
<define name="PSI_PGAIN" value="-900"/>
<define name="PSI_DGAIN" value="-200"/>
<define name="PSI_IGAIN" value="-10"/>
<!-- feedforward -->
<define name="PHI_DDGAIN" value=" 200"/>
<define name="THETA_DDGAIN" value=" 200"/>
<define name="PSI_DDGAIN" value=" 200"/>
</section>
<section name="AHRS" prefix="AHRS_">
<define name="PROPAGATE_FREQUENCY" value="512"/>
<define name="H_X" value=" 0.3723657"/>
<define name="H_Y" value=" 0.1515225"/>
<define name="H_Z" value="-0.9156335"/>
</section>
<section name="INS" prefix="INS_">
<define name="BARO_SENS" value="10." integer="16"/>
</section>
<section name="GUIDANCE_V" prefix="GUIDANCE_V_">
<define name="MIN_ERR_Z" value="POS_BFP_OF_REAL(-10.)"/>
<define name="MAX_ERR_Z" value="POS_BFP_OF_REAL( 10.)"/>
<define name="MIN_ERR_ZD" value="SPEED_BFP_OF_REAL(-10.)"/>
<define name="MAX_ERR_ZD" value="SPEED_BFP_OF_REAL( 10.)"/>
<define name="MAX_SUM_ERR" value="2000000"/>
<define name="HOVER_KP" value="-150"/>
<define name="HOVER_KD" value="-80"/>
<define name="HOVER_KI" value="0"/>
<!--
<define name="HOVER_KP" value="-150"/>
<define name="HOVER_KD" value="-80"/>
<define name="HOVER_KI" value="0"/>
-->
<!-- 1.5m/s for full stick : BOOZ_SPEED_I_OF_F(1.5) / (MAX_PPRZ/2) -->
<define name="RC_CLIMB_COEF" value ="163"/>
<!-- BOOZ_SPEED_I_OF_F(1.5) * 20% -->
<define name="RC_CLIMB_DEAD_BAND" value ="160000"/>
<!-- <define name="INV_M" value ="0.2"/> -->
</section>
<section name="GUIDANCE_H" prefix="GUIDANCE_H_">
<define name="PGAIN" value="-100"/>
<define name="DGAIN" value="-100"/>
<define name="IGAIN" value="-0"/>
<define name="NGAIN" value="-0"/>
</section>
<section name="MISC">
<define name="FACE_REINJ_1" value="1024"/>
</section>
<section name="SIMULATOR" prefix="NPS_">
<define name="ACTUATOR_NAMES" value="{&quot;front_motor&quot;, &quot;back_motor&quot;, &quot;right_motor&quot;, &quot;left_motor&quot;}"/>
<define name="INITIAL_CONDITITONS" value="&quot;reset00&quot;"/>
<define name="SENSORS_PARAMS" value="&quot;nps_sensors_params_booz2_a1.h&quot;"/>
</section>
</airframe>
+8
View File
@@ -59,8 +59,16 @@ ifndef SYS_TIME_LED
SYS_TIME_LED = 1
endif
#
# default uart configuration
#
ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT
RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3
endif
ifndef RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT
RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5
endif
ifndef MODEM_PORT
MODEM_PORT=UART2
+106 -2
View File
@@ -1,11 +1,115 @@
# Hey Emacs, this is a -*- makefile -*-
#
# lisa_l_1.1.makefile
#
# http://paparazzi.enac.fr/wiki/User/LisaL
#
include $(PAPARAZZI_SRC)/conf/boards/lisa_l_1.0.makefile
# we are actually still using the Lisa/L 1.0 header file
BOARD=lisa_l
BOARD_VERSION=1.0
BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\"
# -----------------------------------------------------------------------
ifeq ($(BOARD_PROCESSOR),'omap')
ARCH = omap
$(TARGET).LDFLAGS += -levent -lm
# -----------------------------------------------------------------------
else
ARCH=stm32
$(TARGET).ARCHDIR = $(ARCH)
# not needed?
endif
# -----------------------------------------------------------------------
ifndef FLASH_MODE
FLASH_MODE = JTAG
endif
#
#
# some default values shared between different firmwares
#
#
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = 5
endif
ifndef BARO_LED
BARO_LED = none
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = 7
endif
ifndef GPS_LED
GPS_LED = 3
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = 1
endif
#
# default uart configuration
#
ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT
RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3
endif
ifndef RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT
RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5
endif
ifndef MODEM_PORT
MODEM_PORT=UART2
endif
ifndef MODEM_BAUD
MODEM_BAUD=B57600
endif
ifndef GPS_PORT
GPS_PORT=UART1
endif
ifndef GPS_BAUD
GPS_BAUD=B38400
endif
#
# this is the DRDY pin of a max1168 on a booz IMU
#
# v1.1
# v 1.1
#
MAX_1168_DRDY_PORT = _GPIOB
MAX_1168_DRDY_PORT_SOURCE = PortSourceGPIOB
# v1.1
#MAX_1168_DRDY_PORT = GPIOB
ifndef ADC_IR1
ADC_IR1 = 1
ADC_IR1_CHAN = 0
endif
ifndef ADC_IR2
ADC_IR2 = 2
ADC_IR2_CHAN = 1
endif
ifndef ADC_IR3
ADC_IR_TOP = 4
ADC_IR_TOP_CHAN = 3
endif
ifndef ADC_IR_NB_SAMPLES
ADC_IR_NB_SAMPLES = 16
endif
+3 -11
View File
@@ -52,6 +52,9 @@ ifndef SYS_TIME_LED
SYS_TIME_LED = 1
endif
#
# default uart configuration
#
ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT
RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART3
endif
@@ -76,17 +79,6 @@ GPS_BAUD=B38400
endif
#
# this is the DRDY pin of a max1168 on a booz IMU
#
# v 1.0
#
MAX_1168_DRDY_PORT = _GPIOD
MAX_1168_DRDY_PORT_SOURCE = PortSourceGPIOD
# v1.1
#MAX_1168_DRDY_PORT = GPIOB
ifndef ADC_IR1
ADC_IR1 = 1
+87 -2
View File
@@ -1,12 +1,97 @@
# Hey Emacs, this is a -*- makefile -*-
#
# lisa_m_2.0.makefile
#
# http://paparazzi.enac.fr/wiki/Lisa/M
#
BOARD=lisa_m
BOARD_VERSION=1.0
BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\"
ARCH=stm32
$(TARGET).ARCHDIR = $(ARCH)
# not needed?
$(TARGET).OOCD_INTERFACE=flossjtag
#$(TARGET).OOCD_INTERFACE=jtagkey-tiny
# -----------------------------------------------------------------------
ifndef FLASH_MODE
FLASH_MODE = JTAG
#FLASH_MODE = SERIAL
endif
#
# Swap GPS UART with spektrum UART
#
# some default values shared between different firmwares
#
#
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = none
endif
ifndef BARO_LED
BARO_LED = none
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = none
endif
ifndef GPS_LED
GPS_LED = none
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = 1
endif
#
# default uart configuration
#
ifndef RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT
RADIO_CONTROL_SPEKTRUM_PRIMARY_PORT = UART1
endif
ifndef RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT
RADIO_CONTROL_SPEKTRUM_SECONDARY_PORT = UART5
endif
ifndef MODEM_PORT
MODEM_PORT=UART2
endif
ifndef MODEM_BAUD
MODEM_BAUD=B57600
endif
ifndef GPS_PORT
GPS_PORT=UART3
endif
ifndef GPS_BAUD
GPS_BAUD=B38400
endif
include $(PAPARAZZI_SRC)/conf/boards/lisa_m_1.0.makefile
ifndef ADC_IR1
ADC_IR1 = 1
ADC_IR1_CHAN = 0
endif
ifndef ADC_IR2
ADC_IR2 = 2
ADC_IR2_CHAN = 1
endif
ifndef ADC_IR3
ADC_IR_TOP = 4
ADC_IR_TOP_CHAN = 3
endif
ifndef ADC_IR_NB_SAMPLES
ADC_IR_NB_SAMPLES = 16
endif
+3 -1
View File
@@ -44,7 +44,9 @@ SYS_TIME_LED = none
endif
### default settings
#
# default uart settings
#
ifndef GPS_PORT
GPS_PORT = UART0
endif
+70 -6
View File
@@ -4,17 +4,81 @@
# http://paparazzi.enac.fr/wiki/Tiny_v0.99
#
include $(PAPARAZZI_SRC)/conf/boards/tiny_2.11.makefile
ARCH=lpc21
BOARD=tiny
BOARD_VERSION=0.99
BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\"
GPS_PORT = UART1
GPS_LED = none
MODEM_PORT = UART0
ifndef FLASH_MODE
FLASH_MODE = IAP
endif
LPC21ISP_BAUD = 38400
LPC21ISP_XTAL = 12000
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = none
endif
ifndef BARO_LED
BARO_LED = none
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = none
endif
ifndef GPS_LED
GPS_LED = none
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = none
endif
#
# default uart settings
#
ifndef GPS_PORT
GPS_PORT = UART1
endif
ifndef GPS_BAUD
GPS_BAUD = B38400
endif
ifndef MODEM_PORT
MODEM_PORT = UART0
endif
ifndef MODEM_BAUD
MODEM_BAUD = B57600
endif
ADC_IR_TOP = ADC_0
ADC_IR1 = ADC_1
ADC_IR2 = ADC_2
ADC_IR_NB_SAMPLES = 16
ADC_GYRO_NB_SAMPLES = 16
ADC_GENERIC_NB_SAMPLES = 16
#
# you can use different actuators by adding a configure option to your firmware section
# e.g. <configure name="ACTUATORS" value="actuators_ppm/>
#
ifndef ACTUATORS
ACTUATORS = actuators_4015
endif
# All targets on the TINY board run on the same processor achitecture
$(TARGET).ARCHDIR = $(ARCH)
+65 -6
View File
@@ -3,9 +3,7 @@
#
# http://paparazzi.enac.fr/wiki/Tiny_v1.1
#
include $(PAPARAZZI_SRC)/conf/boards/tiny_2.11.makefile
ARCH=lpc21
BOARD=tiny
@@ -13,8 +11,69 @@ BOARD_VERSION=1.1
BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\"
GPS_PORT = UART1
GPS_LED = none
MODEM_PORT = UART0
ifndef FLASH_MODE
FLASH_MODE = IAP
endif
LPC21ISP_BAUD = 38400
LPC21ISP_XTAL = 12000
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = none
endif
ifndef BARO_LED
BARO_LED = none
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = none
endif
ifndef GPS_LED
GPS_LED = none
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = none
endif
ifndef GPS_PORT
GPS_PORT = UART1
endif
ifndef GPS_BAUD
GPS_BAUD = B38400
endif
ifndef MODEM_PORT
MODEM_PORT = UART0
endif
ifndef MODEM_BAUD
MODEM_BAUD = B57600
endif
ADC_IR_TOP = ADC_0
ADC_IR1 = ADC_1
ADC_IR2 = ADC_2
ADC_IR_NB_SAMPLES = 16
ADC_GYRO_NB_SAMPLES = 16
ADC_GENERIC_NB_SAMPLES = 16
#
# you can use different actuators by adding a configure option to your firmware section
# e.g. <configure name="ACTUATORS" value="actuators_ppm/>
#
ifndef ACTUATORS
ACTUATORS = actuators_4015
endif
# All targets on the TINY board run on the same processor achitecture
$(TARGET).ARCHDIR = $(ARCH)
+71 -2
View File
@@ -4,11 +4,80 @@
# http://paparazzi.enac.fr/wiki/Tiny_v2
#
include $(PAPARAZZI_SRC)/conf/boards/tiny_2.11.makefile
ARCH=lpc21
BOARD=tiny
BOARD_VERSION=2.1
BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\"
ifndef FLASH_MODE
FLASH_MODE = IAP
endif
LPC21ISP_BAUD = 38400
LPC21ISP_XTAL = 12000
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = none
endif
ifndef BARO_LED
BARO_LED = none
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = none
endif
ifndef GPS_LED
GPS_LED = 2
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = none
endif
#
# default uart settings
#
ifndef GPS_PORT
GPS_PORT = UART0
endif
ifndef GPS_BAUD
GPS_BAUD = B38400
endif
ifndef MODEM_PORT
MODEM_PORT = UART1
endif
ifndef MODEM_BAUD
MODEM_BAUD = B57600
endif
ADC_IR_TOP = ADC_0
ADC_IR1 = ADC_1
ADC_IR2 = ADC_2
ADC_IR_NB_SAMPLES = 16
ADC_GYRO_NB_SAMPLES = 16
ADC_GENERIC_NB_SAMPLES = 16
#
# you can use different actuators by adding a configure option to your firmware section
# e.g. <configure name="ACTUATORS" value="actuators_ppm/>
#
ifndef ACTUATORS
ACTUATORS = actuators_4017
endif
# All targets on the TINY board run on the same processor achitecture
$(TARGET).ARCHDIR = $(ARCH)
+14 -3
View File
@@ -11,6 +11,7 @@ BOARD_VERSION=2.11
BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\"
ifndef FLASH_MODE
FLASH_MODE = IAP
endif
@@ -42,7 +43,10 @@ ifndef SYS_TIME_LED
SYS_TIME_LED = none
endif
### default settings for tiny_2 and twog
#
# default uart settings
#
ifndef GPS_PORT
GPS_PORT = UART0
endif
@@ -66,7 +70,14 @@ ADC_GYRO_NB_SAMPLES = 16
ADC_GENERIC_NB_SAMPLES = 16
#
# you can use different actuators by adding a configure option to your firmware section
# e.g. <configure name="ACTUATORS" value="actuators_ppm/>
#
ifndef ACTUATORS
ACTUATORS = actuators_4017
endif
# All targets on the TINY board run on the same processor achitecture
$(TARGET).ARCHDIR = $(ARCH)
ACTUATORS = actuators_4017
+72 -1
View File
@@ -4,9 +4,80 @@
# http://paparazzi.enac.fr/wiki/Twog_v1
#
include $(PAPARAZZI_SRC)/conf/boards/tiny_2.11.makefile
ARCH=lpc21
BOARD=twog
BOARD_VERSION=1.0
BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\"
ifndef FLASH_MODE
FLASH_MODE = IAP
endif
LPC21ISP_BAUD = 38400
LPC21ISP_XTAL = 12000
#
# default LED configuration
#
ifndef RADIO_CONTROL_LED
RADIO_CONTROL_LED = none
endif
ifndef BARO_LED
BARO_LED = none
endif
ifndef AHRS_ALIGNER_LED
AHRS_ALIGNER_LED = none
endif
ifndef GPS_LED
GPS_LED = 2
endif
ifndef SYS_TIME_LED
SYS_TIME_LED = none
endif
#
# default uart settings
#
ifndef GPS_PORT
GPS_PORT = UART0
endif
ifndef GPS_BAUD
GPS_BAUD = B38400
endif
ifndef MODEM_PORT
MODEM_PORT = UART1
endif
ifndef MODEM_BAUD
MODEM_BAUD = B57600
endif
ADC_IR_TOP = ADC_0
ADC_IR1 = ADC_1
ADC_IR2 = ADC_2
ADC_IR_NB_SAMPLES = 16
ADC_GYRO_NB_SAMPLES = 16
ADC_GENERIC_NB_SAMPLES = 16
#
# you can use different actuators by adding a configure option to your firmware section
# e.g. <configure name="ACTUATORS" value="actuators_ppm/>
#
ifndef ACTUATORS
ACTUATORS = actuators_4017
endif
# All targets on the TINY board run on the same processor achitecture
$(TARGET).ARCHDIR = $(ARCH)
-2
View File
@@ -1,2 +0,0 @@
# print error because of rename
$(error Please rename the board from "twog_1" to twog_1.0", e.g. <target name="ap" board="twog_1.0"/> in your airframe config!)
+15 -3
View File
@@ -11,6 +11,7 @@ BOARD_VERSION=1.0
BOARD_CFG=\"boards/$(BOARD)_$(BOARD_VERSION).h\"
ifndef FLASH_MODE
FLASH_MODE = IAP
endif
@@ -44,7 +45,9 @@ SYS_TIME_LED = none
endif
### default settings
#
# default uart settings
#
ifndef GPS_PORT
GPS_PORT = UART0
endif
@@ -59,9 +62,18 @@ ifndef MODEM_BAUD
MODEM_BAUD = B57600
endif
ADC_GENERIC_NB_SAMPLES = 16
#
# you can use different actuators by adding a configure option to your firmware section
# e.g. <configure name="ACTUATORS" value="actuators_ppm/>
#
ifndef ACTUATORS
ACTUATORS = actuators_4017
endif
# All targets on the Umarim board run on the same processor achitecture
$(TARGET).ARCHDIR = $(ARCH)
ACTUATORS = actuators_4017
+10
View File
@@ -89,4 +89,14 @@
settings="settings/settings_booz2.xml"
gui_color="white"
/>
<aircraft
name="LisaLv11_Aspirinv15_Overo_RC"
ac_id="10"
airframe="airframes/TestHardware/LisaL_v1.1_aspirin_v1.5_overo_rc.xml"
radio="radios/cockpitSX.xml"
telemetry="telemetry/telemetry_booz2.xml"
flight_plan="flight_plans/dummy.xml"
settings="settings/settings_booz2.xml"
gui_color="white"
/>
</conf>
+25 -2
View File
@@ -1,9 +1,32 @@
/*
* Copyright (C) 2010-2012 The Paparazzi Team
*
* 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 actuators.h
* Generic Actuators API.
*/
#ifndef ACTUATORS_H
#define ACTUATORS_H
//#include ACTUATORS
//#include "booz2_servos_direct_hw.h"
//#include "booz2_control_surfaces.h"
#include "std.h"
@@ -1,3 +1,28 @@
/*
* 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.
*/
/** @file actuators_asctec.c
* Actuators driver for Asctec motor controllers.
*/
#include "firmwares/rotorcraft/actuators.h"
#include "firmwares/rotorcraft/actuators/actuators_asctec.h"
@@ -1,6 +1,4 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* This file is part of paparazzi.
@@ -21,26 +19,30 @@
* Boston, MA 02111-1307, USA.
*/
/** @file actuators_asctec.h
* Actuators driver for Asctec motor controllers.
*/
#ifndef ACTUATORS_ASCTEC_H
#define ACTUATORS_ASCTEC_H
#include "mcu_periph/i2c.h"
enum actuators_astec_cmd { NONE,
TEST,
REVERSE,
SET_ADDR };
TEST,
REVERSE,
SET_ADDR };
enum actuators_astec_addr { FRONT,
BACK,
LEFT,
RIGHT };
BACK,
LEFT,
RIGHT };
/* this is for the v1 protocol which does its own mixing */
enum actuators_astec_cmds { PITCH,
ROLL,
YAW,
THRUST,
ROLL,
YAW,
THRUST,
CMD_NB };
struct ActuatorsAsctec {
@@ -56,16 +58,16 @@ struct ActuatorsAsctec {
extern struct ActuatorsAsctec actuators_asctec;
#define actuators_asctec_SetCommand(_v) { \
actuators_asctec.cmd = _v; \
}
actuators_asctec.cmd = _v; \
}
#define actuators_asctec_SetNewAddr(_v) { \
actuators_asctec.new_addr = _v; \
}
#define actuators_asctec_SetNewAddr(_v) { \
actuators_asctec.new_addr = _v; \
}
#define actuators_asctec_SetCurAddr(_v) { \
actuators_asctec.cur_addr = _v; \
}
#define actuators_asctec_SetCurAddr(_v) { \
actuators_asctec.cur_addr = _v; \
}
#endif /* ACTUATORS_ASCTEC_H */
@@ -1,6 +1,4 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* This file is part of paparazzi.
@@ -21,6 +19,10 @@
* Boston, MA 02111-1307, USA.
*/
/** @file actuators_mkk.c
* Actuators driver for Mikrokopter motor controllers.
*/
#include "firmwares/rotorcraft/actuators.h"
#include "firmwares/rotorcraft/actuators/actuators_mkk.h"
@@ -1,6 +1,4 @@
/*
* $Id: actuators_mkk.h 3847 2009-08-02 21:47:31Z poine $
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* This file is part of paparazzi.
@@ -21,6 +19,10 @@
* Boston, MA 02111-1307, USA.
*/
/** @file actuators_mkk.h
* Actuators driver for Mikrokopter motor controllers.
*/
#ifndef ACTUATORS_MKK_H
#define ACTUATORS_MKK_H
@@ -1,7 +1,5 @@
/*
* $Id$
*
* Copyright (C) 2010 The Paparazzi Team
* Copyright (C) 2010-2012 The Paparazzi Team
*
* This file is part of paparazzi.
*
@@ -21,6 +19,10 @@
* Boston, MA 02111-1307, USA.
*/
/** @file actuators_pwm_supervision.h
* PWM actuators with supervision.
*/
#include "firmwares/rotorcraft/actuators.h"
#include "firmwares/rotorcraft/commands.h"
#include "actuators_pwm_supervision.h"
@@ -48,7 +50,6 @@ void actuators_init(void)
void actuators_set(bool_t motors_on) {
int32_t pwm_commands[COMMANDS_NB];
int32_t pwm_commands_pprz[COMMANDS_NB];
int32_t booz2_commands[COMMANDS_NB];
pwm_commands[COMMAND_ROLL] = commands[COMMAND_ROLL] * PWM_GAIN_SCALE;
pwm_commands[COMMAND_PITCH] = commands[COMMAND_PITCH] * PWM_GAIN_SCALE;
@@ -1,7 +1,5 @@
/*
* $Id: actuators_pwm_supervision$
*
* Copyright (C) 2010 The Paparazzi Team
* Copyright (C) 2010-2012 The Paparazzi Team
*
* This file is part of paparazzi.
*
@@ -19,7 +17,10 @@
* 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 actuators_pwm_supervision.h
* PWM actuators with supervision.
*/
#ifndef ACTUATORS_PWM_SUPERVISION_H
@@ -19,6 +19,10 @@
* Boston, MA 02111-1307, USA.
*/
/** @file actuators_skiron.c
* Skiron motor speed controller by Michel.
*/
#include "firmwares/rotorcraft/actuators.h"
#include "firmwares/rotorcraft/actuators/actuators_skiron.h"
@@ -19,7 +19,9 @@
* Boston, MA 02111-1307, USA.
*/
/* Skiron motor speed controller by Michel */
/** @file actuators_skiron.h
* Skiron motor speed controller by Michel.
*/
#ifndef ACTUATORS_SKIRON_H
#define ACTUATORS_SKIRON_H
@@ -1,6 +1,4 @@
/*
* $Id$
*
* Copyright (C) 2010 The Paparazzi Team
*
* This file is part of Paparazzi.
@@ -19,7 +17,10 @@
* 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 arch/stm32/actuators_pwm_arch.c
* STM32 PWM servos handling
*/
#include "firmwares/rotorcraft/actuators/actuators_pwm.h"
@@ -1,6 +1,4 @@
/*
* $Id$
*
* Copyright (C) 2010 The Paparazzi Team
*
* This file is part of Paparazzi.
@@ -19,11 +17,10 @@
* 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.
*
*/
/*
* STM32 PWM servos handling
/** @file arch/stm32/actuators_pwm_arch.h
* STM32 PWM servos handling
*/
#ifndef ACTUATORS_PWM_ARCH_H
@@ -1,7 +1,5 @@
/*
* $Id$
*
* Copyright (C) 2008-2010 The Paparazzi Team
* Copyright (C) 2008-2012 The Paparazzi Team
*
* This file is part of Paparazzi.
*
@@ -19,7 +17,12 @@
* 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 supervision.c
* Supervision.
* Handles the mapping of roll/pitch/yaw commands
* to actual motor commands.
*/
#include "firmwares/rotorcraft/actuators/supervision.h"
@@ -1,3 +1,30 @@
/*
* Copyright (C) 2008-2012 The Paparazzi Team
*
* 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 supervision.h
* Supervision.
* Handles the mapping of roll/pitch/yaw commands
* to actual motor commands.
*/
#ifndef SUPERVISION_H
#define SUPERVISION_H
@@ -1,6 +1,4 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* This file is part of paparazzi.
@@ -21,6 +19,11 @@
* Boston, MA 02111-1307, USA.
*/
/** @file firmware/rotorcraft/guidance/guidance_h.c
* Horizontal guidance for rotorcrafts.
*
*/
#define GUIDANCE_H_C
//#define GUIDANCE_H_USE_REF 1
#include "firmwares/rotorcraft/guidance/guidance_h.h"
@@ -216,6 +219,9 @@ void guidance_h_run(bool_t in_flight) {
#ifndef STABILISATION_ATTITUDE_TYPE_FLOAT
stab_att_sp_euler.phi = nav_roll << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC);
stab_att_sp_euler.theta = nav_pitch << (REF_ANGLE_FRAC - INT32_ANGLE_FRAC);
#ifdef STABILISATION_ATTITUDE_TYPE_QUAT
INT32_QUAT_OF_EULERS(stab_att_sp_quat, stab_att_sp_euler);
#endif
#endif
}
else {
@@ -302,6 +308,9 @@ __attribute__ ((always_inline)) static inline void guidance_h_hover_run(void) {
#endif /* STABILISATION_ATTITUDE_TYPE_FLOAT */
EULERS_COPY(stab_att_sp_euler, guidance_h_command_body);
#ifdef STABILISATION_ATTITUDE_TYPE_QUAT
INT32_QUAT_OF_EULERS(stab_att_sp_quat, stab_att_sp_euler);
#endif
}
@@ -1,6 +1,4 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* This file is part of paparazzi.
@@ -21,6 +19,11 @@
* Boston, MA 02111-1307, USA.
*/
/** @file firmware/rotorcraft/guidance/guidance_h.h
* Horizontal guidance for rotorcrafts.
*
*/
#ifndef GUIDANCE_H_H
#define GUIDANCE_H_H
@@ -39,9 +42,12 @@
extern uint8_t guidance_h_mode;
/* horizontal setpoint in NED */
/* Q_int32_xx_8 */
/** horizontal position setpoint in NED.
* fixed point representation: Q23.8
* accuracy 0.0039, range 8388km
*/
extern struct Int32Vect2 guidance_h_pos_sp;
extern int32_t guidance_h_psi_sp;
extern struct Int32Vect2 guidance_h_pos_ref;
extern struct Int32Vect2 guidance_h_speed_ref;
@@ -53,7 +59,7 @@ extern struct Int32Vect2 guidance_h_pos_err_sum;
extern struct Int32Vect2 guidance_h_nav_err;
extern struct Int32Eulers guidance_h_rc_sp;
extern struct Int32Vect2 guidance_h_command_earth;
extern struct Int32Vect2 guidance_h_command_earth;
extern struct Int32Eulers guidance_h_command_body;
extern int32_t guidance_h_pgain;
@@ -1,6 +1,4 @@
/*
* $Id: guidance_v_ref.h 4173 2009-09-18 11:57:21Z flixr $
*
* Copyright (C) 2008-2009 ENAC <poinix@gmail.com>
*
* This file is part of paparazzi.
@@ -21,6 +19,11 @@
* Boston, MA 02111-1307, USA.
*/
/** @file firmware/rotorcraft/guidance/guidance_h_ref.h
* Reference generation for horizontal guidance.
*
*/
#ifndef GUIDANCE_H_REF_H
#define GUIDANCE_H_REF_H
@@ -1,6 +1,4 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* This file is part of paparazzi.
@@ -21,6 +19,11 @@
* Boston, MA 02111-1307, USA.
*/
/** @file firmwares/rotorcraft/guidance/guidance_v.c
* Vertical guidance for rotorcrafts.
*
*/
#define GUIDANCE_V_C
#define GUIDANCE_V_USE_REF 1
#include "firmwares/rotorcraft/guidance/guidance_v.h"
@@ -53,7 +56,7 @@ int32_t guidance_v_delta_t;
/** Direct throttle from radio control.
* range 0:200
* range 0:#MAX_PPRZ
*/
int32_t guidance_v_rc_delta_t;
@@ -136,8 +139,9 @@ void guidance_v_mode_changed(uint8_t new_mode) {
}
void guidance_v_notify_in_flight( bool_t in_flight) {
if (in_flight)
if (in_flight) {
gv_adapt_init();
}
}
@@ -166,8 +170,9 @@ void guidance_v_run(bool_t in_flight) {
case GUIDANCE_V_MODE_CLIMB:
#if USE_FMS
if (fms.enabled && fms.input.v_mode == GUIDANCE_V_MODE_CLIMB)
if (fms.enabled && fms.input.v_mode == GUIDANCE_V_MODE_CLIMB) {
guidance_v_zd_sp = fms.input.v_sp.climb;
}
#endif
gv_update_ref_from_zd_sp(guidance_v_zd_sp);
run_hover_loop(in_flight);
@@ -175,7 +180,7 @@ void guidance_v_run(bool_t in_flight) {
stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t;
#else
// saturate max authority with RC stick
stabilization_cmd[COMMAND_THRUST] = Min( guidance_v_rc_delta_t, guidance_v_delta_t);
stabilization_cmd[COMMAND_THRUST] = Min(guidance_v_rc_delta_t, guidance_v_delta_t);
#endif
break;
@@ -190,7 +195,7 @@ void guidance_v_run(bool_t in_flight) {
stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t;
#else
// saturate max authority with RC stick
stabilization_cmd[COMMAND_THRUST] = Min( guidance_v_rc_delta_t, guidance_v_delta_t);
stabilization_cmd[COMMAND_THRUST] = Min(guidance_v_rc_delta_t, guidance_v_delta_t);
#endif
break;
@@ -216,7 +221,7 @@ void guidance_v_run(bool_t in_flight) {
#else
/* use rc limitation if available */
if (radio_control.status == RC_OK)
stabilization_cmd[COMMAND_THRUST] = Min( guidance_v_rc_delta_t, guidance_v_delta_t);
stabilization_cmd[COMMAND_THRUST] = Min(guidance_v_rc_delta_t, guidance_v_delta_t);
else
stabilization_cmd[COMMAND_THRUST] = guidance_v_delta_t;
#endif
@@ -19,6 +19,11 @@
* Boston, MA 02111-1307, USA.
*/
/** @file firmwares/rotorcraft/guidance/guidance_v.h
* Vertical guidance for rotorcrafts.
*
*/
#ifndef GUIDANCE_V
#define GUIDANCE_V
@@ -82,7 +87,12 @@ extern int32_t guidance_v_zdd_ref;
extern int32_t guidance_v_z_sum_err; ///< accumulator for I-gain
extern int32_t guidance_v_ff_cmd; ///< feed-forward command
extern int32_t guidance_v_fb_cmd; ///< feed-back command
extern int32_t guidance_v_delta_t; ///< command output (ff+fb)
/** thrust command.
* summation of feed-forward and feed-back commands,
* valid range 0 : #MAX_PPRZ
*/
extern int32_t guidance_v_delta_t;
extern int32_t guidance_v_kp; ///< vertical control P-gain
extern int32_t guidance_v_kd; ///< vertical control D-gain
@@ -19,6 +19,11 @@
* Boston, MA 02111-1307, USA.
*/
/** @file firwmares/rotorcraft/guidance/guidance_v_ref.h
* Reference generation for vertical guidance.
*
*/
#ifndef GUIDANCE_V_REF_H
#define GUIDANCE_V_REF_H
@@ -1,6 +1,4 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* This file is part of paparazzi.
@@ -21,6 +19,10 @@
* Boston, MA 02111-1307, USA.
*/
/** @file firmwares/rotorcraft/stabilization.c
* General stabilization interface for rotorcrafts.
*/
#include "firmwares/rotorcraft/stabilization.h"
int32_t stabilization_cmd[COMMANDS_NB];
@@ -1,6 +1,4 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* This file is part of paparazzi.
@@ -21,6 +19,10 @@
* Boston, MA 02111-1307, USA.
*/
/** @file firmwares/rotorcraft/stabilization.h
* General stabilization interface for rotorcrafts.
*/
#ifndef STABILIZATION_H
#define STABILIZATION_H
@@ -35,6 +37,11 @@
extern void stabilization_init(void);
/** Stabilization commands.
* Contains the resulting stabilization commands,
* regardless of whether rate or attitude is currently used.
* Range -MAX_PPRZ:MAX_PPRZ
*/
extern int32_t stabilization_cmd[COMMANDS_NB];
#endif /* STABILIZATION_H */
@@ -1,8 +1,5 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
* Copyright (C) 2010 Felix Ruess <felix.ruess@gmail.com>
* Copyright (C) 2011-2012 The Paparazzi Team
*
* This file is part of paparazzi.
*
@@ -22,6 +19,13 @@
* Boston, MA 02111-1307, USA.
*/
/** @file stabilization_none.c
* Dummy stabilization for rotorcrafts.
*
* Doesn't actually do any stabilization,
* just directly passes the RC commands along.
*/
#include "firmwares/rotorcraft/stabilization.h"
#include "firmwares/rotorcraft/stabilization/stabilization_none.h"
@@ -42,19 +46,13 @@
struct Int32Rates stabilization_none_rc_cmd;
void stabilization_none_init(void) {
INT_RATES_ZERO(stabilization_none_rc_cmd);
}
void stabilization_none_read_rc( void ) {
stabilization_none_rc_cmd.p = (int32_t)radio_control.values[RADIO_ROLL];
stabilization_none_rc_cmd.q = (int32_t)radio_control.values[RADIO_PITCH];
stabilization_none_rc_cmd.r = (int32_t)radio_control.values[RADIO_YAW];
}
@@ -1,7 +1,5 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
* Copyright (C) 2011-2012 The Paparazzi Team
*
* This file is part of paparazzi.
*
@@ -21,6 +19,13 @@
* Boston, MA 02111-1307, USA.
*/
/** @file stabilization_none.h
* Dummy stabilization for rotorcrafts.
*
* Doesn't actually do any stabilization,
* just directly passes the RC commands along.
*/
#ifndef STABILIZATION_NONE
#define STABILIZATION_NONE
@@ -1,6 +1,4 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
* Copyright (C) 2010 Felix Ruess <felix.ruess@gmail.com>
*
@@ -22,6 +20,12 @@
* Boston, MA 02111-1307, USA.
*/
/** @file stabilization_rate.c
* Rate stabilization for rotorcrafts.
*
* Control loops for angular velocity.
*/
#include "firmwares/rotorcraft/stabilization.h"
#include "subsystems/ahrs.h"
@@ -1,6 +1,4 @@
/*
* $Id$
*
* Copyright (C) 2008-2009 Antoine Drouin <poinix@gmail.com>
*
* This file is part of paparazzi.
@@ -21,6 +19,12 @@
* Boston, MA 02111-1307, USA.
*/
/** @file stabilization_rate.h
* Rate stabilization for rotorcrafts.
*
* Control loops for angular velocity.
*/
#ifndef STABILIZATION_RATE
#define STABILIZATION_RATE
@@ -89,6 +89,7 @@ endif
$(MAKE) install -C apps DESTDIR=$(DESTDIR)
clean:
$(MAKE) clean -C $(KSRC) M=$(shell pwd)/kernel
$(MAKE) clean -C $(KSRC) $(shell pwd)/kernel
rm -f hotplug/wis-ezusb udev/wis-ezusb.rules
$(MAKE) clean -C apps
@@ -1,10 +1,9 @@
#!/usr/bin/perl -w
use Test::More tests => 7;
use Test::More tests => 8;
use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib";
use Program;
use Proc::Background;
use Ivy;
$|++;
@@ -12,7 +11,7 @@ $|++;
# Make the airframe
my $make_compile_options = "AIRCRAFT=LisaLv11_Booz2v12_RC clean_ac ap.compile";
my $compile_output = run_program(
"Attempting to build and upload the firmware.",
"Attempting to build the firmware.",
$ENV{'PAPARAZZI_SRC'},
"make $make_compile_options",
0,1);
@@ -31,25 +30,28 @@ unlike($upload_output, '/\bError\b/i', "The upload output does not contain the w
# Start the server process
my $server_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/server";
my $server_options = "";
my $server = Proc::Background->new($server_command, $server_options);
my @server_options = qw(-n);
my $server = Proc::Background->new($server_command, @server_options);
sleep 2; # The service should die in this time if there's an error
ok($server->alive(), "The server started successfully");
ok($server->alive(), "The server process started successfully");
# Start the link process
my $link_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/link";
my @link_options = qw(-d /dev/tty.usbserial-000013FD -s 57600 -transport xbee -xbee_addr 123);
#my @link_options = qw(-d /dev/tty.usbserial-000013FD -s 57600);
sleep 2; # The service should die in this time if there's an error
my $link = Proc::Background->new($link_command, @link_options);
ok($link->alive(), "The link started successfully");
ok($link->alive(), "The link process started successfully");
# Open the Ivy bus and read from it...
# TODO: learn how to read and write to the Ivy bus
SKIP : {
skip "Skipping testing of the hardware since we can't load the Ivy module. Please install IO::Socket::Multicast", 1 unless eval("use Ivy; 1");
ok(1, "We can load the Ivy module.");
# TODO: learn how to read and write to the Ivy bus
}
# Shutdown the server and link processes
ok($server->die(), "The server shutdown successfully.");
ok($link->die(), "The link shutdown successfully.");
ok($server->die(), "The server process shutdown successfully.");
ok($link->die(), "The link process shutdown successfully.");
################################################################################
# functions used by this test script.
@@ -0,0 +1,97 @@
#!/usr/bin/perl -w
use Test::More tests => 8;
use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib";
use Program;
use Proc::Background;
$|++;
####################
# Make the airframe
my $make_compile_options = "AIRCRAFT=LisaLv11_Aspirinv15_Overo_RC clean_ac ap.compile";
my $compile_output = run_program(
"Attempting to build the firmware.",
$ENV{'PAPARAZZI_SRC'},
"make $make_compile_options",
0,1);
unlike($compile_output, '/Aircraft \'LisaLv11_Aspirinv15_Overo_RC\' not found in/', "The compile output does not contain the message \"Aircraft \'LisaLv11_Aspirinv15_Overo_RC\' not found in\"");
unlike($compile_output, '/\bError\b/i', "The compile output does not contain the word \"Error\"");
####################
# Upload the airframe
my $make_upload_options = "AIRCRAFT=LisaLv11_Aspirinv15_Overo_RC BOARD_SERIAL=LISA-L-000154 ap.upload";
my $upload_output = run_program(
"Attempting to build and upload the firmware.",
$ENV{'PAPARAZZI_SRC'},
"make $make_upload_options",
0,1);
unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\"");
# Start the server process
my $server_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/server";
my @server_options = qw(-n);
my $server = Proc::Background->new($server_command, @server_options);
sleep 2; # The service should die in this time if there's an error
ok($server->alive(), "The server process started successfully");
# Start the link process
my $link_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/link";
my @link_options = qw(-d /dev/tty.usbserial-000013FD -s 57600 -transport xbee -xbee_addr 123);
sleep 2; # The service should die in this time if there's an error
my $link = Proc::Background->new($link_command, @link_options);
ok($link->alive(), "The link process started successfully");
# Open the Ivy bus and read from it...
SKIP : {
skip "Skipping testing of the hardware since we can't load the Ivy module. Please install IO::Socket::Multicast", 1 unless eval("use Ivy; 1");
ok(1, "We can load the Ivy module.");
# TODO: learn how to read and write to the Ivy bus
}
# Shutdown the server and link processes
ok($server->die(), "The server process shutdown successfully.");
ok($link->die(), "The link process shutdown successfully.");
################################################################################
# functions used by this test script.
sub run_program
{
my $message = shift;
my $dir = shift;
my $command = shift;
my $verbose = shift;
my $dont_fail_on_error = shift;
warn "$message\n" if $verbose;
if (defined $dir)
{
$command = "cd $dir;" . $command;
}
my $prog = new Program("bash");
my $fh = $prog->open("-c \"$command\"");
warn "Running command: \"". $prog->last_command() ."\"\n" if $verbose;
$fh->autoflush(1);
my @output;
while (<$fh>)
{
warn $_ if $verbose;
chomp $_;
push @output, $_;
}
$fh->close;
my $exit_status = $?/256;
unless ($exit_status == 0)
{
if ($dont_fail_on_error)
{
warn "Error: The command \"". $prog->last_command() ."\" failed to complete successfully. Exit status: $exit_status\n" if $verbose;
}
else
{
die "Error: The command \"". $prog->last_command() ."\" failed to complete successfully. Exit status: $exit_status\n";
}
}
return wantarray ? @output : join "\n", @output;
}
+16 -3
View File
@@ -1,10 +1,20 @@
Q = @
PERL = /usr/bin/perl
TEST_VERBOSE = 0
ifeq ($(TARGET_BOARD),)
TARGET_BOARD = *
NON_TEST_DIRS = lib|results
HARDWARE_REGEX = Lisa|Tiny|Umarim
HARDWARE_TEST_DIRS = $(shell find -L * -maxdepth 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -E "$(HARDWARE_REGEX)")
NON_HARDWARE_TEST_DIRS = $(shell find -L * -maxdepth 1 -type d | grep -Ev "$(NON_TEST_DIRS)" | grep -Ev "$(HARDWARE_REGEX)")
ifneq ($(TARGET_BOARD),)
TEST_DIRECTORIES = $(TARGET_BOARD)
else
ifeq ($(TEST_HARDWARE),)
TEST_DIRECTORIES = $(NON_HARDWARE_TEST_DIRS)
else
TEST_DIRECTORIES = $(NON_HARDWARE_TEST_DIRS) $(HARDWARE_TEST_DIRS)
endif
TEST_FILES := $(shell ls $(TARGET_BOARD)/*.t)
endif
TEST_FILES := $(shell ls $(TEST_DIRECTORIES:%=%/*.t))
ifneq ($(JUNIT),)
PERLENV=PERL_TEST_HARNESS_DUMP_TAP=$(PAPARAZZI_SRC)/tests/results
@@ -17,3 +27,6 @@ endif
test:
$(Q)$(PERLENV) $(PERL) "-e" "$(RUNTESTS)"
clean:
rm -rf results/*
+10 -10
View File
@@ -28,16 +28,16 @@ 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#i) and ($target =~ m#sim#i) );
next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1|LisaLv11_Aspirinv15_Overo_RC#i) and ($target =~ m#sim#i) );
#warn "EXAMPLE: [$example] TARGET: [$target]\n";
my $make_upload_options = "AIRCRAFT=$example clean_ac $target.compile";
my $upload_output = run_program(
my $make_options = "AIRCRAFT=$example clean_ac $target.compile";
my $output = run_program(
"Attempting to build the firmware $target for the airframe $example.",
$ENV{'PAPARAZZI_SRC'},
"make $make_upload_options",
"make $make_options",
$ENV->{'TEST_VERBOSE'},1);
unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\"");
unlike($output, '/\bError\b/i', "The make output for the $example target $target does not contain the word \"Error\"");
}
}
elsif ($process =~ m#target#)
@@ -48,16 +48,16 @@ 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#i) and ($target =~ m#sim#i) );
next if ( ($Config{'osname'} =~ m#darwin#i) and ($example =~ m#LISA_ASCTEC_PIOTR|LisaLv11_Booz2v12_RC|BOOZ2_A1|LisaLv11_Aspirinv15_Overo_RC#i) and ($target =~ m#sim#i) );
#warn "EXAMPLET: [$example] TARGET: [$target]\n";
my $make_upload_options = "AIRCRAFT=$example clean_ac $target.compile";
my $upload_output = run_program(
my $make_options = "AIRCRAFT=$example clean_ac $target.compile";
my $output = run_program(
"Attempting to build the firmware $target for the airframe $example.",
$ENV{'PAPARAZZI_SRC'},
"make $make_upload_options",
"make $make_options",
$ENV->{'TEST_VERBOSE'},1);
unlike($upload_output, '/\bError\b/i', "The upload output does not contain the word \"Error\"");
unlike($output, '/\bError\b/i', "The make output for the $example target $target does not contain the word \"Error\"");
}
}
}
+87
View File
@@ -0,0 +1,87 @@
#!/usr/bin/perl -w
use Test::More tests => 7;
use lib "$ENV{'PAPARAZZI_SRC'}/tests/lib";
use Program;
use Proc::Background;
$|++;
####################
# Make the airframe
my $make_compile_options = "AIRCRAFT=Microjet clean_ac sim";
my $compile_output = run_program(
"Attempting to build the sim firmware.",
$ENV{'PAPARAZZI_SRC'},
"make $make_compile_options",
0,1);
unlike($compile_output, '/Aircraft \'Microjet\' not found in/', "The compile output does not contain the message \"Aircraft \'Microjet\' not found in\"");
unlike($compile_output, '/\bError\b/i', "The compile output does not contain the word \"Error\"");
# Start the server process
my $server_command = "$ENV{'PAPARAZZI_HOME'}/sw/ground_segment/tmtc/server";
my @server_options = qw(-n);
my $server = Proc::Background->new($server_command, @server_options);
sleep 2; # The service should die in this time if there's an error
ok($server->alive(), "The server process started successfully");
# Start the launchsitl process
my $launchsitl_command = "$ENV{'PAPARAZZI_HOME'}/sw/simulator/launchsitl";
my @launchsitl_options = qw(-a Microjet -boot -norc);
sleep 2; # The service should die in this time if there's an error
my $launchsitl = Proc::Background->new($launchsitl_command, @launchsitl_options);
ok($launchsitl->alive(), "The launchsitl process started successfully");
# Open the Ivy bus and read from it...
SKIP : {
skip "Skipping testing of the simulator since we can't load the Ivy module. Please install IO::Socket::Multicast", 1 unless eval("use Ivy; 1");
ok(1, "We can load the Ivy module.");
# TODO: learn how to read and write to the Ivy bus
}
# Shutdown the server and launchsitl processes
ok($server->die(), "The server process shutdown successfully.");
ok($launchsitl->die(), "The launchsitl process shutdown successfully.");
################################################################################
# functions used by this test script.
sub run_program
{
my $message = shift;
my $dir = shift;
my $command = shift;
my $verbose = shift;
my $dont_fail_on_error = shift;
warn "$message\n" if $verbose;
if (defined $dir)
{
$command = "cd $dir;" . $command;
}
my $prog = new Program("bash");
my $fh = $prog->open("-c \"$command\"");
warn "Running command: \"". $prog->last_command() ."\"\n" if $verbose;
$fh->autoflush(1);
my @output;
while (<$fh>)
{
warn $_ if $verbose;
chomp $_;
push @output, $_;
}
$fh->close;
my $exit_status = $?/256;
unless ($exit_status == 0)
{
if ($dont_fail_on_error)
{
warn "Error: The command \"". $prog->last_command() ."\" failed to complete successfully. Exit status: $exit_status\n" if $verbose;
}
else
{
die "Error: The command \"". $prog->last_command() ."\" failed to complete successfully. Exit status: $exit_status\n";
}
}
return wantarray ? @output : join "\n", @output;
}