mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-27 17:06:31 +08:00
[rotorcraft] force MODE_STARTUP instead of KILL until ahrs is aligned
- Go to MODE_STARTUP (which defaults to AP_MODE_KILL) instead of AP_MODE_KILL as long as the ahrs is not aligned. - Remove AUTOPILOT_DISABLE_AHRS_KILL from all example airframes (but kept the functionality for now). MODE_STARTUP is set to AP_MODE_NAV for the autonomous (without RC) ARDrone2. Without AUTOPILOT_DISABLE_AHRS_KILL it will force MODE_STARTUP until the ahrs is aligned, but still not allow to turn on the motors (as that also checks for ahrs_is_aligned). As far as I can see this should solve #964 as long as you don't have AUTOPILOT_DISABLE_AHRS_KILL defined.
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
<target name="ap" board="ardrone2_raw">
|
||||
<define name="USE_INS_NAV_INIT"/>
|
||||
<configure name="AHRS_PROPAGATE_FREQUENCY" value="200"/>
|
||||
<define name="AUTOPILOT_DISABLE_AHRS_KILL"/>
|
||||
|
||||
<define name="LINK_HOST" value="\\\"192.168.2.255\\\""/>
|
||||
<configure name="HOST" value="192.168.2.$(AC_ID)"/>
|
||||
|
||||
@@ -29,7 +29,6 @@ Lisa/S v1.0 board (http://wiki.paparazziuav.org/wiki/Lisa/S)
|
||||
<configure name="AHRS_PROPAGATE_FREQUENCY" value="120"/>
|
||||
<configure name="PERIODIC_FREQUENCY" value="120"/> <!-- 120 seams to be the max of the barometer -->
|
||||
|
||||
<define name="AUTOPILOT_DISABLE_AHRS_KILL"/> <!-- NEW -->
|
||||
</target>
|
||||
<target name="sim" board="pc"/>
|
||||
<target name="nps" board="pc">
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
<firmware name="rotorcraft">
|
||||
<target name="ap" board="ardrone2_raw">
|
||||
<define name="AUTOPILOT_DISABLE_AHRS_KILL"/>
|
||||
<subsystem name="telemetry" type="transparent_udp"/>
|
||||
<subsystem name="radio_control" type="datalink"/>
|
||||
</target>
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
<firmware name="rotorcraft">
|
||||
<target name="ap" board="ardrone2_raw">
|
||||
<define name="AUTOPILOT_DISABLE_AHRS_KILL"/>
|
||||
<define name="FAILSAFE_DESCENT_SPEED" value="0.5"/>
|
||||
<configure name="USE_MAGNETOMETER" value="0"/>
|
||||
|
||||
|
||||
@@ -215,7 +215,6 @@
|
||||
</subsystem>
|
||||
|
||||
<configure name="AHRS_PROPAGATE_FREQUENCY" value="500"/>
|
||||
<define name="AUTOPILOT_DISABLE_AHRS_KILL"/>
|
||||
</target>
|
||||
|
||||
<target name="nps" board="pc">
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
# simple INS with float vertical filter
|
||||
#
|
||||
|
||||
$(TARGET).CFLAGS += -DINS_TYPE_H=\"subsystems/ins/ins_ardrone2.h\" -DAUTOPILOT_DISABLE_AHRS_KILL
|
||||
$(TARGET).CFLAGS += -DINS_TYPE_H=\"subsystems/ins/ins_ardrone2.h\"
|
||||
$(TARGET).srcs += $(SRC_SUBSYSTEMS)/ins.c
|
||||
$(TARGET).srcs += $(SRC_SUBSYSTEMS)/ins/ins_ardrone2.c
|
||||
|
||||
@@ -347,9 +347,9 @@ INFO("Using FAILSAFE_GROUND_DETECT: KILL")
|
||||
|
||||
void autopilot_set_mode(uint8_t new_autopilot_mode) {
|
||||
|
||||
/* force kill mode as long as AHRS is not aligned */
|
||||
/* force startup mode (default is kill) as long as AHRS is not aligned */
|
||||
if (!ahrs_is_aligned())
|
||||
new_autopilot_mode = AP_MODE_KILL;
|
||||
new_autopilot_mode = MODE_STARTUP;
|
||||
|
||||
if (new_autopilot_mode != autopilot_mode) {
|
||||
/* horizontal mode */
|
||||
|
||||
Reference in New Issue
Block a user