Bebop2 flight delft (#2527)

* Flying a bebop2 outside in Delft

* tagged flying bebop2 airframe
This commit is contained in:
Ewoud Smeur
2020-05-01 23:37:42 +02:00
committed by GitHub
parent b269f9cf27
commit ce4f35bbe4
3 changed files with 149 additions and 16 deletions
+12 -12
View File
@@ -75,19 +75,19 @@
<section name="IMU" prefix="IMU_">
<!-- Magneto calibration -->
<define name="MAG_X_NEUTRAL" value="286"/>
<define name="MAG_Y_NEUTRAL" value="-156"/>
<define name="MAG_Z_NEUTRAL" value="-275"/>
<define name="MAG_X_SENS" value="7.074334106912319" integer="16"/>
<define name="MAG_Y_SENS" value="7.069181442728008" integer="16"/>
<define name="MAG_Z_SENS" value="7.411815536475566" integer="16"/>
<define name="MAG_X_NEUTRAL" value="43"/>
<define name="MAG_Y_NEUTRAL" value="-151"/>
<define name="MAG_Z_NEUTRAL" value="-64"/>
<define name="MAG_X_SENS" value="7.21201776785" integer="16"/>
<define name="MAG_Y_SENS" value="7.20541442846" integer="16"/>
<define name="MAG_Z_SENS" value="7.55306977197" integer="16"/>
<!--define name="ACCEL_X_NEUTRAL" value="11"/>
<define name="ACCEL_Y_NEUTRAL" value="-43"/>
<define name="ACCEL_Z_NEUTRAL" value="-124"/>
<define name="ACCEL_X_SENS" value="2.4523434144387464" integer="16"/>
<define name="ACCEL_Y_SENS" value="2.428429001527193" integer="16"/>
<define name="ACCEL_Z_SENS" value="2.423519834802844" integer="16"/-->
<define name="ACCEL_X_NEUTRAL" value="-1"/>
<define name="ACCEL_Y_NEUTRAL" value="-16"/>
<define name="ACCEL_Z_NEUTRAL" value="-102"/>
<define name="ACCEL_X_SENS" value="4.90615997669" integer="16"/>
<define name="ACCEL_Y_SENS" value="4.8601827035" integer="16"/>
<define name="ACCEL_Z_SENS" value="4.85967415403" integer="16"/>
</section>
<section name="INS" prefix="INS_">
+132
View File
@@ -0,0 +1,132 @@
<!DOCTYPE flight_plan SYSTEM "../flight_plan.dtd">
<flight_plan alt="10" ground_alt="0" lat0="51 59 27.6" lon0="4 22 42.0" max_dist_from_home="1000" name="Delft Basic" security_height="2">
<header>
#include "autopilot.h"
#include "subsystems/datalink/datalink.h"
#include "subsystems/electrical.h"
#include "subsystems/radio_control.h"
</header>
<waypoints>
<waypoint name="HOME" x="0.0" y="0.0"/>
<waypoint name="CLIMB" x="0.0" y="5.0"/>
<waypoint name="STDBY" x="-2.0" y="-5.0"/>
<waypoint name="p1" x="-19.9" y="14.3"/>
<waypoint name="p2" x="-0.6" y="21.6"/>
<waypoint name="p3" x="22.2" y="-26.5"/>
<waypoint name="p4" x="4.9" y="-34.4"/>
<waypoint name="CAM" x="14.2" y="-29.4"/>
<waypoint name="TD" x="5.6" y="-10.9"/>
<waypoint name="_G1" x="-31.4" y="27.3"/>
<waypoint name="_G2" x="0.5" y="37.0"/>
<waypoint name="_G3" x="35.1" y="-33.6"/>
<waypoint name="_G4" x="2.5" y="-46.9"/>
</waypoints>
<sectors>
<sector color="red" name="Flight_Area" type="dynamic">
<corner name="_G1"/>
<corner name="_G2"/>
<corner name="_G3"/>
<corner name="_G4"/>
</sector>
</sectors>
<exceptions>
<exception cond="!InsideFlight_Area(GetPosX(), GetPosY())" deroute="Holding point"/>
<exception cond="((radio_control.status == RC_REALLY_LOST) &&
!(IndexOfBlock('Takeoff') > nav_block) &&
!(nav_block >= IndexOfBlock('land here')) &&
(autopilot_in_flight() == true) )" deroute="descend att 0"/>
<exception cond="(datalink_time > 60 &&
!(datalink_time > 120) &&
!(IndexOfBlock('Takeoff') > nav_block) &&
!(nav_block >= IndexOfBlock('land here')) &&
(autopilot_in_flight() == true) )" deroute="ComeBackAndLand"/>
<exception cond="(electrical.bat_low &&
!(IndexOfBlock('Holding point') > nav_block) &&
!(nav_block >= IndexOfBlock('land here')) &&
(autopilot_in_flight() == true) )" deroute="ComeBackAndLand"/>
<exception cond="(electrical.bat_critical &&
!(IndexOfBlock('Holding point') > nav_block) &&
!(nav_block >= IndexOfBlock('land here')) &&
(autopilot_in_flight() == true) )" deroute="land here"/>
</exceptions>
<blocks>
<block name="Wait GPS">
<call_once fun="NavKillThrottle()"/>
<while cond="!GpsFixValid()"/>
</block>
<block name="Geo init">
<while cond="LessThan(NavBlockTime(), 10)"/>
<call_once fun="NavSetAltitudeReferenceHere()"/>
</block>
<block name="Holding point">
<call_once fun="NavKillThrottle()"/>
<attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/>
</block>
<block name="Start Engine">
<call_once fun="NavResurrect()"/>
<attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/>
</block>
<block name="Takeoff" strip_button="Takeoff" strip_icon="takeoff.png">
<exception cond="stateGetPositionEnu_f()->z > 2.0" deroute="Standby"/>
<call_once fun="NavSetWaypointHere(WP_CLIMB)"/>
<stay climb="nav_climb_vspeed" vmode="climb" wp="CLIMB"/>
</block>
<block name="Standby" strip_button="Standby" strip_icon="home.png">
<stay wp="STDBY"/>
</block>
<block name="stay_p1">
<stay wp="p1"/>
</block>
<block name="go_p2">
<go wp="p2"/>
<deroute block="stay_p1"/>
</block>
<block name="line_p1_p2">
<go from="p1" hmode="route" wp="p2"/>
<stay until="stage_time>10" wp="p2"/>
<go from="p2" hmode="route" wp="p1"/>
<deroute block="stay_p1"/>
</block>
<block name="route">
<go from="p1" hmode="route" wp="p2"/>
<go from="p2" 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 from="1" to="16" var="i">
<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 name="land here" strip_button="Land Here" strip_icon="land-right.png">
<call_once 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_once fun="NavStartDetectGround()"/>
<stay climb="nav_descend_vspeed" vmode="climb" wp="TD"/>
</block>
<block name="landed">
<attitude pitch="0" roll="0" throttle="0" until="FALSE" vmode="throttle"/>
</block>
<block name="ComeBackAndLand">
<go wp="HOME"/>
<deroute block="land here"/>
</block>
<block name="descend att 0">
<attitude pitch="0" roll="0" throttle="0.40" until="stage_time > 30" vmode="throttle"/>
<deroute block="Holding point"/>
</block>
</blocks>
</flight_plan>
+5 -4
View File
@@ -424,13 +424,14 @@
<aircraft
name="bebop2_22"
ac_id="22"
airframe="airframes/tudelft/bebop2_indi.xml"
airframe="airframes/examples/bebop2_indi.xml"
radio="radios/dummy.xml"
telemetry="telemetry/default_rotorcraft.xml"
flight_plan="flight_plans/tudelft/delft_basic.xml"
settings="settings/rotorcraft_basic.xml settings/estimation/ahrs_secondary.xml"
settings_modules="modules/gps_ubx_ucenter.xml modules/air_data.xml modules/geo_mag.xml modules/ins_extended.xml modules/ahrs_int_cmpl_quat.xml modules/stabilization_indi.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
flight_plan="flight_plans/tudelft/delft_bebop.xml"
settings="settings/rotorcraft_basic.xml [settings/estimation/ahrs_secondary.xml]"
settings_modules="modules/gps_ubx_ucenter.xml modules/air_data.xml modules/ins_ekf2.xml modules/stabilization_indi_simple.xml modules/nav_basic_rotorcraft.xml modules/guidance_rotorcraft.xml modules/gps.xml modules/imu_common.xml"
gui_color="#baa3d698b729"
release="cde043338785efbaa7aac97e90cb272099a0c7ec"
/>
<aircraft
name="bebop2_detect_gate_front"