Real test flight with live optic flow improved.

This commit is contained in:
hrvoje
2016-03-30 20:23:38 +02:00
parent dc96a8bdb7
commit c4892ad0f5
4 changed files with 162 additions and 18 deletions
+2 -2
View File
@@ -5,9 +5,9 @@
airframe="airframes/HB/hb_ardrone2_opticflowtest.xml"
radio="radios/dummy.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/rotorcraft_basic.xml"
flight_plan="flight_plans/HB/hb_cyberzoo.xml"
settings="settings/rotorcraft_basic.xml"
settings_modules="modules/air_data.xml modules/cv_opticflow.xml"
gui_color="#f073ef8fb0bb"
gui_color="#ffffe945aacd"
/>
</conf>
+24 -4
View File
@@ -19,11 +19,31 @@
# <http://www.gnu.org/licenses/>.
#
#
# This Makefile uses the generic Makefile.arm-linux and adds upload rules for the ARDrone2
#
include $(PAPARAZZI_SRC)/conf/Makefile.arm-linux-toolchain
include $(PAPARAZZI_SRC)/conf/Makefile.arm-linux
# Define OMAP A8 ARDrone2 specifc flags
FLOAT_ABI ?= -mfloat-abi=softfp
#FLOAT_ABI ?= -mfloat-abi=hard
# ARCH_CFLAGS ?= -O3 -marm -funsafe-math-optimizations -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -mfpu=neon -ftree-vectorize -ftree-vectorizer-verbose=1 -ffast-math -fomit-frame-pointer -funroll-loops
ARCH_CFLAGS ?= -O3 -marm -mstructure-size-boundary=32 -funsafe-math-optimizations -mcpu=cortex-a8 -mtune=cortex-a8 -march=armv7-a -mfpu=neon -ftree-vectorize -ftree-vectorizer-verbose=1 -funroll-loops -ffast-math
# When -pg is used this cannot -fomit-frame-pointer
# -ffast-math is added in generic Makefile.linux later on..
# TODO: arm{?}strip -R .comment -R .note -R .note.ABI-tag ap.elf
# with armv7, unaligned data can still be read
CFLAGS += -DPPRZLINK_UNALIGNED_ACCESS=1
# add ARM specifc flags to CFLAGS, LDFLAGS
CFLAGS += $(FLOAT_ABI) $(ARCH_CFLAGS) -pg
LDFLAGS += $(FLOAT_ABI) -pg
CXXFLAGS += $(FLOAT_ABI) $(ARCH_CFLAGS) -pg
# include the common linux Makefile (common CFLAGS, actual targets)
include $(PAPARAZZI_SRC)/conf/Makefile.linux
DRONE = $(PAPARAZZI_SRC)/sw/tools/parrot/ardrone2.py
+13 -12
View File
@@ -18,9 +18,12 @@
<subsystem name="actuators" type="ardrone2"/>
<subsystem name="imu" type="ardrone2"/>
<!-- gps: "ublox" or change to "sirf" for usage with parrot flight recorder -->
<subsystem name="gps" type="ublox"/>
<subsystem name="gps" type="datalink"/>
<subsystem name="stabilization" type="int_quat"/>
<subsystem name="ahrs" type="int_cmpl_quat"/>
<subsystem name="ahrs" type="int_cmpl_quat">
<configure name="USE_MAGNETOMETER" value="FALSE"/> <!-- Heading is from Optitrack, in reguler outside flight case one would use and Magnetometer-->
<define name="AHRS_USE_GPS_HEADING" value="TRUE"/>
</subsystem>
<subsystem name="ins" type="extended"/>
</firmware>
@@ -98,19 +101,17 @@
<!-- http://wiki.paparazziuav.org/wiki/Subsystem/ahrs#Local_Magnetic_Field -->
<section name="AHRS" prefix="AHRS_">
<!-- values used if no GPS fix, on 3D fix is update by geo_mag module -->
<!-- Toulouse -->
<define name="H_X" value="0.513081"/>
<define name="H_Y" value="-0.00242783"/>
<define name="H_Z" value="0.858336"/>
<!-- Delft -->
<!--define name="H_X" value="0.3892503"/>
<define name="H_X" value="0.3892503"/>
<define name="H_Y" value="0.0017972"/>
<define name="H_Z" value="0.9211303"/ -->
<define name="H_Z" value="0.9211303"/>
</section>
<section name="INS" prefix="INS_">
<section name="INS" prefix="INS_">
<define name="SONAR_MAX_RANGE" value="2.2"/>
<define name="SONAR_UPDATE_ON_AGL" value="TRUE"/>
<define name="USE_GPS_ALT" value="TRUE"/>
<define name="VFF_R_GPS" value="0.01"/>
</section>
<section name="STABILIZATION_RATE" prefix="STABILIZATION_RATE_">
@@ -186,7 +187,7 @@
<section name="GUIDANCE_H" prefix="GUIDANCE_H_">
<!-- Good weather -->
<define name="MAX_BANK" value="20" unit="deg"/>
<define name="MAX_BANK" value="12" unit="deg"/>
<!-- Bad weather -->
<!-- define name="MAX_BANK" value="32" unit="deg"/ -->
<define name="PGAIN" value="79"/>
@@ -210,8 +211,8 @@
<section name="BAT">
<define name="MILLIAMP_AT_FULL_THROTTLE" value="8700"/>
<define name="CATASTROPHIC_BAT_LEVEL" value="9.3" unit="V"/>
<define name="CRITIC_BAT_LEVEL" value="9.6" unit="V"/>
<define name="LOW_BAT_LEVEL" value="9.7" unit="V"/>
<define name="CRITIC_BAT_LEVEL" value="9.8" unit="V"/>
<define name="LOW_BAT_LEVEL" value="10.4" unit="V"/>
<define name="MAX_BAT_LEVEL" value="12.4" unit="V"/>
</section>
</airframe>
+123
View File
@@ -0,0 +1,123 @@
<!DOCTYPE flight_plan SYSTEM "../flight_plan.dtd">
<flight_plan alt="2.8" ground_alt="0" lat0="51.990634" lon0="4.376789" max_dist_from_home="8" name="hb_cyberzoo" security_height="2.7">
<header>
#include "autopilot.h"
#include "subsystems/ahrs.h"
#include "subsystems/electrical.h"
#include "subsystems/datalink/datalink.h"
</header>
<waypoints>
<waypoint height="0" name="HOME" x="0.0" y="0.0"/>
<waypoint height="5" name="CLIMB" x="1.2" y="-0.6"/>
<waypoint height="1.342321" name="STDBY" x="-0.7" y="-0.8"/>
<waypoint name="TD" x="0.8" y="-1.7"/>
<waypoint name="p1" x="3.1" y="-1.9"/>
<waypoint name="p2" x="2.5" y="-2.2"/>
<waypoint name="p3" x="1.7" y="-1.6"/>
<waypoint name="p4" x="1.7" y="-3.0"/>
<waypoint name="CAM" x="-2" y="-4" height="2."/>
<waypoint lat="51.9906213" lon="4.3768628" name="_CZ1"/>
<waypoint lat="51.9905874" lon="4.3767766" name="_CZ2"/>
<waypoint lat="51.9906409" lon="4.3767226" name="_CZ3"/>
<waypoint lat="51.990667" lon="4.376806" name="_CZ4"/>
<waypoint lat="51.990624" lon="4.376845" name="_OZ1"/>
<waypoint lat="51.990601" lon="4.376782" name="_OZ2"/>
<waypoint alt="11.5" lat="51.990638" lon="4.376748" name="_OZ3"/>
<waypoint lat="51.990657" lon="4.376804" name="_OZ4"/>
</waypoints>
<sectors>
<sector color="red" name="CyberZoo">
<corner name="_CZ1"/>
<corner name="_CZ2"/>
<corner name="_CZ3"/>
<corner name="_CZ4"/>
</sector>
<sector color="#FF9922" name="ObstacleZone">
<corner name="_OZ1"/>
<corner name="_OZ2"/>
<corner name="_OZ3"/>
<corner name="_OZ4"/>
</sector>
</sectors>
<exceptions>
<exception cond="!InsideCyberZoo(GetPosX(), GetPosY())" deroute="Standby"/>
<!-- <exception cond="datalink_time > 2" deroute="Land here"/>
<exception cond="electrical.bat_low && !(nav_block == IndexOfBlock('Land')) && !(nav_block == IndexOfBlock('Flare')) && !(nav_block == IndexOfBlock('Landed'))" deroute="Land"/>
<exception cond="electrical.bat_critical && !(nav_block == IndexOfBlock('Land')) && !(nav_block == IndexOfBlock('Flare')) && !(nav_block == IndexOfBlock('Landed'))" deroute="Land here"/> -->
</exceptions>
<blocks>
<block name="Wait GPS">
<call fun="NavKillThrottle()"/>
<while cond="!GpsFixValid()"/>
</block>
<block name="Geo init">
<while cond="LessThan(NavBlockTime(), 2)"/>
<!-- <call fun="NavSetAltitudeReferenceHere()"/> -->
<call fun="NavSetGroundReferenceHere()"/>
</block>
<block name="Holding point">
<call fun="NavKillThrottle()"/>
<attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/>
</block>
<block key="r" name="Start Engine">
<call fun="NavResurrect()"/>
<attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/>
</block>
<block key="t" name="Takeoff" strip_button="Takeoff" strip_icon="takeoff.png">
<exception cond="stateGetPositionEnu_f()->z > 2.8" deroute="Standby"/>
<call fun="NavSetWaypointHere(WP_CLIMB)"/>
<stay climb="nav_climb_vspeed" vmode="climb" wp="CLIMB"/>
</block>
<block key="s" name="Standby" strip_button="Standby" strip_icon="home.png">
<call fun="NavSetWaypointHere(WP_STDBY)"/>
<stay wp="STDBY"/>
</block>
<block name="stay_p1">
<stay wp="p1"/>
</block>
<block name="go_p2">
<call fun="nav_set_heading_deg(90)"/>
<go wp="p2"/>
<deroute block="stay_p1"/>
</block>
<block name="line_p1_p2">
<go from="p1" hmode="route" wp="p2"/>
<stay wp="p2" until="stage_time>10"/>
<go from="p2" hmode="route" wp="p1"/>
<deroute block="stay_p1"/>
</block>
<block name="route">
<go from="p1" hmode="route" wp="p3"/>
<go from="p3" hmode="route" wp="p4"/>
<go from="p4" hmode="route" wp="p1"/>
<deroute block="stay_p1"/>
</block>
<block name="test yaw">
<go wp="p1"/>
<for var="i" from="1" to="16">
<heading alt="WaypointAlt(WP_p1)" course="90 * $i" until="stage_time > 3"/>
</for>
<deroute block="Standby"/>
</block>
<block name="circle CAM" pre_call="nav_set_heading_towards_waypoint(WP_CAM)">
<circle radius="nav_radius" wp="CAM"/>
</block>
<block key="l" name="Land here" strip_button="Land Here" strip_icon="land-right.png">
<call fun="NavSetWaypointHere(WP_TD)"/>
</block>
<block name="Land">
<go wp="TD"/>
</block>
<block name="Flare">
<exception cond="NavDetectGround()" deroute="Holding point"/>
<exception cond="!nav_is_in_flight()" deroute="Landed"/>
<call fun="NavStartDetectGround()"/>
<stay climb="nav_descend_vspeed" vmode="climb" wp="TD"/>
</block>
<block name="Landed">
<call fun="NavKillThrottle()"/>
<attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/>
</block>
</blocks>
</flight_plan>