mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-30 03:27:33 +08:00
Added Disco camera support and more fixes (#2319)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,14 @@
|
|||||||
<!DOCTYPE flight_plan SYSTEM "../flight_plan.dtd">
|
<!DOCTYPE flight_plan SYSTEM "../flight_plan.dtd">
|
||||||
<flight_plan alt="300" ground_alt="200" lat0="50.123456" lon0="7.123456" max_dist_from_home="11400" name="OpenUAS Versatile" qfu="270" security_height="70" home_mode_height="70">
|
<flight_plan alt="300" ground_alt="200" lat0="50.123456" lon0="7.123456" max_dist_from_home="11400" name="OpenUAS Versatile" qfu="270" security_height="70" home_mode_height="70">
|
||||||
|
|
||||||
|
<!-- Varous speed modes for use in flightplanvwith control=new
|
||||||
|
V_CTL_SPEED_THROTTLE
|
||||||
|
V_CTL_SPEED_AIRSPEED
|
||||||
|
V_CTL_SPEED_GROUNDSPEED
|
||||||
|
use v_ctl_auto_airspeed_setpoint in meters per second
|
||||||
|
|
||||||
|
Fix it for ETECS still
|
||||||
|
-->
|
||||||
<!-- ******************************** HEADERS ****************************** -->
|
<!-- ******************************** HEADERS ****************************** -->
|
||||||
<header>
|
<header>
|
||||||
|
|
||||||
@@ -31,13 +39,6 @@
|
|||||||
#define LINE_STOP_FUNCTION dc_autoshoot = DC_AUTOSHOOT_STOP;
|
#define LINE_STOP_FUNCTION dc_autoshoot = DC_AUTOSHOOT_STOP;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Enable energy control commands from within flightplan
|
|
||||||
//Uncomment as needed if ETECS is used
|
|
||||||
// #include "firmwares/fixedwing/guidance/energy_ctrl.h"
|
|
||||||
|
|
||||||
// States
|
|
||||||
// #define AircraftIsBooting() LessThan(nav_block,4) // LessThan(nav_block,IndexOfBlock('Mission.ReadyForDeparture'))
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
</header>
|
</header>
|
||||||
@@ -51,26 +52,25 @@
|
|||||||
<waypoint name="S2" x="162." y="237."/>
|
<waypoint name="S2" x="162." y="237."/>
|
||||||
<waypoint name="AF" x="-21." y="66." alt="215."/>
|
<waypoint name="AF" x="-21." y="66." alt="215."/>
|
||||||
<waypoint name="TD" x="-127." y="0." alt="185."/>
|
<waypoint name="TD" x="-127." y="0." alt="185."/>
|
||||||
<waypoint name="CLIMB" x="53." y="146." height="60."/>
|
<waypoint name="CLIMB" x="53." y="146." height="70."/>
|
||||||
|
|
||||||
<!-- For a payload release. Need to connect external servo -->
|
<!-- For a payload release. Need to connect external servo -->
|
||||||
<waypoint name="WAIT" x="-70." y="-70." height="115."/>
|
<waypoint name="WAIT" x="-70." y="-70." height="115."/>
|
||||||
<waypoint name="BASELEG" x="56." y="367."/>
|
<waypoint name="BASELEG" x="56." y="367."/>
|
||||||
<waypoint name="START" x="60." y="-120." height="65."/>
|
<waypoint name="START" x="60." y="-120." height="65."/>
|
||||||
<!-- Note that 80m is the release height, we are not allowed to go below 60 meters and need at least 5m GPS height fluctuation into account
|
<!-- Note that 80m is the release height, and if e.g. one is not allowed to go below 60 meters, one needs at least 5m GPS height fluctuation into account
|
||||||
Also if we steeply move UP from START to RELEASE the release will be more accurate possibly -->
|
Also if we steeply move UP from START to RELEASE the release will be more accurate possibly -->
|
||||||
<waypoint name="RELEASE" x="20." y="-45." height="80."/> <!-- along line start to release this is the end point -->
|
<waypoint name="RELEASE" x="20." y="-45." height="80."/> <!-- along line start to release this is the end point -->
|
||||||
|
|
||||||
<!-- Position where target would be located. -->
|
<!-- Position where target would be located. -->
|
||||||
<!-- Note that 0m is the target height and allowed -->
|
<!-- Note that 0m is the target height and allowed -->
|
||||||
<waypoint name="OUTBACKJOE" x="200." y="200." height="0."/>
|
<waypoint name="TARGET" x="200." y="200." height="0."/>
|
||||||
<!-- Used for out of missionboundary tests -->
|
<!-- Used for out of missionboundary tests -->
|
||||||
<waypoint name="TESTTOOFAR" x="-48." y="537."/>
|
<waypoint name="TESTTOOFAR" x="-48." y="537."/>
|
||||||
<!-- Square -->
|
<!-- Square -->
|
||||||
<waypoint name="_1" x="5.9" y="65.9"/>
|
<waypoint name="Q1" x="5.9" y="65.9"/>
|
||||||
<waypoint name="_2" x="67.5" y="301.1"/>
|
<waypoint name="Q2" x="67.5" y="301.1"/>
|
||||||
<waypoint name="_3" x="309.2" y="250.8"/>
|
<waypoint name="Q3" x="309.2" y="250.8"/>
|
||||||
<waypoint name="_4" x="245.3" y="18.6"/>
|
<waypoint name="Q4" x="245.3" y="18.6"/>
|
||||||
<!-- bounding box -->
|
<!-- bounding box -->
|
||||||
<waypoint alt="515.0" name="_MB1" x="-345.9" y="82.7"/>
|
<waypoint alt="515.0" name="_MB1" x="-345.9" y="82.7"/>
|
||||||
<waypoint alt="515.0" name="_MB2" x="-118.2" y="101.9"/>
|
<waypoint alt="515.0" name="_MB2" x="-118.2" y="101.9"/>
|
||||||
@@ -89,7 +89,7 @@
|
|||||||
</waypoints>
|
</waypoints>
|
||||||
<sectors>
|
<sectors>
|
||||||
<!-- ***** -->
|
<!-- ***** -->
|
||||||
<sector color="yellow" name="MissionBoundary">
|
<sector color="yellow" name="MissionBoundary" type="dynamic">
|
||||||
<corner name="_MB1"/>
|
<corner name="_MB1"/>
|
||||||
<corner name="_MB2"/>
|
<corner name="_MB2"/>
|
||||||
<corner name="_MB3"/>
|
<corner name="_MB3"/>
|
||||||
@@ -99,18 +99,18 @@
|
|||||||
<corner name="_MB7"/>
|
<corner name="_MB7"/>
|
||||||
<corner name="_MB8"/>
|
<corner name="_MB8"/>
|
||||||
</sector>
|
</sector>
|
||||||
<sector color="purple" name="SearchArea">
|
<sector color="purple" name="SearchArea" type="dynamic">
|
||||||
<corner name="SA1"/>
|
<corner name="SA1"/>
|
||||||
<corner name="SA2"/>
|
<corner name="SA2"/>
|
||||||
<corner name="SA3"/>
|
<corner name="SA3"/>
|
||||||
<corner name="SA4"/>
|
<corner name="SA4"/>
|
||||||
<corner name="SA5"/>
|
<corner name="SA5"/>
|
||||||
</sector>
|
</sector>
|
||||||
<sector color="lightblue" name="Square">
|
<sector color="lightblue" name="Square" type="dynamic">
|
||||||
<corner name="_1"/>
|
<corner name="Q1"/>
|
||||||
<corner name="_2"/>
|
<corner name="Q2"/>
|
||||||
<corner name="_3"/>
|
<corner name="Q3"/>
|
||||||
<corner name="_4"/>
|
<corner name="Q4"/>
|
||||||
</sector>
|
</sector>
|
||||||
</sectors>
|
</sectors>
|
||||||
<variables>
|
<variables>
|
||||||
@@ -119,18 +119,18 @@
|
|||||||
<exceptions>
|
<exceptions>
|
||||||
<exception cond="And((datalink_time) > 300, autopilot.launch > 0) " deroute="Standby"/>
|
<exception cond="And((datalink_time) > 300, autopilot.launch > 0) " deroute="Standby"/>
|
||||||
<exception cond="LOW_BAT_LEVEL > PowerVoltage()" deroute="Standby"/>
|
<exception cond="LOW_BAT_LEVEL > PowerVoltage()" deroute="Standby"/>
|
||||||
<exception cond="Or(! InsideMissionBoundary(GetPosX(), GetPosY()), GetPosAlt() > GetAltRef() + 600) && !(nav_block == IndexOfBlock('Wait GPS')) && !(nav_block == IndexOfBlock('Geo init')) && !(nav_block == IndexOfBlock('Holding point')) && !(nav_block == IndexOfBlock('Takeoff')) && !(nav_block == IndexOfBlock('land')) && !(nav_block == IndexOfBlock('final')) && !(nav_block == IndexOfBlock('flare'))" deroute="Standby"/>
|
<exception cond="Or(! InsideMissionBoundary(GetPosX(), GetPosY()), GetPosAlt() > GetAltRef() + 600) && !(nav_block == IndexOfBlock('Wait GPS')) && !(nav_block == IndexOfBlock('Geo init')) && !(nav_block == IndexOfBlock('Waiting for RC Transmitter')) && !(nav_block == IndexOfBlock('Takeoff')) && !(nav_block == IndexOfBlock('land')) && !(nav_block == IndexOfBlock('final')) && !(nav_block == IndexOfBlock('flare'))" deroute="Standby"/>
|
||||||
</exceptions>
|
</exceptions>
|
||||||
<blocks>
|
<blocks>
|
||||||
<block name="Wait GPS">
|
<block name="Wait GPS">
|
||||||
<!-- if no valid fix or gps accuracy> 15m or no AHRS , it a no-go wait-->
|
<!-- if no valid fix or gps accuracy> 15m or no AHRS , it a no-go wait-->
|
||||||
<while cond="!GpsFixValid()"/>
|
<while cond="!GpsFixValid()"/>
|
||||||
<!-- Wiggle Wiggle when we have GPS , time to fly...-->
|
<!-- Wiggle Wiggle when we have GPS , time to fly...-->
|
||||||
<set var="ap_state->commands[COMMAND_YAW]" value="-MAX_PPRZ"/>
|
<!--<set var="ap_state->commands[COMMAND_YAW]" value="-MAX_PPRZ"/>
|
||||||
<while cond="LessThan(NavBlockTime(), 2)"/>
|
<while cond="LessThan(NavBlockTime(), 2)"/>
|
||||||
<set var="ap_state->commands[COMMAND_YAW]" value="MAX_PPRZ"/>
|
<set var="ap_state->commands[COMMAND_YAW]" value="MAX_PPRZ"/>
|
||||||
<while cond="LessThan(NavBlockTime(), 3)"/>
|
<while cond="LessThan(NavBlockTime(), 3)"/>
|
||||||
<set var="ap_state->commands[COMMAND_YAW]" value="-MAX_PPRZ"/>
|
<set var="ap_state->commands[COMMAND_YAW]" value="-MAX_PPRZ"/>-->
|
||||||
</block>
|
</block>
|
||||||
<block name="Geo init">
|
<block name="Geo init">
|
||||||
<while cond="LessThan(NavBlockTime(), 10)"/>
|
<while cond="LessThan(NavBlockTime(), 10)"/>
|
||||||
@@ -138,71 +138,67 @@
|
|||||||
<!--call_once fun="NavSetAltitudeReferenceHere()"/-->
|
<!--call_once fun="NavSetAltitudeReferenceHere()"/-->
|
||||||
<set var="air_data.calc_qnh_once" value="TRUE"/>
|
<set var="air_data.calc_qnh_once" value="TRUE"/>
|
||||||
</block>
|
</block>
|
||||||
<block name="Wait for RC">
|
<block name="Waiting for RC Transmitter">
|
||||||
<!-- We must have RC at least once switched on just to test, this check can be deleted if everything works 100% in Auto2 -->
|
<!-- <attitude roll="0" throttle="0" vmode="throttle"/>--> <!-- To disable wriggly Actuators in Auto2, and throttle to 0 just in case -->
|
||||||
<while cond="RCLost()"/> <!-- to make sure we do not hop to AUTO2 and motor could starts running, at least switch on then maybe off if you want to -->
|
<!-- If you have an RC transmitter backup, one must have the TX at least switched on once. This check can be disabled if everything works 100% in Auto2 and you have no TX -->
|
||||||
<!-- TODO Switch on ACL blinky light as soon as we are ready to go -->
|
<while cond="RCLost()"/> <!-- To make sure we do not hop to AUTO2 and motor could starts running, at least switch on then maybe off if you want to -->
|
||||||
</block>
|
</block>
|
||||||
<block name="Holding point">
|
<block key="t" name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png" group="Ops">
|
||||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
<set var="v_ctl_speed_mode" value="V_CTL_SPEED_AIRSPEED" />
|
||||||
</block>
|
<exception cond="GetPosAlt() > GetAltRef()+15" deroute="Standby"/>
|
||||||
<block key="t" name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
<while cond="1 > autopilot.launch"/> <!-- Setting of launch performed with takeoff_detect module disable -->
|
||||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
|
||||||
<set var="autopilot.kill_throttle" value="0"/>
|
<set var="autopilot.kill_throttle" value="0"/>
|
||||||
<set var="autopilot.launch" value="1"/>
|
<!--<set var="autopilot.launch" value="1"/>--><!--If takeoff_detect module not used enable launch here -->
|
||||||
<set var="autopilot.flight_time" value="0"/>
|
<set var="autopilot.flight_time" value="0"/>
|
||||||
<go wp="CLIMB"/>
|
<set var="v_ctl_auto_airspeed_setpoint" value="RACE_AIRSPEED" />
|
||||||
|
<!--<heading course="QFU" vmode="throttle" throttle="0.8" pitch="15" until="(GetPosAlt() > ground_alt+30)"/>--><!-- enable Magnetometer on ground-->
|
||||||
|
<go wp="CLIMB" throttle="1.0" vmode="throttle" pitch="TAKEOFF_PITCH_ANGLE"/> <!-- better just first straight on (if there is not to much sidewind ;0)-->
|
||||||
</block>
|
</block>
|
||||||
<!-- TODO Enable and test again -->
|
<block key="s" name="Standby" strip_button="Standby" strip_icon="home.png" group="Ops">
|
||||||
<!--
|
<set var="v_ctl_auto_throttle_cruise_throttle" value="V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" />
|
||||||
<block name="Takeoff">
|
<set var="v_ctl_auto_airspeed_setpoint" value="NOMINAL_AIRSPEED" />
|
||||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
<set var="v_ctl_speed_mode" value="V_CTL_SPEED_AIRSPEED" />
|
||||||
<set var="autopilot.kill_throttle" value="0"/>
|
|
||||||
<set var="autopilot.flight_time" value="0"/>
|
|
||||||
<call fun="nav_catapult_run(WP_CLIMB)"/>
|
|
||||||
</block>-->
|
|
||||||
<!-- -->
|
|
||||||
<block key="s" name="Standby" strip_button="Standby" strip_icon="home.png">
|
|
||||||
<set value="V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" var="v_ctl_auto_throttle_cruise_throttle"/>
|
|
||||||
<circle radius="nav_radius" wp="STDBY"/>
|
<circle radius="nav_radius" wp="STDBY"/>
|
||||||
</block>
|
</block>
|
||||||
<block key="r" name="SimpleSquareRoute">
|
<block key="i" name="SimpleSquareRoute">
|
||||||
<go from="STDBY" hmode="route" wp="SA1"/>
|
<go from="STDBY" hmode="route" wp="SA1"/>
|
||||||
<for from="0" to="10" var="i">
|
<for from="0" to="10" var="i">
|
||||||
<go from="SA1" hmode="route" wp="SA2"/>
|
<go from="SA1" hmode="route" wp="SA2"/>
|
||||||
<!-- dash -->
|
<!-- dash -->
|
||||||
<!--<set value="V_CTL_AUTO_THROTTLE_MAX_CRUISE_THROTTLE" var="v_ctl_auto_throttle_cruise_throttle"/>-->
|
<!--<set var="v_ctl_auto_throttle_cruise_throttle" value="V_CTL_AUTO_THROTTLE_MAX_CRUISE_THROTTLE"/>-->
|
||||||
<go hmode="route" wp="SA3"/>
|
<go hmode="route" wp="SA3"/>
|
||||||
<go hmode="route" wp="SA4"/>
|
<go hmode="route" wp="SA4"/>
|
||||||
<!-- nominal again -->
|
<!-- nominal again -->
|
||||||
<!--<set value="V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" var="v_ctl_auto_throttle_cruise_throttle"/>-->
|
<!--<set var="v_ctl_auto_throttle_cruise_throttle" value="V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE"/>-->
|
||||||
<go hmode="route" wp="SA5"/>
|
<go hmode="route" wp="SA5"/>
|
||||||
</for>
|
</for>
|
||||||
<deroute block="Standby"/>
|
<deroute block="Standby"/>
|
||||||
</block>
|
</block>
|
||||||
<block name="SearchForTarget" strip_button="Searchtarget" strip_icon="survey.png">
|
<block name="SearchForTarget" strip_button="Searchtarget" strip_icon="survey.png" group="Scan">
|
||||||
<exception cond="block_time > 300" deroute="Standby"/> <!-- No patience, five minutes is enough for now... -->
|
<exception cond="block_time > 300" deroute="Standby"/> <!-- No patience, five minutes is enough for now... -->
|
||||||
<call_once fun="nav_survey_polygon_setup(WP_SA1, 5, 45 , POLYSURVEY_DEFAULT_DISTANCE, 25, MIN_CIRCLE_RADIUS, GetAltRef()+40)"/>
|
<call_once fun="nav_survey_polygon_setup(WP_SA1, 5, 45 , POLYSURVEY_DEFAULT_DISTANCE, 25, MIN_CIRCLE_RADIUS, GetAltRef()+40)"/>
|
||||||
<call fun="nav_survey_polygon_run()"/>
|
<call fun="nav_survey_polygon_run()"/>
|
||||||
</block>
|
</block>
|
||||||
<block name="Line 1-2" strip_button="Line (wp 1-2)" strip_icon="line.png" group="extra_pattern">
|
<block name="Line 1-2" strip_button="Line (wp 1-2)" strip_icon="line.png" group="extra_pattern" group="Ops">
|
||||||
<call_once fun="nav_line_setup()"/>
|
<call_once fun="nav_line_setup()"/>
|
||||||
<call fun="nav_line_run(WP_1, WP_2, nav_radius)"/>
|
<call fun="nav_line_run(WP_1, WP_2, nav_radius)"/>
|
||||||
</block>
|
</block>
|
||||||
<block key="F8" name="Figure 8 around wp 1" strip_button="Figure 8 (wp 1-2)" strip_icon="eight.png">
|
<block key="F8" name="Figure 8 around wp 1" strip_button="Figure 8 (wp 1-2)" strip_icon="eight.png" group="Ops">
|
||||||
<eight center="1" radius="nav_radius" turn_around="2"/>
|
<eight center="1" radius="nav_radius" turn_around="2"/>
|
||||||
</block>
|
</block>
|
||||||
<block name="Oval 1-2" strip_button="Oval (wp 1-2)" strip_icon="oval.png">
|
<block name="Oval 1-2" strip_button="Oval (wp 1-2)" strip_icon="oval.png" group="Ops">
|
||||||
<oval p1="1" p2="2" radius="nav_radius"/>
|
<oval p1="1" p2="2" radius="nav_radius"/>
|
||||||
</block>
|
</block>
|
||||||
<block name="Race Oval 1-2 for 3 minutes">
|
<block name="Race Oval 1-2 for 3 minutes">
|
||||||
<go wp="1"/>
|
<go wp="1"/>
|
||||||
<set value="V_CTL_AUTO_THROTTLE_MAX_CRUISE_THROTTLE" var="v_ctl_auto_throttle_cruise_throttle"/>
|
<set var="v_ctl_auto_throttle_cruise_throttle" value="V_CTL_AUTO_THROTTLE_MAX_CRUISE_THROTTLE"/>
|
||||||
<oval p1="1" p2="2" radius="nav_radius*1.2" until="stage_time > 180"/>
|
<set var="v_ctl_auto_airspeed_setpoint" value="RACE_AIRSPEED"/>
|
||||||
<set value="V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" var="v_ctl_auto_throttle_cruise_throttle"/>
|
<oval p1="1" p2="2" radius="nav_radius*1.2" until="block_time > 180"/>
|
||||||
|
<set var="v_ctl_auto_throttle_cruise_throttle" value="V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE"/>
|
||||||
|
<set var="v_ctl_auto_airspeed_setpoint" value="NOMINAL_AIRSPEED"/>
|
||||||
<deroute block="Standby"/>
|
<deroute block="Standby"/>
|
||||||
</block>
|
</block>
|
||||||
<block name="MOB" strip_button="Circle around here" strip_icon="mob.png">
|
<block name="MOB" strip_button="Circle around here" strip_icon="mob.png" group="Scan">
|
||||||
<call_once fun="NavSetWaypointHere(WP_MOB)"/>
|
<call_once fun="NavSetWaypointHere(WP_MOB)"/>
|
||||||
<circle radius="100" wp="MOB"/>
|
<circle radius="100" wp="MOB"/>
|
||||||
</block>
|
</block>
|
||||||
@@ -245,21 +241,22 @@
|
|||||||
<go from="1" hmode="route" vmode="glide" wp="2"/>
|
<go from="1" hmode="route" vmode="glide" wp="2"/>
|
||||||
<deroute block="Standby"/>
|
<deroute block="Standby"/>
|
||||||
</block>
|
</block>
|
||||||
<block name="Survey S1-S2" strip_button="Survey (wp S1-S2)" strip_icon="survey.png">
|
<block name="Survey S1-S2" strip_button="Survey (wp S1-S2)" strip_icon="survey.png" group="Scan">
|
||||||
<survey_rectangle grid="150" wp1="S1" wp2="S2"/>
|
<survey_rectangle grid="150" wp1="S1" wp2="S2"/>
|
||||||
</block>
|
</block>
|
||||||
<block name="Land Right AF-TD" strip_button="Land right (wp AF-TD)" strip_icon="land-right.png">
|
<block key="r" name="Land Right AF-TD" strip_button="Land right (wp AF-TD)" strip_icon="land-right.png" group="Land">
|
||||||
<set value="DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
<set value="DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
||||||
<deroute block="land"/>
|
<deroute block="land"/>
|
||||||
</block>
|
</block>
|
||||||
<block key="l" name="Land Left AF-TD" strip_button="Land left (wp AF-TD)" strip_icon="land-left.png">
|
<block key="l" name="Land Left AF-TD" strip_button="Land left (wp AF-TD)" strip_icon="land-left.png" group="Land">
|
||||||
<set value="-DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
<set value="-DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
||||||
<deroute block="land"/>
|
<deroute block="land"/>
|
||||||
</block>
|
</block>
|
||||||
<block key="<control>l" name="land">
|
<block key="<control>l" name="land">
|
||||||
<call_once fun="nav_compute_baseleg(WP_AF, WP_TD, WP_BASELEG, nav_radius)"/>
|
<call_once fun="nav_compute_baseleg(WP_AF, WP_TD, WP_BASELEG, nav_radius)"/>
|
||||||
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="BASELEG"/>
|
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="BASELEG"/>
|
||||||
<set value="V_CTL_AUTO_THROTTLE_MIN_CRUISE_THROTTLE" var="v_ctl_auto_throttle_cruise_throttle"/>
|
<set var="v_ctl_auto_throttle_cruise_throttle" value="V_CTL_AUTO_THROTTLE_MIN_CRUISE_THROTTLE" />
|
||||||
|
<set var="v_ctl_auto_airspeed_setpoint" value="MINIMUM_AIRSPEED"/>
|
||||||
<circle radius="nav_radius" until="NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10) && 10 > fabs(GetPosAlt() - WaypointAlt(WP_BASELEG))" wp="BASELEG"/>
|
<circle radius="nav_radius" until="NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10) && 10 > fabs(GetPosAlt() - WaypointAlt(WP_BASELEG))" wp="BASELEG"/>
|
||||||
</block>
|
</block>
|
||||||
<block name="final">
|
<block name="final">
|
||||||
@@ -271,33 +268,33 @@
|
|||||||
<attitude roll="0.0" throttle="0.0" until="FALSE" vmode="throttle"/>
|
<attitude roll="0.0" throttle="0.0" until="FALSE" vmode="throttle"/>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
<!-------- -->
|
<!-- Extras -->
|
||||||
<block name="Steps roll -10, +10">
|
<block name="Steps roll -10, +10">
|
||||||
<while cond="TRUE">
|
<while cond="TRUE">
|
||||||
<attitude alt="250" roll="10.0" until=" stage_time > 6" vmode="alt"/>
|
<attitude alt="GetPosAlt()" roll="10.0" until=" stage_time > 6" vmode="alt"/>
|
||||||
<attitude alt="250" roll="-10.0" until="stage_time > 6" vmode="alt"/>
|
<attitude alt="GetPosAlt()" roll="-10.0" until="stage_time > 6" vmode="alt"/>
|
||||||
</while>
|
</while>
|
||||||
</block>
|
</block>
|
||||||
<block name="Steps roll -20, +20">
|
<block name="Steps roll -20, +20">
|
||||||
<while cond="TRUE">
|
<while cond="TRUE">
|
||||||
<attitude alt="250" roll="20.0" until=" stage_time > 3" vmode="alt"/>
|
<attitude alt="GetPosAlt()" roll="20.0" until=" stage_time > 3" vmode="alt"/>
|
||||||
<attitude alt="250" roll="-20.0" until="stage_time > 3" vmode="alt"/>
|
<attitude alt="GetPosAlt()" roll="-20.0" until="stage_time > 3" vmode="alt"/>
|
||||||
</while>
|
</while>
|
||||||
</block>
|
</block>
|
||||||
<block name="Steps roll from var">
|
<block name="Steps roll from var">
|
||||||
<while cond="TRUE">
|
<while cond="TRUE">
|
||||||
<attitude alt="250" roll="roll_step" until=" stage_time > 3" vmode="alt"/>
|
<attitude alt="GetPosAlt()" roll="roll_step" until=" stage_time > 3" vmode="alt"/>
|
||||||
<attitude alt="250" roll="-roll_step" until="stage_time > 3" vmode="alt"/>
|
<attitude alt="GetPosAlt()" roll="-roll_step" until="stage_time > 3" vmode="alt"/>
|
||||||
</while>
|
</while>
|
||||||
</block>
|
</block>
|
||||||
<block name="Steps pitch -10, +10">
|
<block name="Steps pitch -10, +10">
|
||||||
<while cond="TRUE">
|
<while cond="TRUE">
|
||||||
<attitude alt="250" pitch="10" roll="0.0" until=" stage_time > 2" vmode="alt"/>
|
<attitude alt="GetPosAlt()" pitch="10" roll="0.0" until=" stage_time > 2" vmode="alt"/>
|
||||||
<attitude alt="250" pitch="-10" roll="0.0" until=" stage_time > 2" vmode="alt"/>
|
<attitude alt="GetPosAlt()" pitch="-10" roll="0.0" until=" stage_time > 2" vmode="alt"/>
|
||||||
</while>
|
</while>
|
||||||
</block>
|
</block>
|
||||||
<block name="Heading 30">
|
<block name="Heading 30">
|
||||||
<heading alt="GetAltRef()+50" course="30" until="FALSE"/><!-- better test your missionboundary first ;)-->
|
<heading alt="GetAltRef()+80" course="30" until="FALSE"/><!-- better test your missionboundary first ;)-->
|
||||||
</block>
|
</block>
|
||||||
<block name="For loop (circles wp 1)">
|
<block name="For loop (circles wp 1)">
|
||||||
<for from="0" to="3" var="i">
|
<for from="0" to="3" var="i">
|
||||||
@@ -305,7 +302,7 @@
|
|||||||
</for>
|
</for>
|
||||||
<deroute block="Standby"/>
|
<deroute block="Standby"/>
|
||||||
</block>
|
</block>
|
||||||
<block name="Flower (wp 1-2)" strip_button="Flower">
|
<block name="Flower (wp 1-2)" strip_button="Flower" strip_icon="observe.png" group="Scan">
|
||||||
<call_once fun="nav_flower_setup(WP_1, WP_2)"/>
|
<call_once fun="nav_flower_setup(WP_1, WP_2)"/>
|
||||||
<call fun="nav_flower_run()"/>
|
<call fun="nav_flower_run()"/>
|
||||||
</block>
|
</block>
|
||||||
|
|||||||
@@ -0,0 +1,402 @@
|
|||||||
|
<!DOCTYPE flight_plan SYSTEM "../flight_plan.dtd">
|
||||||
|
<flight_plan alt="300" ground_alt="200" lat0="50.123456" lon0="7.123456" max_dist_from_home="11400" name="OpenUAS Versatile" qfu="270" security_height="70" home_mode_height="70">
|
||||||
|
|
||||||
|
<!-- Varous speed modes for use in flightplan
|
||||||
|
V_CTL_SPEED_THROTTLE
|
||||||
|
V_CTL_SPEED_AIRSPEED
|
||||||
|
V_CTL_SPEED_GROUNDSPEED
|
||||||
|
use v_ctl_auto_airspeed_setpoint in meters per second
|
||||||
|
|
||||||
|
WIP should work well for both THROTTLE and airspeed modes for a fixedwing
|
||||||
|
Should be unified for Hybrid, FW and rotorcraft
|
||||||
|
-->
|
||||||
|
<!-- ******************************** HEADERS ****************************** -->
|
||||||
|
<header>
|
||||||
|
|
||||||
|
#ifndef FLIGHTPLAN_HEADER_DEFINES
|
||||||
|
#define FLIGHTPLAN_HEADER_DEFINES
|
||||||
|
|
||||||
|
//Set Generic options
|
||||||
|
#include "autopilot.h"
|
||||||
|
//Enable AHRS Health test functions
|
||||||
|
#include "subsystems/ahrs/ahrs_aligner.h"
|
||||||
|
//Enable advanced electrical power functions
|
||||||
|
#include "subsystems/electrical.h"
|
||||||
|
//Enable datalink tests
|
||||||
|
#include "subsystems/datalink/datalink.h"
|
||||||
|
|
||||||
|
// PHOTOGRAMMETRY settings
|
||||||
|
#define PHOTOGRAMMETRY_OVERLAP 30 // 1-99 Procent
|
||||||
|
#define PHOTOGRAMMETRY_SIDELAP 20 // 1-99 Procent
|
||||||
|
#define PHOTOGRAMMETRY_RESOLUTION 50 // mm pixel projection size
|
||||||
|
|
||||||
|
// Include airframe.h To be able to use specific variables
|
||||||
|
#include "generated/airframe.h"
|
||||||
|
|
||||||
|
// Extras for Photoscan
|
||||||
|
#ifdef DC_AUTOSHOOT_PERIOD
|
||||||
|
//TODO make shooting distance not periodic
|
||||||
|
#define LINE_START_FUNCTION dc_autoshoot = DC_AUTOSHOOT_PERIODIC;
|
||||||
|
#define LINE_STOP_FUNCTION dc_autoshoot = DC_AUTOSHOOT_STOP;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
</header>
|
||||||
|
<waypoints>
|
||||||
|
<waypoint name="HOME" x="0" y="0"/>
|
||||||
|
<waypoint name="STDBY" x="20." y="80." height="70."/>
|
||||||
|
<waypoint name="1" x="-20." y="114."/>
|
||||||
|
<waypoint name="2" x="203." y="112."/>
|
||||||
|
<waypoint name="MOB" x="-11." y="-21."/>
|
||||||
|
<waypoint name="S1" x="-151." y="80."/>
|
||||||
|
<waypoint name="S2" x="162." y="237."/>
|
||||||
|
<waypoint name="AF" x="-21." y="66." alt="215."/>
|
||||||
|
<waypoint name="TD" x="-127." y="0." alt="185."/>
|
||||||
|
<waypoint name="_CLIMB" x="53." y="146." height="70."/>
|
||||||
|
<waypoint name="FLARE" x="-100." y="400." height="-40."/>
|
||||||
|
<!-- For a payload release one needs to add external release connected to servo output -->
|
||||||
|
<waypoint name="WAIT" x="-70." y="-70." height="115."/>
|
||||||
|
<waypoint name="_BASELEG" x="56." y="367."/>
|
||||||
|
<waypoint name="START" x="60." y="-120." height="65."/>
|
||||||
|
<!-- Note that 80m is the release height, and if e.g. one is not allowed to go below 60 meters, one needs at least 5m GPS height fluctuation into account
|
||||||
|
Also if we steeply move UP from START to RELEASE the release will be more accurate possibly -->
|
||||||
|
<waypoint name="RELEASE" x="20." y="-45." height="80."/> <!-- along line start to release this is the end point -->
|
||||||
|
<!-- Position where target would be located. -->
|
||||||
|
<!-- Note that 0m is the target height, on the ground, and allowed -->
|
||||||
|
<waypoint name="TARGET" x="200." y="200." height="0."/>
|
||||||
|
<!-- Used for out of missionboundary tests -->
|
||||||
|
<waypoint name="TESTTOOFAR" x="-48." y="537."/>
|
||||||
|
<!-- Square -->
|
||||||
|
<waypoint name="Q1" x="5.9" y="65.9"/>
|
||||||
|
<waypoint name="Q2" x="67.5" y="301.1"/>
|
||||||
|
<waypoint name="Q3" x="309.2" y="250.8"/>
|
||||||
|
<waypoint name="Q4" x="245.3" y="18.6"/>
|
||||||
|
<!-- bounding box -->
|
||||||
|
<waypoint alt="515.0" name="_MB1" x="-345.9" y="82.7"/>
|
||||||
|
<waypoint alt="515.0" name="_MB2" x="-118.2" y="101.9"/>
|
||||||
|
<waypoint alt="515.0" name="_MB3" x="-20." y="553."/>
|
||||||
|
<waypoint alt="515.0" name="_MB4" x="527.7" y="545.1"/>
|
||||||
|
<waypoint alt="515.0" name="_MB5" x="840.7" y="433.7"/>
|
||||||
|
<waypoint alt="515.0" name="_MB6" x="922.2" y="-123.0"/>
|
||||||
|
<waypoint alt="515.0" name="_MB7" x="351.5" y="-43.5"/>
|
||||||
|
<waypoint alt="515.0" name="_MB8" x="-312.3" y="-118.9"/>
|
||||||
|
<!-- SearchArea -->
|
||||||
|
<waypoint name="SA1" x="115.6" y="388.8"/>
|
||||||
|
<waypoint name="SA2" x="268.4" y="426.8"/>
|
||||||
|
<waypoint name="SA3" x="478.4" y="355.2"/>
|
||||||
|
<waypoint name="SA4" x="392.0" y="63.0"/>
|
||||||
|
<waypoint name="SA5" x="-20.9" y="44.6"/>
|
||||||
|
</waypoints>
|
||||||
|
<sectors>
|
||||||
|
<!-- ***** -->
|
||||||
|
<!-- since hidden corners cannot be accidentaly changed -->
|
||||||
|
<sector color="yellow" name="MissionBoundary" type="dynamic">
|
||||||
|
<corner name="_MB1"/>
|
||||||
|
<corner name="_MB2"/>
|
||||||
|
<corner name="_MB3"/>
|
||||||
|
<corner name="_MB4"/>
|
||||||
|
<corner name="_MB5"/>
|
||||||
|
<corner name="_MB6"/>
|
||||||
|
<corner name="_MB7"/>
|
||||||
|
<corner name="_MB8"/>
|
||||||
|
</sector>
|
||||||
|
<sector color="purple" name="SearchArea" type="dynamic">
|
||||||
|
<corner name="SA1"/>
|
||||||
|
<corner name="SA2"/>
|
||||||
|
<corner name="SA3"/>
|
||||||
|
<corner name="SA4"/>
|
||||||
|
<corner name="SA5"/>
|
||||||
|
</sector>
|
||||||
|
<sector color="lightblue" name="Square" type="dynamic">
|
||||||
|
<corner name="Q1"/>
|
||||||
|
<corner name="Q2"/>
|
||||||
|
<corner name="Q3"/>
|
||||||
|
<corner name="Q4"/>
|
||||||
|
</sector>
|
||||||
|
</sectors>
|
||||||
|
<variables>
|
||||||
|
<variable var="roll_step" init="15." min="0." max="50." step="1.0"/>
|
||||||
|
</variables>
|
||||||
|
<exceptions>
|
||||||
|
<exception cond="And((datalink_time) > 300, autopilot.launch > 0) " deroute="Standby"/>
|
||||||
|
<exception cond="LOW_BAT_LEVEL > PowerVoltage()" deroute="Standby"/>
|
||||||
|
<exception cond="Or(! InsideMissionBoundary(GetPosX(), GetPosY()), GetPosAlt() > GetAltRef() + 600) && !(nav_block == IndexOfBlock('Wait GPS')) && !(nav_block == IndexOfBlock('Geo init')) && !(nav_block == IndexOfBlock('Waiting for RC Transmitter')) && !(nav_block == IndexOfBlock('Takeoff')) && !(nav_block == IndexOfBlock('land')) && !(nav_block == IndexOfBlock('Final')) && !(nav_block == IndexOfBlock('Flare'))" deroute="Standby"/>
|
||||||
|
</exceptions>
|
||||||
|
<blocks>
|
||||||
|
<block name="Wait GPS" pre_call="NavKillThrottle()">
|
||||||
|
<!-- Do Not Kill -->
|
||||||
|
<!-- <call fun="Fly()"/>-->
|
||||||
|
<!-- if no valid fix or gps accuracy> 15m or no AHRS , it a no-go wait-->
|
||||||
|
<!--<while cond="!GpsFixValid() || gps.pacc > 1500 || stateIsAttitudeValid()"/>-->
|
||||||
|
<while cond="!GpsFixValid()"/>
|
||||||
|
<!-- Wiggle Wiggle when we have GPS , time to fly...-->
|
||||||
|
<!--<set var="ap_state->commands[COMMAND_YAW]" value="-MAX_PPRZ"/>
|
||||||
|
<while cond="LessThan(NavBlockTime(), 2)"/>
|
||||||
|
<set var="ap_state->commands[COMMAND_YAW]" value="MAX_PPRZ"/>
|
||||||
|
<while cond="LessThan(NavBlockTime(), 3)"/>
|
||||||
|
<set var="ap_state->commands[COMMAND_YAW]" value="-MAX_PPRZ"/>-->
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<!-- *********** Set the ground reference height and the home position *********** -->
|
||||||
|
<!-- a second init will follow since the plane thrower will still walk to launchpoint Which can be higher different etc. -->
|
||||||
|
|
||||||
|
<block name="Geo init">
|
||||||
|
<while cond="LessThan(NavBlockTime(), 10)"/>
|
||||||
|
<call_once fun="NavSetGroundReferenceHere()"/>
|
||||||
|
<!--call_once fun="NavSetAltitudeReferenceHere()"/-->
|
||||||
|
<set var="air_data.calc_qnh_once" value="TRUE"/>
|
||||||
|
</block>
|
||||||
|
<block name="Waiting for RC Transmitter">
|
||||||
|
<!-- <attitude roll="0" throttle="0" vmode="throttle"/>--> <!-- To disable wriggly Actuators in Auto2, and throttle to 0 just in case -->
|
||||||
|
<!-- If you have an RC transmitter backup, one must have the TX at least switched on once. This check can be disabled if everything works 100% in Auto2 and you have no TX -->
|
||||||
|
<while cond="RCLost()"/> <!-- To make sure we do not hop to AUTO2 and motor could starts running, at least switch on then maybe off if you want to -->
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<!-- A Choice...
|
||||||
|
<block name="Landing Position Stored" pre_call="NavKillThrottle()" strip_button="Store" strip_icon="recenter.png">
|
||||||
|
<call_once fun="NavSetWaypointPosAndAltHere(WP_TD)"/>
|
||||||
|
<call_once fun="DownlinkSendWpNr(WP_TD)"/>
|
||||||
|
<call_once fun="nav_compute_final_from_glide(WP_AF, WP_TD, V_CTL_GLIDE_RATIO)"/>
|
||||||
|
<call_once fun="DownlinkSendWpNr(WP_AF)"/>
|
||||||
|
<call_once fun="DownlinkSendWpNr(WP_FLARE)"/>
|
||||||
|
<deroute block="ReadyForDeparture"/>
|
||||||
|
</block>
|
||||||
|
-->
|
||||||
|
|
||||||
|
<block name="ReadyForDeparture" >
|
||||||
|
<!-- <set value="0" var="ap_state->commands[COMMAND_CAMBER]"/> -->
|
||||||
|
<!-- <set value="0" var="ap_state->commands[COMMAND_BRAKE]"/> -->
|
||||||
|
<set var="v_ctl_speed_mode" value="V_CTL_SPEED_AIRSPEED" /><!-- set the preferred flight mode -->
|
||||||
|
<!-- Must have an RC for this flightplan and on at least for the start, we wait till the throttle is high -->
|
||||||
|
<exception cond="ThrottleHigh()" deroute="Takeoff"/>
|
||||||
|
<!-- The nav_takeoff_pitch_setting makes it visible for we are ready for it-->
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<block key="t" name="Takeoff" strip_button="Takeoff" strip_icon="takeoff.png" group="Ops">
|
||||||
|
<!-- <set var="ap_state->commands[COMMAND_LIGHT]" value="PPRZ_MAX"/> -->
|
||||||
|
<set var="autopilot.kill_throttle" value="0"/>
|
||||||
|
<!--<var="autopilot.launch" set value="1" />-->
|
||||||
|
<while cond="1 > autopilot.launch"/> <!-- Setting of launch performed with takeoff_detect module disable -->
|
||||||
|
<set var="autopilot.flight_time" value="0"/>
|
||||||
|
<!--<call_once fun="AirbrakesOff()"/>-->
|
||||||
|
<set var="v_ctl_auto_airspeed_setpoint" value="nav_airspeed_nominal_setting" /><!--or RACE_AIRSPEED? -->
|
||||||
|
<attitude pitch="nav_takeoff_pitch_setting" roll="0" throttle="1.0" until="MoreThan(NavBlockTime(), 3)" vmode="throttle"/>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<block name="Climb-Out">
|
||||||
|
<set var="v_ctl_speed_mode" value="V_CTL_SPEED_AIRSPEED"/>
|
||||||
|
<!--<exception cond="rc_status==RC_REALLY_LOST" after 3 seconds and no IMU deroute="softlydown">if using RC still on with a Auto2 mode switch-->
|
||||||
|
<attitude pitch="nav_takeoff_pitch_setting" roll="0" throttle="1.0" until="GetPosAlt() > ground_alt+15" vmode="throttle"/>
|
||||||
|
<set var="v_ctl_auto_throttle_nominal_cruise_throttle" value="1.0" />
|
||||||
|
<set var="v_ctl_auto_throttle_nominal_cruise_pitch" value="nav_takeoff_pitch_setting" />
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<block key="s" name="Standby" strip_button="Standby" strip_icon="home.png" group="Ops">
|
||||||
|
<set var="v_ctl_auto_throttle_cruise_throttle" value="V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" />
|
||||||
|
<set var="v_ctl_auto_airspeed_setpoint" value="NOMINAL_AIRSPEED" />
|
||||||
|
<set var="v_ctl_speed_mode" value="V_CTL_SPEED_AIRSPEED" />
|
||||||
|
<circle radius="nav_radius" wp="STDBY"/>
|
||||||
|
</block>
|
||||||
|
<block key="i" name="SimpleSquareRoute">
|
||||||
|
<go from="STDBY" hmode="route" wp="SA1"/>
|
||||||
|
<for from="0" to="10" var="i">
|
||||||
|
<go from="SA1" hmode="route" wp="SA2"/>
|
||||||
|
<!-- dash -->
|
||||||
|
<!--<set value="V_CTL_AUTO_THROTTLE_MAX_CRUISE_THROTTLE" var="v_ctl_auto_throttle_cruise_throttle"/>-->
|
||||||
|
<go hmode="route" wp="SA3"/>
|
||||||
|
<go hmode="route" wp="SA4"/>
|
||||||
|
<!-- nominal again -->
|
||||||
|
<!--<set value="V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE" var="v_ctl_auto_throttle_cruise_throttle"/>-->
|
||||||
|
<go hmode="route" wp="SA5"/>
|
||||||
|
</for>
|
||||||
|
<deroute block="Standby"/>
|
||||||
|
</block>
|
||||||
|
<block name="SearchForTarget" strip_button="Searchtarget" strip_icon="survey.png" group="Scan">
|
||||||
|
<exception cond="block_time > 300" deroute="Standby"/> <!-- No patience, five minutes is enough for now... -->
|
||||||
|
<call_once fun="nav_survey_polygon_setup(WP_SA1, 5, 45 , POLYSURVEY_DEFAULT_DISTANCE, 25, MIN_CIRCLE_RADIUS, GetAltRef()+40)"/>
|
||||||
|
<call fun="nav_survey_polygon_run()"/>
|
||||||
|
</block>
|
||||||
|
<block name="Line 1-2" strip_button="Line (wp 1-2)" strip_icon="line.png" group="extra_pattern" group="Ops">
|
||||||
|
<call_once fun="nav_line_setup()"/>
|
||||||
|
<call fun="nav_line_run(WP_1, WP_2, nav_radius)"/>
|
||||||
|
</block>
|
||||||
|
<block key="8" name="Figure 8 around wp 1" strip_button="Figure 8 (wp 1-2)" strip_icon="eight.png" group="Ops">
|
||||||
|
<eight center="1" radius="nav_radius" turn_around="2"/>
|
||||||
|
</block>
|
||||||
|
<block name="Oval 1-2" strip_button="Oval (wp 1-2)" strip_icon="oval.png" group="Ops">
|
||||||
|
<oval p1="1" p2="2" radius="nav_radius"/>
|
||||||
|
</block>
|
||||||
|
<block name="Race Oval 1-2 for 3 minutes">
|
||||||
|
<go wp="1"/>
|
||||||
|
<set var="v_ctl_auto_throttle_cruise_throttle" value="V_CTL_AUTO_THROTTLE_MAX_CRUISE_THROTTLE"/>
|
||||||
|
<set var="v_ctl_auto_airspeed_setpoint" value="RACE_AIRSPEED"/>
|
||||||
|
<oval p1="1" p2="2" radius="nav_radius*1.2" until="block_time > 180"/>
|
||||||
|
<set var="v_ctl_auto_throttle_cruise_throttle" value="V_CTL_AUTO_THROTTLE_NOMINAL_CRUISE_THROTTLE"/>
|
||||||
|
<set var="v_ctl_auto_airspeed_setpoint" value="NOMINAL_AIRSPEED"/>
|
||||||
|
<deroute block="Standby"/>
|
||||||
|
</block>
|
||||||
|
<block name="MOB" strip_button="Circle around here" strip_icon="mob.png" group="Scan">
|
||||||
|
<call_once fun="NavSetWaypointHere(WP_MOB)"/>
|
||||||
|
<circle radius="100" wp="MOB"/>
|
||||||
|
</block>
|
||||||
|
<block name="Auto pitch (circle wp 1)">
|
||||||
|
<circle pitch="auto" radius="75" throttle="0.7" wp="1"/>
|
||||||
|
</block>
|
||||||
|
<block name="Climb 75% throttle">
|
||||||
|
<circle pitch="10" radius="50+(GetPosAlt()-GetAltRef())/2" throttle="0.75" until="(LOW_BAT_LEVEL > PowerVoltage()) || (GetPosAlt() > GetAltRef()+ 600)" vmode="throttle" wp="1"/>
|
||||||
|
</block>
|
||||||
|
<block name="Climb 0m/s">
|
||||||
|
<circle climb="0" radius="nav_radius" until="LOW_BAT_LEVEL > PowerVoltage()" vmode="climb" wp="1"/>
|
||||||
|
</block>
|
||||||
|
<block name="Climb 1m/s">
|
||||||
|
<circle climb="1" pitch="5" radius="50+(GetPosAlt()-GetAltRef())/2" until="LOW_BAT_LEVEL > PowerVoltage()" vmode="climb" wp="1"/>
|
||||||
|
</block>
|
||||||
|
<block name="Climb nav_climb m/s">
|
||||||
|
<circle climb="nav_climb" radius="nav_radius" until="(LOW_BAT_LEVEL > PowerVoltage()) || (GetPosAlt() > GetAltRef()+ 600)" vmode="climb" wp="1"/>
|
||||||
|
</block>
|
||||||
|
<block name="Circle 0% throttle">
|
||||||
|
<circle pitch="fp_pitch" radius="nav_radius" throttle="0.0" until="GetAltRef()+50 > GetPosAlt()" vmode="throttle" wp="1"/>
|
||||||
|
<deroute block="Standby"/>
|
||||||
|
</block>
|
||||||
|
<block name="Oval 0% throttle">
|
||||||
|
<oval p1="1" p2="2" pitch="fp_pitch" radius="nav_radius" throttle="0.0" until="GetAltRef()+50 > GetPosAlt()" vmode="throttle"/>
|
||||||
|
<deroute block="Standby"/>
|
||||||
|
</block>
|
||||||
|
<block name="Route 1-2">
|
||||||
|
<go approaching_time="0" from="1" hmode="route" wp="2"/>
|
||||||
|
</block>
|
||||||
|
<block name="Stack wp 2">
|
||||||
|
<circle radius="75" wp="2"/>
|
||||||
|
</block>
|
||||||
|
<block name="Route 2-1">
|
||||||
|
<go approaching_time="0" from="2" hmode="route" wp="1"/>
|
||||||
|
</block>
|
||||||
|
<block name="Stack wp 1">
|
||||||
|
<circle radius="75" wp="1"/>
|
||||||
|
</block>
|
||||||
|
<block name="Glide 1-2">
|
||||||
|
<go from="1" hmode="route" vmode="glide" wp="2"/>
|
||||||
|
<deroute block="Standby"/>
|
||||||
|
</block>
|
||||||
|
<block name="Survey S1-S2" strip_button="Survey (wp S1-S2)" strip_icon="survey.png" group="Scan">
|
||||||
|
<survey_rectangle grid="150" wp1="S1" wp2="S2"/>
|
||||||
|
</block>
|
||||||
|
<block key="r" name="Land Right AF-TD" strip_button="Land right (wp AF-TD)" strip_icon="land-right.png" group="Land">
|
||||||
|
<set value="DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
||||||
|
<deroute block="land"/>
|
||||||
|
</block>
|
||||||
|
<block key="l" name="Land Left AF-TD" strip_button="Land left (wp AF-TD)" strip_icon="land-left.png" group="Land">
|
||||||
|
<set value="-DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
||||||
|
<deroute block="land"/>
|
||||||
|
</block>
|
||||||
|
<!-- ALT
|
||||||
|
<block key="<control>l" name="land">
|
||||||
|
<call_once fun="nav_compute_baseleg(WP_AF, WP_TD, WP_BASELEG, nav_radius)"/>
|
||||||
|
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="BASELEG"/>
|
||||||
|
<set var="v_ctl_auto_throttle_cruise_throttle" value="V_CTL_AUTO_THROTTLE_MIN_CRUISE_THROTTLE" />
|
||||||
|
<set var="v_ctl_auto_airspeed_setpoint" value="MINIMUM_AIRSPEED"/>
|
||||||
|
<circle radius="nav_radius" until="NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10) && 10 > fabs(GetPosAlt() - WaypointAlt(WP_BASELEG))" wp="BASELEG"/>
|
||||||
|
</block>-->
|
||||||
|
|
||||||
|
<!-- *********** Land *********** -->
|
||||||
|
|
||||||
|
<block key="r" name="ConstantSlopeLandRightAFTD" strip_button="Land right (wp AF-TD)" strip_icon="land-right.png" group="Land">
|
||||||
|
<set var="nav_radius" value="LANDING_CIRCLE_RADIUS"/>
|
||||||
|
<deroute block="ComputeLandingApproach"/>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<block key="l" name="ConstantSlopeLandLeftAFTD" strip_button="Land left (wp AF-TD)" strip_icon="land-left.png" group="Land">
|
||||||
|
<set var="nav_radius" value="-LANDING_CIRCLE_RADIUS"/>
|
||||||
|
<deroute block="ComputeLandingApproach"/>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<block name="ComputeLandingApproach" >
|
||||||
|
<call_once fun="nav_compute_final_from_glide(WP_AF, WP_TD, V_CTL_GLIDE_RATIO)"/>
|
||||||
|
<!-- CDW call_once fun="nav_compute_flare_from_aftd(WP_AF, WP_TD, WP_FLARE)"/-->
|
||||||
|
<call_once fun="DownlinkSendWpNr(WP_AF)"/>
|
||||||
|
<call_once fun="DownlinkSendWpNr(WP_FLARE)"/>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<block name="land">
|
||||||
|
<set value="nav_airspeed_nominal_setting" var="v_ctl_auto_airspeed_setpoint"/>
|
||||||
|
<call_once fun="nav_compute_baseleg(WP_AF, WP_TD, WP__BASELEG, nav_radius)"/>
|
||||||
|
<circle radius="nav_radius" until="NavCircleCount() > 0.5" wp="_BASELEG"/>
|
||||||
|
<set value="nav_airspeed_landing_setting" var="v_ctl_auto_airspeed_setpoint"/>
|
||||||
|
<circle radius="nav_radius" until="NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10) && 15 > fabs(GetPosAlt() - WaypointAlt(WP__BASELEG))" wp="_BASELEG"/>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<block name="Final">
|
||||||
|
<!--<call_once fun="AirbrakesOn()"/>-->
|
||||||
|
<go approaching_time="6" from="AF" hmode="route" wp="TD"/>
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<block name="Flare">
|
||||||
|
<call_once fun="NavKillThrottle()" />
|
||||||
|
<set value="nav_airspeed_landing_setting*0.8" var="v_ctl_auto_airspeed_setpoint"/>
|
||||||
|
<go approaching_time="0" from="TD" hmode="route" wp="FLARE"/>
|
||||||
|
<!-- TODO: retract brake just before landed is true (with +?3 seconds margin) or better sensing IsAircraftAlmostOnSolidGround
|
||||||
|
To avoid ripped of brake used control surfaces if AC has no landing gear -->
|
||||||
|
</block>
|
||||||
|
|
||||||
|
<!-- Extras -->
|
||||||
|
<block name="Steps roll -10, +10">
|
||||||
|
<while cond="TRUE">
|
||||||
|
<attitude alt="GetPosAlt()" roll="10.0" until=" stage_time > 6" vmode="alt"/>
|
||||||
|
<attitude alt="GetPosAlt()" roll="-10.0" until="stage_time > 6" vmode="alt"/>
|
||||||
|
</while>
|
||||||
|
</block>
|
||||||
|
<block name="Steps roll -20, +20">
|
||||||
|
<while cond="TRUE">
|
||||||
|
<attitude alt="GetPosAlt()" roll="20.0" until=" stage_time > 3" vmode="alt"/>
|
||||||
|
<attitude alt="GetPosAlt()" roll="-20.0" until="stage_time > 3" vmode="alt"/>
|
||||||
|
</while>
|
||||||
|
</block>
|
||||||
|
<block name="Steps roll from var">
|
||||||
|
<while cond="TRUE">
|
||||||
|
<attitude alt="GetPosAlt()" roll="roll_step" until=" stage_time > 3" vmode="alt"/>
|
||||||
|
<attitude alt="GetPosAlt()" roll="-roll_step" until="stage_time > 3" vmode="alt"/>
|
||||||
|
</while>
|
||||||
|
</block>
|
||||||
|
<block name="Steps pitch -10, +10">
|
||||||
|
<while cond="TRUE">
|
||||||
|
<attitude alt="GetPosAlt()" pitch="10" roll="0.0" until=" stage_time > 2" vmode="alt"/>
|
||||||
|
<attitude alt="GetPosAlt()" pitch="-10" roll="0.0" until=" stage_time > 2" vmode="alt"/>
|
||||||
|
</while>
|
||||||
|
</block>
|
||||||
|
<block name="Heading 30">
|
||||||
|
<heading alt="GetAltRef()+80" course="30" until="FALSE"/><!-- better test your missionboundary first ;)-->
|
||||||
|
</block>
|
||||||
|
<block name="For loop (circles wp 1)">
|
||||||
|
<for from="0" to="3" var="i">
|
||||||
|
<circle radius="DEFAULT_CIRCLE_RADIUS+ $i*10" wp="1" until="NavCircleCount() > 1"/>
|
||||||
|
</for>
|
||||||
|
<deroute block="Standby"/>
|
||||||
|
</block>
|
||||||
|
<block name="Flower (wp 1-2)" strip_button="Flower" strip_icon="observe.png" group="Scan">
|
||||||
|
<call_once fun="nav_flower_setup(WP_1, WP_2)"/>
|
||||||
|
<call fun="nav_flower_run()"/>
|
||||||
|
</block>
|
||||||
|
<block name="Test datalink (go to wp 2)">
|
||||||
|
<exception cond="datalink_time > 22" deroute="Standby"/>
|
||||||
|
<go from="STDBY" hmode="route" wp="2"/>
|
||||||
|
<go from="2" hmode="route" wp="STDBY"/>
|
||||||
|
</block>
|
||||||
|
<block name="Fly in Square">
|
||||||
|
<exception cond="!InsideSquare(GetPosX(), GetPosY())" deroute="Come back wp 1"/>
|
||||||
|
<attitude alt="GetAltRef()+75" roll="0" vmode="alt"/>
|
||||||
|
</block>
|
||||||
|
<block name="Come back wp 1">
|
||||||
|
<exception cond="InsideSquare(GetPosX(), GetPosY())" deroute="Fly in Square"/>
|
||||||
|
<go wp="1"/>
|
||||||
|
<deroute block="Fly in Square"/>
|
||||||
|
</block>
|
||||||
|
<block name="Vertical Raster">
|
||||||
|
<call_once fun="nav_vertical_raster_setup()"/>
|
||||||
|
<call fun="nav_vertical_raster_run(WP_S1, WP_S2, nav_radius, 50)"/>
|
||||||
|
</block>
|
||||||
|
<block key="<Control>f" name="TestToFar">
|
||||||
|
<go wp="TESTTOOFAR"/>
|
||||||
|
</block>
|
||||||
|
</blocks>
|
||||||
|
</flight_plan>
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
<!DOCTYPE layout SYSTEM "../layout.dtd">
|
||||||
|
|
||||||
|
<layout width="1920" height="1009">
|
||||||
|
<rows>
|
||||||
|
<columns SIZE="400">
|
||||||
|
<rows SIZE="300">
|
||||||
|
<widget NAME="strips" size="352"/>
|
||||||
|
<widget NAME="alarms" size="98"/>
|
||||||
|
<widget NAME="plugin" size="1"/>
|
||||||
|
</rows>
|
||||||
|
<widget NAME="map2d" size="1496">
|
||||||
|
<papget type="message_field" display="text" x="16" y="172">
|
||||||
|
<property name="scale" value="0.1"/>
|
||||||
|
<property name="field" value="FBW_STATUS:vsupply"/>
|
||||||
|
<property name="format" value="FTD %.1f V"/>
|
||||||
|
<property name="size" value="15."/>
|
||||||
|
<property name="color" value="#00ff00"/>
|
||||||
|
</papget>
|
||||||
|
<papget type="message_field" display="text" x="252" y="3">
|
||||||
|
<property name="scale" value="0.001"/>
|
||||||
|
<property name="field" value="MOTOR:current"/>
|
||||||
|
<property name="format" value="Mot %.2f A"/>
|
||||||
|
<property name="size" value="15."/>
|
||||||
|
<property name="color" value="#00ff00"/>
|
||||||
|
</papget>
|
||||||
|
<papget type="message_field" display="text" x="25" y="227">
|
||||||
|
<property name="scale" value="1."/>
|
||||||
|
<property name="field" value="FBW_STATUS:mode"/>
|
||||||
|
<property name="format" value="FBW %.0f"/>
|
||||||
|
<property name="size" value="15."/>
|
||||||
|
<property name="color" value="#00ff00"/>
|
||||||
|
</papget>
|
||||||
|
<papget type="message_field" display="text" x="16" y="140">
|
||||||
|
<property name="scale" value="1."/>
|
||||||
|
<property name="field" value="AIR_DATA:airspeed"/>
|
||||||
|
<property name="format" value="AS %.2f m/s"/>
|
||||||
|
<property name="size" value="15."/>
|
||||||
|
<property name="color" value="#00ff00"/>
|
||||||
|
</papget>
|
||||||
|
<papget type="message_field" display="text" x="924" y="46">
|
||||||
|
<property name="scale" value="3.28084"/>
|
||||||
|
<property name="field" value="AIR_DATA:amsl_baro"/>
|
||||||
|
<property name="ac_id" value="replay6"/>
|
||||||
|
<property name="format" value="AMSL %.2f ft"/>
|
||||||
|
<property name="size" value="15."/>
|
||||||
|
<property name="color" value="#00ff00"/>
|
||||||
|
</papget>
|
||||||
|
</widget>
|
||||||
|
</columns>
|
||||||
|
<widget NAME="aircraft" size="539"/>
|
||||||
|
</rows>
|
||||||
|
</layout>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<layout width="1855" height="1056">
|
||||||
|
<rows>
|
||||||
|
<widget NAME="map2d" size="500">
|
||||||
|
<papget type="video_plugin" display="plugin" x="30" y="50">
|
||||||
|
<property name="command" value="gst-launch-1.0 'application\/x-rtp, payload=96' ! videorate ! rtph264depay config-interval=1 ! avdec_h264 ! autovideosink ! videoscale ! udpsink host=192.168.42.1 port=55004"/>"
|
||||||
|
<property NAME="width" VALUE="640"/>
|
||||||
|
<property NAME="height" VALUE="360"/>
|
||||||
|
</papget>
|
||||||
|
<widget>
|
||||||
|
<columns>
|
||||||
|
<rows SIZE="375">
|
||||||
|
<widget NAME="strips" size="548"/>
|
||||||
|
</rows>
|
||||||
|
<widget NAME="aircraft" size="1002"/>
|
||||||
|
<widget NAME="alarms" size="464"/>
|
||||||
|
</columns>
|
||||||
|
</rows>
|
||||||
|
</layout>
|
||||||
@@ -60,6 +60,11 @@
|
|||||||
<property name="size" value="100."/>
|
<property name="size" value="100."/>
|
||||||
<property name="text" value="Throttle(%)"/>
|
<property name="text" value="Throttle(%)"/>
|
||||||
</papget>
|
</papget>
|
||||||
|
<papget type="video_plugin" display="plugin" x="30" y="50">
|
||||||
|
<property name="command" value="'gst-launch-1.0 udpsrc port=55004 ! 'application/x-rtp, payload=96' ! rtph264depay ! avdec_h264 ! autovideosink'"/>"
|
||||||
|
<property NAME="width" VALUE="320"/>
|
||||||
|
<property NAME="height" VALUE="240"/>
|
||||||
|
</papget>
|
||||||
</widget>
|
</widget>
|
||||||
<columns>
|
<columns>
|
||||||
<rows SIZE="275">
|
<rows SIZE="275">
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<layout width="1918" height="1095">
|
||||||
|
<rows>
|
||||||
|
<widget NAME="map2d" SIZE="850">
|
||||||
|
<papget type="video_plugin" display="plugin" x="30" y="50">
|
||||||
|
<!-- <property name="command" value="gst-launch-1.0 'application\/x-rtp, payload=96' ! videorate ! rtph264depay config-interval=1 ! avdec_h264 ! videoscale ! udpsink host=192.168.42.1 port=55004 ! autovideosink"/>"-->
|
||||||
|
<property name="command" value="gst-launch-1.0 -v videotestsrc ! ximagesink"/>"
|
||||||
|
<property NAME="width" VALUE="640"/>
|
||||||
|
<property NAME="height" VALUE="360"/>
|
||||||
|
</papget>
|
||||||
|
</widget>
|
||||||
|
<columns>
|
||||||
|
<rows SIZE="275">
|
||||||
|
<widget NAME="strips" SIZE="650"/>
|
||||||
|
</rows>
|
||||||
|
<widget size="100" name="altgraph"/>
|
||||||
|
<widget NAME="aircraft" SIZE="650"/>
|
||||||
|
<widget NAME="alarms"/>
|
||||||
|
</columns>
|
||||||
|
</rows>
|
||||||
|
</layout>
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
<!DOCTYPE module SYSTEM "./module.dtd">
|
||||||
|
<module name="dc_ctrl_parrot_mykonos" dir="digital_cam">
|
||||||
|
<doc>
|
||||||
|
<description>
|
||||||
|
Control the Parrot Bebop, Bebop2 and Disco cameras via native Parrot IMaging Process(PIMP).
|
||||||
|
It can trigger photos based on distance, time or circle radius in both fixedwings and rotorcraft.
|
||||||
|
One can start to record onboard videos and start and stop streaming of live video.
|
||||||
|
Show it in your GCS via mplayer plugin or e.g.
|
||||||
|
gst-launch-1.0 udpsrc port=55004 ! "application/x-rtp, payload=96" ! rtph264depay ! avdec_h264 ! autovideosink
|
||||||
|
</description>
|
||||||
|
<define name="DC_AUTOSHOOT_PERIOD" value="3.0" description="Period for DC_AUTOSHOOT_PERIODIC in seconds"/>
|
||||||
|
<define name="DC_AUTOSHOOT_DISTANCE_INTERVAL" value="50" description="Photo distance in meters"/>
|
||||||
|
<define name="DC_CTRL_PARROT_MYKONOS_SYNC_SEND" value="TRUE|FALSE" description="Enable telemetry report on camera position"/>
|
||||||
|
<define name="DC_CTRL_PARROT_MYKONOS_LOG" value="TRUE|FALSE" description="Enable embedding of camera shot orientation and position in image exif"/>
|
||||||
|
</doc>
|
||||||
|
<settings>
|
||||||
|
<dl_settings name="control">
|
||||||
|
<dl_settings name="ParrotCam">
|
||||||
|
|
||||||
|
<dl_setting max="7" min="0" step="1" module="digital_cam/dc_ctrl_parrot_mykonos" var="dc_ctrl_parrot_mykonos.status" handler="SendCmd" shortname="ParrotCam" values="None|StartRecord|StopRecord|Shoot|StartStream|StopStream|StartPeriodic|StopAutoshoot">
|
||||||
|
<strip_button name="Start Record" icon="lookfore.png" value="1" group="parrot"/>
|
||||||
|
<strip_button name="Stop Record" icon="kill.png" value="2" group="parrot"/>
|
||||||
|
<strip_button name="Take Picture" icon="digital-camera.png" value="3" group="parrot"/>
|
||||||
|
<strip_button name="Start Stream" icon="lookfore.png" value="4" group="parrot"/>
|
||||||
|
<strip_button name="Stop Stream" icon="kill.png" value="5" group="parrot"/>
|
||||||
|
<strip_button name="Start Autoshoot Periodic" icon="dcstart.png" value="6" group="parrot"/>
|
||||||
|
<strip_button name="Stop Autoshoot" icon="dcstop.png" value="7" group="parrot"/>
|
||||||
|
</dl_setting>
|
||||||
|
|
||||||
|
<dl_setting max="3" min="0" step="1" var="dc_autoshoot" values="STOP|PERIODIC|DISTANCE|EXT_TRIG">
|
||||||
|
<strip_button name="Start Autoshoot" icon="dcstart.png" value="1" group="parrot"/>
|
||||||
|
<strip_button name="Stop Autoshoot" icon="dcstop.png" value="0" group="parrot"/>
|
||||||
|
</dl_setting>
|
||||||
|
|
||||||
|
<dl_setting max="60" min="0.1" step="0.5" var="dc_autoshoot_period" shortname="Periodic" param="DC_AUTOSHOOT_PERIOD" unit="sec"/>
|
||||||
|
<dl_setting max="255" min="0" step="1" var="dc_distance_interval" shortname="dist" param="DC_AUTOSHOOT_DISTANCE_INTERVAL" unit="meter"/>
|
||||||
|
|
||||||
|
<dl_setting max="250" min="0" step="5" module="digital_cam/dc" var="dc_survey_interval" handler="Survey" shortname="Survey-Interval"/>
|
||||||
|
<dl_setting max="90" min="5" step="5" module="digital_cam/dc" var="dc_circle_interval" handler="Circle" shortname="Circle-Interval"/>
|
||||||
|
<dl_setting max="1" min="0" step="1" var="dc_cam_tracing" shortname="Cam-Tracing"/>
|
||||||
|
</dl_settings>
|
||||||
|
</dl_settings>
|
||||||
|
</settings>
|
||||||
|
<conflicts>digital_cam,digital_cam_servo,digital_cam_i2co,digital_cam_i2c,digital_cam_video</conflicts>
|
||||||
|
<header>
|
||||||
|
<file name="dc_ctrl_parrot_mykonos.h"/>
|
||||||
|
<file name="dc.h"/>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<init fun="dc_ctrl_parrot_mykonos_init()"/>
|
||||||
|
|
||||||
|
<periodic fun="dc_ctrl_parrot_mykonos_periodic()" freq="10"/>
|
||||||
|
<periodic fun="dc_ctrl_parrot_mykonos_autoshoot()" freq="10" start="dc_ctrl_parrot_mykonos_autoshoot_start()" autorun="FALSE"/>
|
||||||
|
<makefile target="sim|nps">
|
||||||
|
</makefile>
|
||||||
|
<makefile target="ap|sim"><!-- Add nps -->
|
||||||
|
<define name="DIGITAL_CAM" />
|
||||||
|
<file name="dc.c"/>
|
||||||
|
<file name="dc_ctrl_parrot_mykonos.c"/>
|
||||||
|
</makefile>
|
||||||
|
</module>
|
||||||
@@ -3,16 +3,16 @@
|
|||||||
<module name="flight_benchmark" dir="benchmark">
|
<module name="flight_benchmark" dir="benchmark">
|
||||||
<doc>
|
<doc>
|
||||||
<description>
|
<description>
|
||||||
Flight benchmark.
|
Flight benchmark for fixedwing.
|
||||||
This module allows a quantitative assessment of the flight. It calculates the sum of squared error of the two-dimensional course (x / y), the altitude and true airspeed. The sum of squared error of the course and altitude were separated, because they are regulated separately, and so they dependent on various parameters. The module was written to optimize the control parameters and has already been used successfully.
|
This module allows a quantitative assessment of a flight. It calculates the sum of squared error of the two-dimensional course (x / y), the altitude and true airspeed. The sum of squared error of the course and altitude were separated, because they are regulated separately, and so they dependent on various parameters. The module was written to optimize the control parameters and has already been used successfully.
|
||||||
|
|
||||||
The measurement is not started until about the variable benchm_go is set to 1.
|
The measurement is not started until about the variable benchm_go is set to 1. Could also be set from within a flightplan for automated Becnhmarking.
|
||||||
|
|
||||||
The sum of squared error can by reseted by changing the boolean variable benchm_reset to zero (will turn back to 1 automatically after it has done the reset). This can also be used in a flight plan, which allows a flight plan with auto-reset. So it is possible to fly an oval or a eight figure with a sum of squared error that will be reseted at the very same point of the figure.
|
The sum of squared error can by reseted by changing the boolean variable benchm_reset to zero. It will turn back to 1 automatically after it has done the reset). This can also be used in a flight plan, which allows a flight plan with auto-reset. So it is possible to fly an oval or a eight figure with a sum of squared error that will be reseted at the very same point of the figure.
|
||||||
</description>
|
</description>
|
||||||
<define name="BENCHMARK_AIRSPEED" description="enable airspeed benchmarking (only with airspeed module)"/>
|
<define name="BENCHMARK_AIRSPEED" description="Add to enable airspeed benchmarking (only with airspeed module)"/>
|
||||||
<define name="BENCHMARK_ALTITUDE" description="enable altitude benchmarking"/>
|
<define name="BENCHMARK_ALTITUDE" description="Add to enable altitude benchmarking"/>
|
||||||
<define name="BENCHMARK_POSITION" description="enable position (x/y) benchmarking. (shortest error to the path)"/>
|
<define name="BENCHMARK_POSITION" description="Add to enable position (x/y) benchmarking. (shortest error to the path)"/>
|
||||||
<define name="BENCHMARK_TOLERANCE_AIRSPEED" value="0." description="define the tolerated value where the sum of squared error won't change. Set to zero to have no tolerance."/>
|
<define name="BENCHMARK_TOLERANCE_AIRSPEED" value="0." description="define the tolerated value where the sum of squared error won't change. Set to zero to have no tolerance."/>
|
||||||
<define name="BENCHMARK_TOLERANCE_ALTITUDE" value="0." description="define the tolerated value where the sum of squared error won't change. Set to zero to have no tolerance."/>
|
<define name="BENCHMARK_TOLERANCE_ALTITUDE" value="0." description="define the tolerated value where the sum of squared error won't change. Set to zero to have no tolerance."/>
|
||||||
<define name="BENCHMARK_TOLERANCE_POSITION" value="0." description="define the tolerated value where the sum of squared error won't change. Set to zero to have no tolerance."/>
|
<define name="BENCHMARK_TOLERANCE_POSITION" value="0." description="define the tolerated value where the sum of squared error won't change. Set to zero to have no tolerance."/>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
<process name="Ap">
|
<process name="Ap">
|
||||||
<mode name="default">
|
<mode name="default">
|
||||||
<message name="AUTOPILOT_VERSION" period="11.1"/>
|
<message name="AUTOPILOT_VERSION" period="11.1"/>
|
||||||
|
<message name="RSSI_COMBINED" period="0.3"/>
|
||||||
<message name="AIRSPEED" period="0.2"/>
|
<message name="AIRSPEED" period="0.2"/>
|
||||||
<message name="ALIVE" period="5.1"/>
|
<message name="ALIVE" period="5.1"/>
|
||||||
<message name="GPS" period="0.25"/>
|
<message name="GPS" period="0.25"/>
|
||||||
@@ -34,7 +35,7 @@
|
|||||||
<message name="COMMANDS" period="4.0"/>
|
<message name="COMMANDS" period="4.0"/>
|
||||||
<message name="FBW_STATUS" period="2.0"/>
|
<message name="FBW_STATUS" period="2.0"/>
|
||||||
<message name="AIR_DATA" period="0.5"/>
|
<message name="AIR_DATA" period="0.5"/>
|
||||||
<message name="SONAR" period="0.1"/>
|
<message name="SONAR" period="0.3"/>
|
||||||
</mode>
|
</mode>
|
||||||
<mode name="minimal">
|
<mode name="minimal">
|
||||||
<message name="ALIVE" period="5"/>
|
<message name="ALIVE" period="5"/>
|
||||||
@@ -61,12 +62,14 @@
|
|||||||
<message name="ALIVE" period="5"/>
|
<message name="ALIVE" period="5"/>
|
||||||
<message name="GPS" period="5.1"/>
|
<message name="GPS" period="5.1"/>
|
||||||
<message name="ESTIMATOR" period="5.3"/>
|
<message name="ESTIMATOR" period="5.3"/>
|
||||||
|
<message name="AIRSPEED" period="5.2"/>
|
||||||
<message name="BAT" period="10.1"/>
|
<message name="BAT" period="10.1"/>
|
||||||
<message name="DESIRED" period="10.2"/>
|
<message name="DESIRED" period="10.2"/>
|
||||||
<message name="NAVIGATION" period="5.4"/>
|
<message name="NAVIGATION" period="5.4"/>
|
||||||
<message name="PPRZ_MODE" period="7.5"/>
|
<message name="PPRZ_MODE" period="7.5"/>
|
||||||
<message name="STATE_FILTER_STATUS" period="8."/>
|
<message name="STATE_FILTER_STATUS" period="8."/>
|
||||||
<message name="DATALINK_REPORT" period="5.7"/>
|
<message name="DATALINK_REPORT" period="5.7"/>
|
||||||
|
<message name="RSSI_COMBINED" period="3.3"/>
|
||||||
</mode>
|
</mode>
|
||||||
<mode name="raw_sensors">
|
<mode name="raw_sensors">
|
||||||
<message name="DL_VALUE" period="0.5"/>
|
<message name="DL_VALUE" period="0.5"/>
|
||||||
|
|||||||
@@ -5,11 +5,11 @@
|
|||||||
airframe="airframes/OPENUAS/openuas_parrot_disco.xml"
|
airframe="airframes/OPENUAS/openuas_parrot_disco.xml"
|
||||||
radio="radios/OPENUAS/openuas_sbus_out.xml"
|
radio="radios/OPENUAS/openuas_sbus_out.xml"
|
||||||
telemetry="telemetry/OPENUAS/openuas_fixedwing_imu.xml"
|
telemetry="telemetry/OPENUAS/openuas_fixedwing_imu.xml"
|
||||||
flight_plan="flight_plans/OPENUAS/openuas_versatile.xml"
|
flight_plan="flight_plans/OPENUAS/openuas_versatile_unified.xml"
|
||||||
settings="settings/fixedwing_basic.xml"
|
settings="settings/fixedwing_basic.xml settings/control/ctl_energyadaptive.xml settings/estimation/ac_char.xml settings/control/ctl_adaptive_h_ff.xml"
|
||||||
settings_modules="modules/digital_cam_video.xml modules/video_capture.xml modules/photogrammetry_calculator.xml modules/nav_smooth.xml modules/nav_survey_poly_osam.xml modules/geo_mag.xml modules/air_data.xml modules/nav_basic_fw.xml modules/guidance_full_pid_fw.xml modules/stabilization_adaptive_fw.xml modules/ahrs_float_cmpl_quat.xml modules/ahrs_int_cmpl_quat.xml modules/gps.xml modules/flight_benchmark.xml modules/airspeed_ms45xx_i2c.xml modules/gps_ubx_ucenter.xml modules/imu_common.xml"
|
settings_modules="modules/digital_cam_video.xml modules/dc_ctrl_parrot_mykonos.xml modules/video_capture.xml modules/photogrammetry_calculator.xml modules/nav_smooth.xml modules/nav_survey_poly_osam.xml modules/geo_mag.xml modules/air_data.xml modules/nav_basic_fw.xml modules/guidance_energy.xml modules/stabilization_adaptive_fw.xml modules/ahrs_float_cmpl_quat.xml modules/tune_airspeed.xml modules/ahrs_int_cmpl_quat.xml modules/gps.xml modules/airspeed_ms45xx_i2c.xml modules/gps_ubx_ucenter.xml modules/imu_common.xml"
|
||||||
gui_color="#f39cf39cf39c"
|
gui_color="#f39cf39cf39c"
|
||||||
release="5a6b25fcd07ac1277f008c15ae3aef71870e9ce4"
|
release="8e50f043b163f2b838dadaf1740a3e17b292505b"
|
||||||
/>
|
/>
|
||||||
<aircraft
|
<aircraft
|
||||||
name="EFlite-T28"
|
name="EFlite-T28"
|
||||||
@@ -18,7 +18,7 @@
|
|||||||
radio="radios/spektrum.xml"
|
radio="radios/spektrum.xml"
|
||||||
telemetry="telemetry/OPENUAS/openuas_fixedwing_imu_rc.xml"
|
telemetry="telemetry/OPENUAS/openuas_fixedwing_imu_rc.xml"
|
||||||
flight_plan="flight_plans/versatile.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="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"
|
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"
|
gui_color="#ffffffffffff"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
<program name="Settings" command="sw/ground_segment/tmtc/settings">
|
<program name="Settings" command="sw/ground_segment/tmtc/settings">
|
||||||
<arg flag="-ac" constant="@AIRCRAFT"/>
|
<arg flag="-ac" constant="@AIRCRAFT"/>
|
||||||
</program>
|
</program>
|
||||||
<program name="Settings (Python)" command="sw/ground_segment/python/settings_app/settingsapp.py"/>
|
|
||||||
<program name="GPSd position display" command="sw/ground_segment/tmtc/gpsd2ivy"/>
|
<program name="GPSd position display" command="sw/ground_segment/tmtc/gpsd2ivy"/>
|
||||||
<program name="Log Plotter" command="sw/logalizer/logplotter"/>
|
<program name="Log Plotter" command="sw/logalizer/logplotter"/>
|
||||||
<program name="Real-time Plotter" command="sw/logalizer/plotter"/>
|
<program name="Real-time Plotter" command="sw/logalizer/plotter"/>
|
||||||
@@ -37,14 +36,8 @@
|
|||||||
</program>
|
</program>
|
||||||
<program name="Hardware in the Loop" command="sw/simulator/simhitl"/>
|
<program name="Hardware in the Loop" command="sw/simulator/simhitl"/>
|
||||||
<program name="Environment Simulator" command="sw/simulator/gaia"/>
|
<program name="Environment Simulator" command="sw/simulator/gaia"/>
|
||||||
<program name="Http Server" command="$python">
|
|
||||||
<arg flag="-m" constant="SimpleHTTPServer"/>
|
|
||||||
<arg flag="8889"/>
|
|
||||||
</program>
|
|
||||||
<program name="Plot Meteo Profile" command="sw/logalizer/plotprofile"/>
|
|
||||||
<program name="Weather Station" command="sw/ground_segment/misc/davis2ivy">
|
|
||||||
<arg flag="-d" constant="/dev/ttyUSB1"/>
|
|
||||||
</program>
|
|
||||||
<program name="Attitude Visualizer" command="sw/tools/attitude_viz.py"/>
|
<program name="Attitude Visualizer" command="sw/tools/attitude_viz.py"/>
|
||||||
<program name="App Server" command="sw/ground_segment/tmtc/app_server"/>
|
<program name="App Server" command="sw/ground_segment/tmtc/app_server"/>
|
||||||
<program name="NatNet" command="sw/ground_segment/misc/natnet2ivy"/>
|
<program name="NatNet" command="sw/ground_segment/misc/natnet2ivy"/>
|
||||||
@@ -66,20 +59,6 @@
|
|||||||
</program>
|
</program>
|
||||||
</section>
|
</section>
|
||||||
<section name="sessions">
|
<section name="sessions">
|
||||||
<session name="OpenUAS USB0: Xtend Transparent @9600 with HW flowcontrol">
|
|
||||||
<program name="Data Link">
|
|
||||||
<arg flag="-d" constant="/dev/ttyUSB0"/>
|
|
||||||
<arg flag="-uplink"/>
|
|
||||||
<arg flag="-s" constant="9600"/>
|
|
||||||
<arg flag="-hfc"/>
|
|
||||||
</program>
|
|
||||||
<program name="Server"/>
|
|
||||||
<program name="GCS">
|
|
||||||
<arg flag="-speech"/>
|
|
||||||
<arg flag="-layout" constant="./OpenUAS/gcsHeering.xml"/>
|
|
||||||
</program>
|
|
||||||
<program name="Messages"/>
|
|
||||||
</session>
|
|
||||||
<session name="Scaled Sensors">
|
<session name="Scaled Sensors">
|
||||||
<program name="Data Link">
|
<program name="Data Link">
|
||||||
<arg flag="-d" constant="/dev/ttyUSB0"/>
|
<arg flag="-d" constant="/dev/ttyUSB0"/>
|
||||||
@@ -123,32 +102,6 @@
|
|||||||
<arg flag="-c" constant="*:telemetry:IMU_MAG_SCALED:mz:0.0004883"/>
|
<arg flag="-c" constant="*:telemetry:IMU_MAG_SCALED:mz:0.0004883"/>
|
||||||
</program>
|
</program>
|
||||||
</session>
|
</session>
|
||||||
<session name="ARDrone2 Flight Video Debug 2">
|
|
||||||
<program name="Server">
|
|
||||||
<arg flag="-n"/>
|
|
||||||
</program>
|
|
||||||
<program name="GCS">
|
|
||||||
<arg flag="-plugin" constant="cvlc --udp-caching=1 --rtp-caching=0 --live-caching=0 --rtsp-caching=0 --clock-jitter=0 --clock-synchro=0 file:///home/n3yh3hnii/paparazzi/sw/ext/ardrone2_vision/ardrone2_gstreamer/sdp/x86_config-mjpeg.sdp --drawable-xid="/>
|
|
||||||
<arg flag="-layout" constant="ardrone_video.xml"/>
|
|
||||||
</program>
|
|
||||||
<program name="Data Link">
|
|
||||||
<arg flag="-udp"/>
|
|
||||||
</program>
|
|
||||||
<program name="Messages"/>
|
|
||||||
</session>
|
|
||||||
<session name="ARDrone2 Flight Video Debug 2">
|
|
||||||
<program name="Server">
|
|
||||||
<arg flag="-n"/>
|
|
||||||
</program>
|
|
||||||
<program name="GCS">
|
|
||||||
<arg flag="-plugin" constant="cvlc --udp-caching=1 --rtp-caching=0 --live-caching=0 --rtsp-caching=0 --clock-jitter=0 --clock-synchro=0 file:///home/n3yh3hnii/paparazzi/sw/ext/ardrone2_vision/ardrone2_gstreamer/sdp/x86_config-mjpeg.sdp --drawable-xid="/>
|
|
||||||
<arg flag="-layout" constant="ardrone_video.xml"/>
|
|
||||||
</program>
|
|
||||||
<program name="Data Link">
|
|
||||||
<arg flag="-udp"/>
|
|
||||||
</program>
|
|
||||||
<program name="Messages"/>
|
|
||||||
</session>
|
|
||||||
<session name="USB: BlueTooth @ 57600">
|
<session name="USB: BlueTooth @ 57600">
|
||||||
<program name="Data Link">
|
<program name="Data Link">
|
||||||
<arg flag="-d" constant="/dev/rfcomm0"/>
|
<arg flag="-d" constant="/dev/rfcomm0"/>
|
||||||
@@ -213,59 +166,10 @@
|
|||||||
</program>
|
</program>
|
||||||
<program name="Link Combiner"/>
|
<program name="Link Combiner"/>
|
||||||
</session>
|
</session>
|
||||||
<session name="ARDrone2 Magneto Debug Graphs">
|
|
||||||
<program name="Server">
|
|
||||||
<arg flag="-n"/>
|
|
||||||
</program>
|
|
||||||
<program name="Data Link">
|
|
||||||
<arg flag="-udp"/>
|
|
||||||
</program>
|
|
||||||
<program name="Real-time Plotter">
|
|
||||||
<arg flag="-t" constant="'MX'"/>
|
|
||||||
<arg flag="-u" constant="0.05"/>
|
|
||||||
<arg flag="-m" constant="1000"/>
|
|
||||||
<arg flag="-g" constant="'640x300+0+0'"/>
|
|
||||||
<arg flag="-c" constant="'*:telemetry:ARDRONE_NAVDATA:mx'"/>
|
|
||||||
</program>
|
|
||||||
<program name="Real-time Plotter">
|
|
||||||
<arg flag="-t" constant="'MY'"/>
|
|
||||||
<arg flag="-u" constant="0.05"/>
|
|
||||||
<arg flag="-m" constant="1000"/>
|
|
||||||
<arg flag="-g" constant="'640x300+640+0'"/>
|
|
||||||
<arg flag="-c" constant="'*:telemetry:ARDRONE_NAVDATA:my'"/>
|
|
||||||
</program>
|
|
||||||
<program name="Real-time Plotter">
|
|
||||||
<arg flag="-t" constant="'MZ'"/>
|
|
||||||
<arg flag="-u" constant="0.05"/>
|
|
||||||
<arg flag="-m" constant="1000"/>
|
|
||||||
<arg flag="-g" constant="'640x300+1280+0'"/>
|
|
||||||
<arg flag="-c" constant="'*:telemetry:ARDRONE_NAVDATA:mz'"/>
|
|
||||||
</program>
|
|
||||||
<program name="Messages"/>
|
|
||||||
</session>
|
|
||||||
<session name="ARDrone2 Flight n Video">
|
|
||||||
<program name="Server">
|
|
||||||
<arg flag="-no_md5_check"/>
|
|
||||||
</program>
|
|
||||||
<program name="GCS">
|
|
||||||
<arg flag="-plugin" constant="cvlc --udp-caching=1 --rtp-caching=0 --live-caching=0 --rtsp-caching=0 --clock-jitter=0 --clock-synchro=0 file:///home/n3yh3hnii/paparazzi/sw/ext/ardrone2_vision/ardrone2_gstreamer/sdp/x86_config-mjpeg.sdp --drawable-xid="/>
|
|
||||||
<arg flag="-layout" constant="ardrone_video.xml"/>
|
|
||||||
<arg flag="-speech"/>
|
|
||||||
<arg flag="-maps_fill"/>
|
|
||||||
<arg flag="-mercator"/>
|
|
||||||
<arg flag="-maps_no_http"/>
|
|
||||||
<arg flag="-track_size" constant="300"/>
|
|
||||||
<arg flag="-zoom" constant="0.5"/>
|
|
||||||
</program>
|
|
||||||
<program name="Data Link">
|
|
||||||
<arg flag="-udp"/>
|
|
||||||
</program>
|
|
||||||
<program name="Messages"/>
|
|
||||||
</session>
|
|
||||||
<session name="OpenUAS testflights">
|
<session name="OpenUAS testflights">
|
||||||
<program name="GCS">
|
<program name="GCS">
|
||||||
<arg flag="-speech"/>
|
<arg flag="-speech"/>
|
||||||
<arg flag="-layout" constant="horizontal.xml"/>
|
<arg flag="-layout" constant="OPENUAS/openuas_bottom_settings.xml"/>
|
||||||
<arg flag="-maximize"/>
|
<arg flag="-maximize"/>
|
||||||
<arg flag="-maps_fill"/>
|
<arg flag="-maps_fill"/>
|
||||||
<arg flag="-center_ac"/>
|
<arg flag="-center_ac"/>
|
||||||
@@ -290,35 +194,6 @@
|
|||||||
<program name="Server"/>
|
<program name="Server"/>
|
||||||
<program name="GCS"/>
|
<program name="GCS"/>
|
||||||
</session>
|
</session>
|
||||||
<session name="ARDrone2 Flight Video Debug Mplayer">
|
|
||||||
<program name="Server">
|
|
||||||
<arg flag="-n"/>
|
|
||||||
</program>
|
|
||||||
<program name="GCS">
|
|
||||||
<arg flag="-layout" constant="ardrone_simpleandvideo_mplayer.xml"/>
|
|
||||||
</program>
|
|
||||||
<program name="Data Link">
|
|
||||||
<arg flag="-udp"/>
|
|
||||||
</program>
|
|
||||||
</session>
|
|
||||||
<session name="cessna">
|
|
||||||
<program name="GCS">
|
|
||||||
<arg flag="-layout" constant="./TUDelft/cessna.xml"/>
|
|
||||||
<arg flag="-m" constant="./TUDelft/ehwo_gm.xml"/>
|
|
||||||
<arg flag="-zoom" constant="0.03"/>
|
|
||||||
</program>
|
|
||||||
<program name="Data Link">
|
|
||||||
<arg flag="-s" constant="57600"/>
|
|
||||||
<arg flag="-transport" constant="xbee"/>
|
|
||||||
<arg flag="-d" constant="/dev/ttyUSB0"/>
|
|
||||||
</program>
|
|
||||||
<program name="Messages"/>
|
|
||||||
<program name="Server"/>
|
|
||||||
<program name="IvySerialBridge">
|
|
||||||
<arg flag="25" constant="/dev/ttyUSB1"/>
|
|
||||||
<arg flag="4"/>
|
|
||||||
</program>
|
|
||||||
</session>
|
|
||||||
<session name="SupperBitRF cable telemetry">
|
<session name="SupperBitRF cable telemetry">
|
||||||
<program name="Data Link">
|
<program name="Data Link">
|
||||||
<arg flag="-d" constant="/dev/ttyACM1"/>
|
<arg flag="-d" constant="/dev/ttyACM1"/>
|
||||||
@@ -329,20 +204,6 @@
|
|||||||
<program name="Messages"/>
|
<program name="Messages"/>
|
||||||
<program name="Messages"/>
|
<program name="Messages"/>
|
||||||
</session>
|
</session>
|
||||||
<session name="SmartUAV">
|
|
||||||
<program name="Ivy2Udp">
|
|
||||||
<arg flag="-h" constant="127.0.0.1"/>
|
|
||||||
<arg flag="-id" constant="8"/>
|
|
||||||
</program>
|
|
||||||
<program name="SmartUAV">
|
|
||||||
<arg flag="1&>2"/>
|
|
||||||
</program>
|
|
||||||
</session>
|
|
||||||
<session name="Sony Control">
|
|
||||||
<program name="Sony">
|
|
||||||
<arg flag="-id" constant="22"/>
|
|
||||||
</program>
|
|
||||||
</session>
|
|
||||||
<session name="Accelo only Debug Graphs">
|
<session name="Accelo only Debug Graphs">
|
||||||
<program name="Real-time Plotter">
|
<program name="Real-time Plotter">
|
||||||
<arg flag="-t" constant="'Accel"/>
|
<arg flag="-t" constant="'Accel"/>
|
||||||
@@ -389,74 +250,13 @@
|
|||||||
</program>
|
</program>
|
||||||
<program name="Server"/>
|
<program name="Server"/>
|
||||||
</session>
|
</session>
|
||||||
<session name="ARDrone2 Baro Only Debug Graphs">
|
|
||||||
<program name="Real-time Plotter">
|
|
||||||
<arg flag="-t" constant="'Pressure'"/>
|
|
||||||
<arg flag="-u" constant="0.05"/>
|
|
||||||
<arg flag="-m" constant="1000"/>
|
|
||||||
<arg flag="-g" constant="'640x300+0+0'"/>
|
|
||||||
<arg flag="-c" constant="'*:telemetry:ARDRONE_NAVDATA:pressure'"/>
|
|
||||||
</program>
|
|
||||||
<program name="Real-time Plotter">
|
|
||||||
<arg flag="-t" constant="'Pressure"/>
|
|
||||||
<arg flag="temp'"/>
|
|
||||||
<arg flag="-u" constant="0.05"/>
|
|
||||||
<arg flag="-m" constant="1000"/>
|
|
||||||
<arg flag="-g" constant="'640x300+640+0'"/>
|
|
||||||
<arg flag="-c" constant="'*:telemetry:ARDRONE_NAVDATA:temperature_pressure'"/>
|
|
||||||
</program>
|
|
||||||
<program name="Real-time Plotter">
|
|
||||||
<arg flag="-t" constant="'Up'"/>
|
|
||||||
<arg flag="-u" constant="0.05"/>
|
|
||||||
<arg flag="-m" constant="1000"/>
|
|
||||||
<arg flag="-g" constant="'640x300+1280+0'"/>
|
|
||||||
<arg flag="-c" constant="'*:telemetry:ROTORCRAFT_FP:up'"/>
|
|
||||||
</program>
|
|
||||||
<program name="Real-time Plotter">
|
|
||||||
<arg flag="-t" constant="'Baro"/>
|
|
||||||
<arg flag="RAW'"/>
|
|
||||||
<arg flag="-u" constant="0.05"/>
|
|
||||||
<arg flag="-m" constant="1000"/>
|
|
||||||
<arg flag="-g" constant="'640x300+0+300'"/>
|
|
||||||
<arg flag="-c" constant="'*:telemetry:BARO_RAW:abs'"/>
|
|
||||||
</program>
|
|
||||||
<program name="Real-time Plotter">
|
|
||||||
<arg flag="-t" constant="'Pressure"/>
|
|
||||||
<arg flag="QFE'"/>
|
|
||||||
<arg flag="-u" constant="0.05"/>
|
|
||||||
<arg flag="-m" constant="1000"/>
|
|
||||||
<arg flag="-g" constant="'640x300+640+300'"/>
|
|
||||||
<arg flag="-c" constant="'*:telemetry:INS_REF:baro_qfe'"/>
|
|
||||||
</program>
|
|
||||||
</session>
|
|
||||||
<session name="Forward Skywalker to C172 over ttyUSB1">
|
<session name="Forward Skywalker to C172 over ttyUSB1">
|
||||||
<program name="IvySerialBridge">
|
<program name="IvySerialBridge">
|
||||||
<arg flag="8" constant="/dev/ttyUSB1"/>
|
<arg flag="8" constant="/dev/ttyUSB1"/>
|
||||||
</program>
|
</program>
|
||||||
</session>
|
</session>
|
||||||
<session name="ARDrone2 Flight">
|
|
||||||
<program name="Server"/>
|
|
||||||
<program name="GCS"/>
|
|
||||||
<program name="Data Link">
|
|
||||||
<arg flag="-udp"/>
|
|
||||||
</program>
|
|
||||||
</session>
|
|
||||||
<session name="ARDrone2 Flight">
|
|
||||||
<program name="Server"/>
|
|
||||||
<program name="GCS">
|
|
||||||
<arg flag="-speech"/>
|
|
||||||
<arg flag="-maps_fill"/>
|
|
||||||
<arg flag="-mercator"/>
|
|
||||||
<arg flag="-maps_no_http"/>
|
|
||||||
<arg flag="-track_size" constant="300"/>
|
|
||||||
<arg flag="-zoom" constant="0.5"/>
|
|
||||||
</program>
|
|
||||||
<program name="Messages"/>
|
|
||||||
<program name="Data Link">
|
|
||||||
<arg flag="-udp"/>
|
|
||||||
</program>
|
|
||||||
<program name="Real-time Plotter"/>
|
|
||||||
</session>
|
|
||||||
<session name="Messages and Settings">
|
<session name="Messages and Settings">
|
||||||
<program name="Data Link">
|
<program name="Data Link">
|
||||||
<arg flag="-d" constant="/dev/ttyUSB0"/>
|
<arg flag="-d" constant="/dev/ttyUSB0"/>
|
||||||
@@ -484,26 +284,10 @@
|
|||||||
<program name="Environment Simulator"/>
|
<program name="Environment Simulator"/>
|
||||||
<program name="Messages"/>
|
<program name="Messages"/>
|
||||||
</session>
|
</session>
|
||||||
<session name="ARDrone2 Flight Basic">
|
|
||||||
<program name="Server">
|
|
||||||
<arg flag="-n"/>
|
|
||||||
</program>
|
|
||||||
<program name="GCS">
|
|
||||||
<arg flag="-speech"/>
|
|
||||||
<arg flag="-maps_fill"/>
|
|
||||||
<arg flag="-mercator"/>
|
|
||||||
<arg flag="-maps_no_http"/>
|
|
||||||
<arg flag="-track_size" constant="100"/>
|
|
||||||
<arg flag="-zoom" constant="2"/>
|
|
||||||
</program>
|
|
||||||
<program name="Data Link">
|
|
||||||
<arg flag="-udp"/>
|
|
||||||
</program>
|
|
||||||
</session>
|
|
||||||
<session name="OpenUAS Simulation with OBC GUI">
|
<session name="OpenUAS Simulation with OBC GUI">
|
||||||
<program name="GCS">
|
<program name="GCS">
|
||||||
<arg flag="-speech"/>
|
<arg flag="-speech"/>
|
||||||
<arg flag="-layout" constant="./OpenUAS/openuas_searchandrescue2014.xml"/>
|
<arg flag="-layout" constant="./OPENUAS/openuas_searchandrescue2014.xml"/>
|
||||||
<arg flag="-center" constant="'WGS84"/>
|
<arg flag="-center" constant="'WGS84"/>
|
||||||
<arg flag="51.990" constant="4.378'"/>
|
<arg flag="51.990" constant="4.378'"/>
|
||||||
<arg flag="-ref" constant="'WGS84"/>
|
<arg flag="-ref" constant="'WGS84"/>
|
||||||
@@ -584,9 +368,6 @@
|
|||||||
<arg flag="-track_size" constant="200"/>
|
<arg flag="-track_size" constant="200"/>
|
||||||
</program>
|
</program>
|
||||||
</session>
|
</session>
|
||||||
<session name="VisionResults">
|
|
||||||
<program name="Vision Results"/>
|
|
||||||
</session>
|
|
||||||
<session name="Flight USB-serial@57600">
|
<session name="Flight USB-serial@57600">
|
||||||
<program name="Data Link">
|
<program name="Data Link">
|
||||||
<arg flag="-d" constant="/dev/ttyUSB0"/>
|
<arg flag="-d" constant="/dev/ttyUSB0"/>
|
||||||
@@ -603,59 +384,6 @@
|
|||||||
<program name="GCS"/>
|
<program name="GCS"/>
|
||||||
<program name="Messages"/>
|
<program name="Messages"/>
|
||||||
</session>
|
</session>
|
||||||
<session name="OpenUAS VisionEx">
|
|
||||||
<program name="Vision"/>
|
|
||||||
</session>
|
|
||||||
<session name="AR Simulation GCS layout test">
|
|
||||||
<program name="Server">
|
|
||||||
<arg flag="-n"/>
|
|
||||||
</program>
|
|
||||||
<program name="GCS">
|
|
||||||
<arg flag="-speech"/>
|
|
||||||
<arg flag="-layout" constant="ardrone_simple.xml"/>
|
|
||||||
<arg flag="-maps_fill"/>
|
|
||||||
<arg flag="-mercator"/>
|
|
||||||
<arg flag="-maps_no_http"/>
|
|
||||||
<arg flag="-track_size" constant="100"/>
|
|
||||||
<arg flag="-zoom" constant="1"/>
|
|
||||||
</program>
|
|
||||||
<program name="Simulator">
|
|
||||||
<arg flag="-a" constant="Psi"/>
|
|
||||||
<arg flag="-t" constant="nps"/>
|
|
||||||
</program>
|
|
||||||
</session>
|
|
||||||
<session name="ARDrone2 Flight Basic Layout">
|
|
||||||
<program name="Server">
|
|
||||||
<arg flag="-n"/>
|
|
||||||
</program>
|
|
||||||
<program name="GCS">
|
|
||||||
<arg flag="-speech"/>
|
|
||||||
<arg flag="-layout" constant="ardrone_simple.xml"/>
|
|
||||||
<arg flag="-maps_fill"/>
|
|
||||||
<arg flag="-mercator"/>
|
|
||||||
<arg flag="-maps_no_http"/>
|
|
||||||
<arg flag="-track_size" constant="100"/>
|
|
||||||
<arg flag="-zoom" constant="1"/>
|
|
||||||
</program>
|
|
||||||
</session>
|
|
||||||
<session name="DiscoLongRangeXbee">
|
|
||||||
<program name="Server"/>
|
|
||||||
<program name="GCS">
|
|
||||||
<arg flag="-speech"/>
|
|
||||||
<arg flag="-maps_fill"/>
|
|
||||||
<arg flag="-mercator"/>
|
|
||||||
<arg flag="-maps_no_http"/>
|
|
||||||
<arg flag="-track_size" constant="300"/>
|
|
||||||
<arg flag="-zoom" constant="0.5"/>
|
|
||||||
</program>
|
|
||||||
<program name="Messages"/>
|
|
||||||
<program name="Real-time Plotter"/>
|
|
||||||
<program name="Data Link">
|
|
||||||
<arg flag="-d" constant="/dev/ttyUSB0"/>
|
|
||||||
<arg flag="-transport" constant="xbee"/>
|
|
||||||
<arg flag="-s" constant="57600"/>
|
|
||||||
</program>
|
|
||||||
</session>
|
|
||||||
<session name="Disco Test Flight WiFi">
|
<session name="Disco Test Flight WiFi">
|
||||||
<program name="Server"/>
|
<program name="Server"/>
|
||||||
<program name="GCS">
|
<program name="GCS">
|
||||||
@@ -664,7 +392,7 @@
|
|||||||
<arg flag="-mercator"/>
|
<arg flag="-mercator"/>
|
||||||
<arg flag="-maps_no_http"/>
|
<arg flag="-maps_no_http"/>
|
||||||
<arg flag="-track_size" constant="200"/>
|
<arg flag="-track_size" constant="200"/>
|
||||||
<arg flag="-zoom" constant="0.5"/>
|
<arg flag="-zoom" constant="0.6"/>
|
||||||
</program>
|
</program>
|
||||||
<program name="Messages"/>
|
<program name="Messages"/>
|
||||||
<program name="Data Link">
|
<program name="Data Link">
|
||||||
|
|||||||
@@ -31,9 +31,24 @@
|
|||||||
|
|
||||||
/** uart connected to GPS internally */
|
/** uart connected to GPS internally */
|
||||||
#define UART1_DEV /dev/ttyPA1
|
#define UART1_DEV /dev/ttyPA1
|
||||||
|
|
||||||
#define GPS_UBX_ENABLE_NMEA_DATA_MASK 0xff
|
#define GPS_UBX_ENABLE_NMEA_DATA_MASK 0xff
|
||||||
/** FTDI cable for stereoboard or external GPS */
|
|
||||||
|
/** For using serial devices via USB to serial converter electronics
|
||||||
|
* E.g. a XBee modem, a 3DR radio modem, Serial Stereocam etc. etc.
|
||||||
|
*/
|
||||||
|
#ifndef UART2_DEV
|
||||||
#define UART2_DEV /dev/ttyUSB0
|
#define UART2_DEV /dev/ttyUSB0
|
||||||
|
#endif
|
||||||
|
#ifndef UART4_DEV
|
||||||
|
#define UART4_DEV /dev/ttyUSB1
|
||||||
|
#endif
|
||||||
|
#ifndef UART5_DEV
|
||||||
|
#define UART5_DEV /dev/ttyACM0
|
||||||
|
#endif
|
||||||
|
#ifndef UART6_DEV
|
||||||
|
#define UART6_DEV /dev/ttyACM1
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Default actuators driver */
|
/* Default actuators driver */
|
||||||
#define DEFAULT_ACTUATORS "boards/bebop/actuators.h"
|
#define DEFAULT_ACTUATORS "boards/bebop/actuators.h"
|
||||||
|
|||||||
@@ -31,13 +31,31 @@
|
|||||||
#include "boards/bebop/mt9f002.h"
|
#include "boards/bebop/mt9f002.h"
|
||||||
|
|
||||||
|
|
||||||
/** uart connected to GPS internally */
|
/** UART connected to GPS internally */
|
||||||
#define UART1_DEV /dev/ttyPA1
|
#define UART1_DEV /dev/ttyPA1
|
||||||
|
|
||||||
#define GPS_UBX_ENABLE_NMEA_DATA_MASK 0xff
|
#define GPS_UBX_ENABLE_NMEA_DATA_MASK 0xff
|
||||||
/** FTDI cable for stereoboard or external GPS */
|
|
||||||
|
/** For using serial devices via USB to serial converter electronics
|
||||||
|
* E.g. a XBee modem, a 3DR radio modem, Serial Stereocam etc. etc.
|
||||||
|
*/
|
||||||
|
#ifndef UART2_DEV
|
||||||
#define UART2_DEV /dev/ttyUSB0
|
#define UART2_DEV /dev/ttyUSB0
|
||||||
|
#endif
|
||||||
|
#ifndef UART4_DEV
|
||||||
|
#define UART4_DEV /dev/ttyUSB1
|
||||||
|
#endif
|
||||||
|
#ifndef UART5_DEV
|
||||||
|
#define UART5_DEV /dev/ttyACM0
|
||||||
|
#endif
|
||||||
|
#ifndef UART6_DEV
|
||||||
|
#define UART6_DEV /dev/ttyACM1
|
||||||
|
#endif
|
||||||
|
|
||||||
/** uart connected to SBUS input */
|
/** uart connected to SBUS input */
|
||||||
|
#ifndef UART3_DEV
|
||||||
#define UART3_DEV /dev/uart-sbus
|
#define UART3_DEV /dev/uart-sbus
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Default actuators driver */
|
/* Default actuators driver */
|
||||||
#define DEFAULT_ACTUATORS "boards/disco/actuators.h"
|
#define DEFAULT_ACTUATORS "boards/disco/actuators.h"
|
||||||
@@ -79,8 +97,14 @@ struct mt9f002_t mt9f002;
|
|||||||
#define MS45XX_OUTPUT_TYPE 1
|
#define MS45XX_OUTPUT_TYPE 1
|
||||||
#define MS45XX_PRESSURE_OUTPUT_TYPE_InH2O 1
|
#define MS45XX_PRESSURE_OUTPUT_TYPE_InH2O 1
|
||||||
#define MS45XX_AIRSPEED_SCALE 1.6327
|
#define MS45XX_AIRSPEED_SCALE 1.6327
|
||||||
|
#ifndef USE_AIRSPEED_LOWPASS_FILTER
|
||||||
#define USE_AIRSPEED_LOWPASS_FILTER 1
|
#define USE_AIRSPEED_LOWPASS_FILTER 1
|
||||||
|
#endif
|
||||||
|
//#if USE_AIRSPEED_LOWPASS_FILTER
|
||||||
|
#ifndef MS45XX_LOWPASS_TAU
|
||||||
#define MS45XX_LOWPASS_TAU 0.15
|
#define MS45XX_LOWPASS_TAU 0.15
|
||||||
|
#endif
|
||||||
|
//#endif
|
||||||
|
|
||||||
/* To be flexible and be able to disable use of airspeed in state this could have been in the airframe file ofcourse
|
/* To be flexible and be able to disable use of airspeed in state this could have been in the airframe file ofcourse
|
||||||
* but most users just want to have perfectly flying Disco, so enable per default... */
|
* but most users just want to have perfectly flying Disco, so enable per default... */
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ pprz_t v_ctl_throttle_setpoint;
|
|||||||
pprz_t v_ctl_throttle_slewed;
|
pprz_t v_ctl_throttle_slewed;
|
||||||
float v_ctl_pitch_setpoint;
|
float v_ctl_pitch_setpoint;
|
||||||
|
|
||||||
|
uint8_t v_ctl_speed_mode; //To be compatible with universal flightplan, not used for etecs
|
||||||
|
|
||||||
static struct FloatQuat imu_to_body_quat;
|
static struct FloatQuat imu_to_body_quat;
|
||||||
static struct Int32Vect3 accel_imu_meas;
|
static struct Int32Vect3 accel_imu_meas;
|
||||||
@@ -143,7 +144,7 @@ static abi_event body_to_imu_ev;
|
|||||||
///////////// DEFAULT SETTINGS ////////////////
|
///////////// DEFAULT SETTINGS ////////////////
|
||||||
#ifndef V_CTL_ALTITUDE_MAX_CLIMB
|
#ifndef V_CTL_ALTITUDE_MAX_CLIMB
|
||||||
#define V_CTL_ALTITUDE_MAX_CLIMB 2;
|
#define V_CTL_ALTITUDE_MAX_CLIMB 2;
|
||||||
INFO("V_CTL_ALTITUDE_MAX_CLIMB not defined - default is 2m/s")
|
INFO("V_CTL_ALTITUDE_MAX_CLIMB not defined - default is 2 , indicating 2 m/s")
|
||||||
#endif
|
#endif
|
||||||
#ifndef STALL_AIRSPEED
|
#ifndef STALL_AIRSPEED
|
||||||
INFO("No STALL_AIRSPEED defined. Using NOMINAL_AIRSPEED")
|
INFO("No STALL_AIRSPEED defined. Using NOMINAL_AIRSPEED")
|
||||||
@@ -157,7 +158,7 @@ INFO("V_CTL_GLIDE_RATIO not defined - default is 8.")
|
|||||||
#define AIRSPEED_SETPOINT_SLEW 1
|
#define AIRSPEED_SETPOINT_SLEW 1
|
||||||
#endif
|
#endif
|
||||||
#ifndef V_CTL_MAX_ACCELERATION
|
#ifndef V_CTL_MAX_ACCELERATION
|
||||||
#define V_CTL_MAX_ACCELERATION 0.5
|
#define V_CTL_MAX_ACCELERATION 0.5 //G
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef V_CTL_ENERGY_IMU_ID
|
#ifndef V_CTL_ENERGY_IMU_ID
|
||||||
@@ -217,6 +218,7 @@ void v_ctl_init(void)
|
|||||||
{
|
{
|
||||||
/* mode */
|
/* mode */
|
||||||
v_ctl_mode = V_CTL_MODE_MANUAL;
|
v_ctl_mode = V_CTL_MODE_MANUAL;
|
||||||
|
v_ctl_speed_mode = V_CTL_SPEED_THROTTLE; //There is only one, added here to be universal in flightplan for different control modes
|
||||||
|
|
||||||
/* outer loop */
|
/* outer loop */
|
||||||
v_ctl_altitude_setpoint = 0.;
|
v_ctl_altitude_setpoint = 0.;
|
||||||
|
|||||||
@@ -30,6 +30,15 @@
|
|||||||
|
|
||||||
#include "firmwares/fixedwing/guidance/guidance_common.h"
|
#include "firmwares/fixedwing/guidance/guidance_common.h"
|
||||||
|
|
||||||
|
//To be unified with control NEW, these can be used in a unified flightplan
|
||||||
|
//but ETECS has no use of it ofcourse, speed mode always V_CTL_SPEED_AIRSPEED
|
||||||
|
//FIXME An idea to move it to guidance_common
|
||||||
|
#define V_CTL_SPEED_THROTTLE 0
|
||||||
|
#define V_CTL_SPEED_AIRSPEED 1
|
||||||
|
#define V_CTL_SPEED_GROUNDSPEED 2
|
||||||
|
|
||||||
|
extern uint8_t v_ctl_speed_mode;
|
||||||
|
|
||||||
/* outer loop */
|
/* outer loop */
|
||||||
// extern float v_ctl_altitude_error; ///< in meters, (setpoint - alt) -> positive = too low
|
// extern float v_ctl_altitude_error; ///< in meters, (setpoint - alt) -> positive = too low
|
||||||
extern float v_ctl_altitude_setpoint; ///< in meters above MSL
|
extern float v_ctl_altitude_setpoint; ///< in meters above MSL
|
||||||
|
|||||||
@@ -18,8 +18,6 @@
|
|||||||
|
|
||||||
// For Downlink
|
// For Downlink
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float SquareSumErr_airspeed;
|
float SquareSumErr_airspeed;
|
||||||
float SquareSumErr_altitude;
|
float SquareSumErr_altitude;
|
||||||
float SquareSumErr_position;
|
float SquareSumErr_position;
|
||||||
@@ -29,11 +27,8 @@ float TolerancePosition;
|
|||||||
bool benchm_reset;
|
bool benchm_reset;
|
||||||
bool benchm_go;
|
bool benchm_go;
|
||||||
|
|
||||||
|
|
||||||
//uint8_t numOfCount;
|
//uint8_t numOfCount;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void flight_benchmark_init(void)
|
void flight_benchmark_init(void)
|
||||||
{
|
{
|
||||||
SquareSumErr_airspeed = 0;
|
SquareSumErr_airspeed = 0;
|
||||||
|
|||||||
@@ -0,0 +1,311 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 OpenUAS
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* NOTES: For now only the front cam is used, feel free to extend.
|
||||||
|
* Reason is that bottom_cam is normally in use for mapping or Optic flow and the like.
|
||||||
|
* See: https://github.com/Parrot-Developers/disco-opensource/
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "modules/digital_cam/dc_ctrl_parrot_mykonos.h"
|
||||||
|
#include "generated/modules.h"
|
||||||
|
#include "generated/airframe.h"
|
||||||
|
#include "mcu_periph/sys_time.h"
|
||||||
|
// Include Standard Camera Control Interface
|
||||||
|
#include "modules/digital_cam/dc.h"
|
||||||
|
|
||||||
|
/** Time in seconds to start/stop recording or take a picture */
|
||||||
|
#define DC_CTRL_PARROT_MYKONOS_RECORD_DELAY 0.05
|
||||||
|
|
||||||
|
/** delay in milli-seconds before logging after a shot in ms */
|
||||||
|
#define DC_CTRL_PARROT_MYKONOS_LOG_DELAY 50
|
||||||
|
|
||||||
|
/** Get timer from delay based on periodic freq from modules.h */
|
||||||
|
#define DC_CTRL_PARROT_MYKONOS_TIMER_OF_DELAY(_delay) ((uint32_t)(_delay * DC_CTRL_PARROT_MYKONOS_PERIODIC_FREQ))
|
||||||
|
|
||||||
|
/** autoshoot timer delay based on periodic freq from modules.h */
|
||||||
|
#ifndef DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DELAY
|
||||||
|
#define DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DELAY 5.0
|
||||||
|
#endif
|
||||||
|
#define DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_TIMER_OF_DELAY(_delay) ((uint32_t)(_delay * DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_FREQ))
|
||||||
|
|
||||||
|
/** Send report */
|
||||||
|
#if DC_CTRL_PARROT_MYKONOS_SYNC_SEND
|
||||||
|
|
||||||
|
#include "pprzlink/messages.h"
|
||||||
|
#include "subsystems/datalink/downlink.h"
|
||||||
|
#include "state.h"
|
||||||
|
#include "subsystems/gps.h"
|
||||||
|
|
||||||
|
#include "subsystems/datalink/telemetry.h" //? or just downlink.h should be enough
|
||||||
|
|
||||||
|
static inline void dc_ctrl_parrot_mykonos_send_shot_position(void)
|
||||||
|
{
|
||||||
|
// angles in decideg
|
||||||
|
int16_t phi = DegOfRad(stateGetNedToBodyEulers_f()->phi * 10.0f);
|
||||||
|
int16_t theta = DegOfRad(stateGetNedToBodyEulers_f()->theta * 10.0f);
|
||||||
|
int16_t psi = DegOfRad(stateGetNedToBodyEulers_f()->psi * 10.0f);
|
||||||
|
// course in decideg
|
||||||
|
int16_t course = DegOfRad(stateGetHorizontalSpeedDir_f()) * 10;
|
||||||
|
// ground speed in cm/s
|
||||||
|
uint16_t speed = stateGetHorizontalSpeedNorm_f() * 10;
|
||||||
|
|
||||||
|
DOWNLINK_SEND_DC_SHOT(DefaultChannel, DefaultDevice,
|
||||||
|
&dc_ctrl_parrot_mykonos.photo_nr,
|
||||||
|
&stateGetPositionLla_i()->lat,
|
||||||
|
&stateGetPositionLla_i()->lon,
|
||||||
|
&stateGetPositionLla_i()->alt,
|
||||||
|
&gps.hmsl,
|
||||||
|
&phi,
|
||||||
|
&theta,
|
||||||
|
&psi,
|
||||||
|
&course,
|
||||||
|
&speed,
|
||||||
|
&gps.tow);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
The pimpctl command is available per default on a Disco and can be used for
|
||||||
|
triggering various camera related tasks:
|
||||||
|
|
||||||
|
Possible arguments for pimpctl command
|
||||||
|
list-cameras = print the list of available cameras
|
||||||
|
stream-start front <address> <port> = start streaming video
|
||||||
|
stream-stop front = stop streaming video
|
||||||
|
take-picture <camera-name> = ehh, take a photo indeed
|
||||||
|
recording-start <camera-name> = start recording video
|
||||||
|
recording-stop <camera-name> = stop recording video
|
||||||
|
set-controller <camera-name> <controller_id> = set a new camera controller
|
||||||
|
0 -> USER FLAT (yaw axis is free)
|
||||||
|
1 -> USER ABSOLUTE (fully stabilized)
|
||||||
|
2 -> USER FPV (fixed relatively to the drone))
|
||||||
|
3 -> AUTOPILOT
|
||||||
|
cam-orientation <camera-name> <y> <p> <r> = set camera orientation (in degree CCW)
|
||||||
|
y -> yaw pitch rotatio (psi euler angle)
|
||||||
|
p -> pitch rotation (theta euler angle)
|
||||||
|
r -> roll rotation (phi euler angle)
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if DC_CTRL_PARROT_MYKONOS_LOG
|
||||||
|
#include "state.h"
|
||||||
|
#include "subsystems/gps.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct Dc_Ctrl_Parrot_Mykonos dc_ctrl_parrot_mykonos;
|
||||||
|
|
||||||
|
void dc_ctrl_parrot_mykonos_init(void)
|
||||||
|
{
|
||||||
|
// Call common DC init
|
||||||
|
dc_init();
|
||||||
|
|
||||||
|
dc_ctrl_parrot_mykonos.status = DC_CTRL_PARROT_MYKONOS_NONE;
|
||||||
|
dc_ctrl_parrot_mykonos.timer = 0;
|
||||||
|
dc_ctrl_parrot_mykonos.photo_nr = 0;
|
||||||
|
dc_ctrl_parrot_mykonos.autoshoot = 0;
|
||||||
|
dc_ctrl_parrot_mykonos.log_delay = 0;
|
||||||
|
|
||||||
|
#ifndef SITL
|
||||||
|
int ret __attribute__((unused));
|
||||||
|
//ret = system("kk"); //No need kill original AP proceess since new AP is already running and that killed original process
|
||||||
|
|
||||||
|
//TIP: With media-ctl much more can be done for the parameters of the camera only basics are set.
|
||||||
|
ret = system("media-ctl -l \'\"mt9f002 0-0010\":0->\"avicam.0\":0[1]\'");
|
||||||
|
ret = system("media-ctl -l \'\"avicam_dummy_dev.0\":0->\"avicam.0\":0[0]\'");//No bottomcam, used internaly in AP
|
||||||
|
|
||||||
|
ret = system("prestart dxowrapperd");
|
||||||
|
ret = system("prestart pimp"); // pimp = Parrot IMaging Process
|
||||||
|
//ret = system("pimpctl list-cameras"); //TODO look for 1 or more then define a variable to use or not
|
||||||
|
#if DC_CTRL_PARROT_MYKONOS_STREAM_AT_STARTUP
|
||||||
|
dc_ctrl_parrot_mykonos_command(DC_CTRL_PARROT_MYKONOS_STREAM_START);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
|
//Start your local processes so simulated flight with sim shooting can be perfromed
|
||||||
|
//E.g. using a tile map interface of a pre-recorded stream or a 3D generated image
|
||||||
|
//FIXME: make a complete example, he, it's opensouce and involves your work indeed...
|
||||||
|
//ret = system("whateveryouwantotstartlocallyaddithere");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void dc_ctrl_parrot_mykonos_periodic(void)
|
||||||
|
{
|
||||||
|
//Nice 'n ugly use of True/False
|
||||||
|
if (dc_ctrl_parrot_mykonos.timer) {
|
||||||
|
dc_ctrl_parrot_mykonos.timer--;
|
||||||
|
} else {
|
||||||
|
dc_ctrl_parrot_mykonos_command(DC_CTRL_PARROT_MYKONOS_SHOOT);
|
||||||
|
}
|
||||||
|
// test log delay if set
|
||||||
|
if (dc_ctrl_parrot_mykonos.log_delay) {
|
||||||
|
#ifndef SITL
|
||||||
|
if (get_sys_time_msec() > dc_ctrl_parrot_mykonos.log_delay) { //FIXME: Could also happen in SITL...
|
||||||
|
#endif
|
||||||
|
#if DC_CTRL_PARROT_MYKONOS_LOG
|
||||||
|
dc_ctrl_parrot_mykonos_log_shot_position();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if DC_CTRL_PARROT_MYKONOS_SYNC_SEND
|
||||||
|
dc_ctrl_parrot_mykonos_send_shot_position();
|
||||||
|
#endif
|
||||||
|
// increment photo number
|
||||||
|
dc_ctrl_parrot_mykonos.photo_nr++;
|
||||||
|
// unset log delay
|
||||||
|
dc_ctrl_parrot_mykonos.log_delay = 0;
|
||||||
|
#ifndef SITL
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// Common DC Periodic task
|
||||||
|
dc_periodic();
|
||||||
|
}
|
||||||
|
|
||||||
|
//FIXME muiltiple cams and same DC cam API do no go together,
|
||||||
|
// so for the time being not used here, also one needs to add SITL options
|
||||||
|
|
||||||
|
/* Command the Camera
|
||||||
|
* Intermidate function so the universal PPRZ Camra API can be used
|
||||||
|
* No need to change flightplan, script or otherwhise
|
||||||
|
* should work on both Fixedwing and Rotorcraft
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef SITL
|
||||||
|
void dc_send_command(uint8_t cmd)
|
||||||
|
{
|
||||||
|
//Nothing yet, empty framework here so sim compiles
|
||||||
|
switch (cmd) {
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* Execute the Shoot, Record and Stream commands */
|
||||||
|
void dc_ctrl_parrot_mykonos_command(enum dc_ctrl_parrot_mykonos_status cmd)
|
||||||
|
{
|
||||||
|
int ret __attribute__((unused));
|
||||||
|
|
||||||
|
dc_ctrl_parrot_mykonos.status = cmd;
|
||||||
|
switch (cmd) {
|
||||||
|
case DC_CTRL_PARROT_MYKONOS_RECORD_START:
|
||||||
|
#ifndef SITL
|
||||||
|
ret = system("pimpctl recording-start front");
|
||||||
|
#else
|
||||||
|
//ret = system("addyourlocalsitlcommandshere");
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case DC_CTRL_PARROT_MYKONOS_RECORD_STOP:
|
||||||
|
dc_ctrl_parrot_mykonos.timer = DC_CTRL_PARROT_MYKONOS_TIMER_OF_DELAY(DC_CTRL_PARROT_MYKONOS_RECORD_DELAY);
|
||||||
|
#ifndef SITL
|
||||||
|
ret = system("pimpctl recording-stop front");
|
||||||
|
#else
|
||||||
|
//ret = system("addyourlocalsitlcommandshere");
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case DC_CTRL_PARROT_MYKONOS_SHOOT:
|
||||||
|
#ifndef SITL
|
||||||
|
ret = system("pimpctl take-picture front");
|
||||||
|
#else
|
||||||
|
//ret = system("addyourlocalsitlcommandshere");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
break;
|
||||||
|
case DC_CTRL_PARROT_MYKONOS_STREAM_START:
|
||||||
|
/*
|
||||||
|
* Note that while .0 as destination IP works multicasting it introduces latency.
|
||||||
|
To avoid this use the real target IP of the video viewer device e.g. the GCS
|
||||||
|
quick and dirty; get ip from latest lease: ./data/lib/misc/dhcp_eth0.leases
|
||||||
|
and look for the name of your host you want to target.
|
||||||
|
|
||||||
|
TIP: Example to view stream on Host PC:
|
||||||
|
|
||||||
|
gst-launch-1.0 udpsrc port=55004 ! "application/x-rtp, payload=96" ! rtph264depay ! avdec_h264 ! autovideosink
|
||||||
|
|
||||||
|
But there are many ways to Rome...
|
||||||
|
|
||||||
|
*/
|
||||||
|
#ifndef SITL
|
||||||
|
ret = system("pimpctl stream-start front 192.168.42.0 55004");//FIXME: Option to target only IP, for less delay
|
||||||
|
#else
|
||||||
|
//ret = system("addyourlocalsitlcommandshere");
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case DC_CTRL_PARROT_MYKONOS_STREAM_STOP:
|
||||||
|
#ifndef SITL
|
||||||
|
ret = system("pimpctl stream-stop front 192.168.42.0 55004");
|
||||||
|
#else
|
||||||
|
//ret = system("addyourlocalsitlcommandshere");
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_START:
|
||||||
|
dc_ctrl_parrot_mykonos.timer = DC_CTRL_PARROT_MYKONOS_TIMER_OF_DELAY(DC_CTRL_PARROT_MYKONOS_RECORD_DELAY);
|
||||||
|
#ifndef SITL
|
||||||
|
ret = system("pimpctl take-picture front");
|
||||||
|
#else
|
||||||
|
//ret = system("addyourlocalsitlcommandshere");
|
||||||
|
#endif
|
||||||
|
dc_ctrl_parrot_mykonos.log_delay = get_sys_time_msec() + DC_CTRL_PARROT_MYKONOS_LOG_DELAY;
|
||||||
|
dc_ctrl_parrot_mykonos.last_shot_pos = *stateGetPositionEnu_f();
|
||||||
|
break;
|
||||||
|
case DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_STOP:
|
||||||
|
//nix
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dc_ctrl_parrot_mykonos_autoshoot(void)
|
||||||
|
{
|
||||||
|
// Wait a minimum time between two shots
|
||||||
|
if (dc_ctrl_parrot_mykonos.autoshoot) {
|
||||||
|
dc_ctrl_parrot_mykonos.autoshoot--;
|
||||||
|
} else {
|
||||||
|
// test distance if needed
|
||||||
|
// or take picture if first of the sequence
|
||||||
|
#ifdef DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DIST
|
||||||
|
struct EnuCoor_f pos = *stateGetPositionEnu_f();
|
||||||
|
struct FloatVect2 d_pos;
|
||||||
|
d_pos.x = pos.x - dc_ctrl_parrot_mykonos.last_shot_pos.x;
|
||||||
|
d_pos.y = pos.y - dc_ctrl_parrot_mykonos.last_shot_pos.y;
|
||||||
|
if (VECT2_NORM2(d_pos) > (DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DIST * DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DIST)
|
||||||
|
|| dc_ctrl_parrot_mykonos.status == DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_START) {
|
||||||
|
#endif
|
||||||
|
// take a picture
|
||||||
|
dc_ctrl_parrot_mykonos_command(DC_CTRL_PARROT_MYKONOS_SHOOT);
|
||||||
|
// reset timer
|
||||||
|
dc_ctrl_parrot_mykonos.autoshoot = DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_TIMER_OF_DELAY(DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DELAY);
|
||||||
|
#ifdef DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_DIST
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void dc_ctrl_parrot_mykonos_autoshoot_start(void)
|
||||||
|
{
|
||||||
|
// Start taking a picture immediately
|
||||||
|
dc_ctrl_parrot_mykonos.autoshoot = 0;
|
||||||
|
dc_ctrl_parrot_mykonos.status = DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_START;
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2018 OpenUAS
|
||||||
|
*
|
||||||
|
* 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 modules/digital_cam/dc_ctrl_parrot_mykonos.h
|
||||||
|
* @brief Digital video/photo recorder control for Parrot Mykonos Platform,
|
||||||
|
* For others that is: control the camera of the Disco and if one manages to
|
||||||
|
* add pimpctl onto a Bebop or Bebop2, should work also on those
|
||||||
|
*
|
||||||
|
* Provides the control of the Camera start and stop of video recording,
|
||||||
|
* Taking photos and switch video streaming on and off
|
||||||
|
* This module starts the camera in standby mode and triggers starting
|
||||||
|
* of recording or take a picture.
|
||||||
|
* Minimum time between two pictures is 1 second.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef DC_CTRL_PARROT_MYKONOS_H
|
||||||
|
#define DC_CTRL_PARROT_MYKONOS_H
|
||||||
|
|
||||||
|
#include "std.h"
|
||||||
|
#include "math/pprz_geodetic_float.h"
|
||||||
|
|
||||||
|
// Include Standard Camera Control Interface
|
||||||
|
// Note: Standard DC nneds to be unified and enhance for multicam support
|
||||||
|
#include "dc.h"
|
||||||
|
|
||||||
|
#include BOARD_CONFIG
|
||||||
|
|
||||||
|
enum dc_ctrl_parrot_mykonos_status {
|
||||||
|
DC_CTRL_PARROT_MYKONOS_NONE,
|
||||||
|
DC_CTRL_PARROT_MYKONOS_RECORD_START,
|
||||||
|
DC_CTRL_PARROT_MYKONOS_RECORD_STOP,
|
||||||
|
DC_CTRL_PARROT_MYKONOS_SHOOT,
|
||||||
|
DC_CTRL_PARROT_MYKONOS_STREAM_START,
|
||||||
|
DC_CTRL_PARROT_MYKONOS_STREAM_STOP,
|
||||||
|
DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_START,
|
||||||
|
DC_CTRL_PARROT_MYKONOS_AUTOSHOOT_STOP
|
||||||
|
};
|
||||||
|
|
||||||
|
struct Dc_Ctrl_Parrot_Mykonos {
|
||||||
|
enum dc_ctrl_parrot_mykonos_status status;
|
||||||
|
uint32_t timer;
|
||||||
|
int16_t photo_nr;
|
||||||
|
uint32_t autoshoot;
|
||||||
|
struct EnuCoor_f last_shot_pos;
|
||||||
|
uint32_t log_delay;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern struct Dc_Ctrl_Parrot_Mykonos dc_ctrl_parrot_mykonos;
|
||||||
|
|
||||||
|
extern void dc_ctrl_parrot_mykonos_init(void);
|
||||||
|
extern void dc_ctrl_parrot_mykonos_periodic(void);
|
||||||
|
extern void dc_ctrl_parrot_mykonos_autoshoot(void);
|
||||||
|
extern void dc_ctrl_parrot_mykonos_autoshoot_start(void);
|
||||||
|
extern void dc_ctrl_parrot_mykonos_command(enum dc_ctrl_parrot_mykonos_status cmd);
|
||||||
|
|
||||||
|
// macro for setting handler
|
||||||
|
#define dc_ctrl_parrot_mykonos_SendCmd(cmd) dc_ctrl_parrot_mykonos_command(cmd)
|
||||||
|
|
||||||
|
#endif // DC_CTRL_PARROT_MYKONOS_H
|
||||||
@@ -87,11 +87,19 @@ void takeoff_detect_periodic(void)
|
|||||||
// Run detection state machine here
|
// Run detection state machine here
|
||||||
switch (takeoff_detect.state) {
|
switch (takeoff_detect.state) {
|
||||||
case TO_DETECT_ARMED:
|
case TO_DETECT_ARMED:
|
||||||
// test for "nose up" + AP in AUTO2 (+ GPS OK ? FIXME)
|
// test for "nose up" + AP in AUTO2, optionally AUTO1 not default since risky if one does not know what it does
|
||||||
if (stateGetNedToBodyEulers_f()->theta > TAKEOFF_DETECT_LAUNCH_PITCH
|
if (stateGetNedToBodyEulers_f()->theta > TAKEOFF_DETECT_LAUNCH_PITCH)
|
||||||
&& autopilot_get_mode() == AP_MODE_AUTO2) {
|
{
|
||||||
|
#ifndef TAKEOFF_DETECT_ALSO_IN_AUTO1
|
||||||
|
if (autopilot_get_mode() != AP_MODE_AUTO2)
|
||||||
|
#else
|
||||||
|
if ((autopilot_get_mode() != AP_MODE_AUTO2) || (autopilot_get_mode() != AP_MODE_AUTO1))
|
||||||
|
#endif
|
||||||
|
{
|
||||||
takeoff_detect.timer++;
|
takeoff_detect.timer++;
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
// else reset timer
|
// else reset timer
|
||||||
takeoff_detect.timer = 0;
|
takeoff_detect.timer = 0;
|
||||||
}
|
}
|
||||||
@@ -102,13 +110,21 @@ void takeoff_detect_periodic(void)
|
|||||||
takeoff_detect.timer = 0;
|
takeoff_detect.timer = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TO_DETECT_LAUNCHING:
|
case TO_DETECT_LAUNCHING:
|
||||||
// abort if pitch goes below threshold while launching
|
// abort if pitch goes below threshold while launching
|
||||||
if (stateGetNedToBodyEulers_f()->theta < TAKEOFF_DETECT_ABORT_PITCH
|
if (stateGetNedToBodyEulers_f()->theta < TAKEOFF_DETECT_ABORT_PITCH)
|
||||||
|| autopilot_get_mode() != AP_MODE_AUTO2) {
|
{
|
||||||
// back to ARMED state
|
#ifndef TAKEOFF_DETECT_ALSO_IN_AUTO1
|
||||||
autopilot.launch = false;
|
if (autopilot_get_mode() != AP_MODE_AUTO2)
|
||||||
takeoff_detect.state = TO_DETECT_ARMED;
|
#else
|
||||||
|
if ((autopilot_get_mode() != AP_MODE_AUTO2) || (autopilot_get_mode() != AP_MODE_AUTO1))
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
// back to ARMED state
|
||||||
|
autopilot.launch = false;
|
||||||
|
takeoff_detect.state = TO_DETECT_ARMED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// increment timer and disable detection after some time
|
// increment timer and disable detection after some time
|
||||||
takeoff_detect.timer++;
|
takeoff_detect.timer++;
|
||||||
@@ -116,10 +132,12 @@ void takeoff_detect_periodic(void)
|
|||||||
takeoff_detect.state = TO_DETECT_DISABLED;
|
takeoff_detect.state = TO_DETECT_DISABLED;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TO_DETECT_DISABLED:
|
case TO_DETECT_DISABLED:
|
||||||
// stop periodic call
|
// stop periodic call
|
||||||
takeoff_detect_takeoff_detect_periodic_status = MODULES_STOP;
|
takeoff_detect_takeoff_detect_periodic_status = MODULES_STOP;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
// No kidding ?!
|
// No kidding ?!
|
||||||
takeoff_detect.state = TO_DETECT_DISABLED;
|
takeoff_detect.state = TO_DETECT_DISABLED;
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
#include "mcu_periph/spi.h"
|
#include "mcu_periph/spi.h"
|
||||||
#include "subsystems/abi.h"
|
#include "subsystems/abi.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include "subsystems/datalink/downlink.h"
|
#include "subsystems/datalink/downlink.h"//FIXME, include only when link need
|
||||||
|
|
||||||
#include "filters/median_filter.h"
|
#include "filters/median_filter.h"
|
||||||
|
|
||||||
|
|||||||
@@ -36,12 +36,14 @@
|
|||||||
|
|
||||||
struct AhrsAligner ahrs_aligner;
|
struct AhrsAligner ahrs_aligner;
|
||||||
|
|
||||||
#define SAMPLES_NB 100
|
#ifndef AHRS_ALIGNER_SAMPLES_NB
|
||||||
|
#define AHRS_ALIGNER_SAMPLES_NB 100
|
||||||
|
#endif
|
||||||
|
|
||||||
static struct Int32Rates gyro_sum;
|
static struct Int32Rates gyro_sum;
|
||||||
static struct Int32Vect3 accel_sum;
|
static struct Int32Vect3 accel_sum;
|
||||||
static struct Int32Vect3 mag_sum;
|
static struct Int32Vect3 mag_sum;
|
||||||
static int32_t ref_sensor_samples[SAMPLES_NB];
|
static int32_t ref_sensor_samples[AHRS_ALIGNER_SAMPLES_NB];
|
||||||
static uint32_t samples_idx;
|
static uint32_t samples_idx;
|
||||||
|
|
||||||
#ifndef AHRS_ALIGNER_IMU_ID
|
#ifndef AHRS_ALIGNER_IMU_ID
|
||||||
@@ -117,25 +119,25 @@ void ahrs_aligner_run(void)
|
|||||||
RunOnceEvery(50, {LED_TOGGLE(AHRS_ALIGNER_LED);});
|
RunOnceEvery(50, {LED_TOGGLE(AHRS_ALIGNER_LED);});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (samples_idx >= SAMPLES_NB) {
|
if (samples_idx >= AHRS_ALIGNER_SAMPLES_NB) {
|
||||||
int32_t avg_ref_sensor = accel_sum.z;
|
int32_t avg_ref_sensor = accel_sum.z;
|
||||||
if (avg_ref_sensor >= 0) {
|
if (avg_ref_sensor >= 0) {
|
||||||
avg_ref_sensor += SAMPLES_NB / 2;
|
avg_ref_sensor += AHRS_ALIGNER_SAMPLES_NB / 2;
|
||||||
} else {
|
} else {
|
||||||
avg_ref_sensor -= SAMPLES_NB / 2;
|
avg_ref_sensor -= AHRS_ALIGNER_SAMPLES_NB / 2;
|
||||||
}
|
}
|
||||||
avg_ref_sensor /= SAMPLES_NB;
|
avg_ref_sensor /= AHRS_ALIGNER_SAMPLES_NB;
|
||||||
|
|
||||||
ahrs_aligner.noise = 0;
|
ahrs_aligner.noise = 0;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < SAMPLES_NB; i++) {
|
for (i = 0; i < AHRS_ALIGNER_SAMPLES_NB; i++) {
|
||||||
int32_t diff = ref_sensor_samples[i] - avg_ref_sensor;
|
int32_t diff = ref_sensor_samples[i] - avg_ref_sensor;
|
||||||
ahrs_aligner.noise += abs(diff);
|
ahrs_aligner.noise += abs(diff);
|
||||||
}
|
}
|
||||||
|
|
||||||
RATES_SDIV(ahrs_aligner.lp_gyro, gyro_sum, SAMPLES_NB);
|
RATES_SDIV(ahrs_aligner.lp_gyro, gyro_sum, AHRS_ALIGNER_SAMPLES_NB);
|
||||||
VECT3_SDIV(ahrs_aligner.lp_accel, accel_sum, SAMPLES_NB);
|
VECT3_SDIV(ahrs_aligner.lp_accel, accel_sum, AHRS_ALIGNER_SAMPLES_NB);
|
||||||
VECT3_SDIV(ahrs_aligner.lp_mag, mag_sum, SAMPLES_NB);
|
VECT3_SDIV(ahrs_aligner.lp_mag, mag_sum, AHRS_ALIGNER_SAMPLES_NB);
|
||||||
|
|
||||||
INT_RATES_ZERO(gyro_sum);
|
INT_RATES_ZERO(gyro_sum);
|
||||||
INT_VECT3_ZERO(accel_sum);
|
INT_VECT3_ZERO(accel_sum);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ void imu_disco_init(void)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle all the periodic tasks of the Disco IMU components.
|
* Handle all the periodic tasks of the Disco IMU components.
|
||||||
* Read the MPU60x0 every periodic call and the HMC58XX every 10th call.
|
* Read the MPU60x0 every periodic call and the AKM8963 every 10th call.
|
||||||
*/
|
*/
|
||||||
void imu_disco_periodic(void)
|
void imu_disco_periodic(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,16 +28,16 @@
|
|||||||
#ifndef RADIO_CONTROL_SPEKTRUM_RADIO_H
|
#ifndef RADIO_CONTROL_SPEKTRUM_RADIO_H
|
||||||
#define RADIO_CONTROL_SPEKTRUM_RADIO_H
|
#define RADIO_CONTROL_SPEKTRUM_RADIO_H
|
||||||
|
|
||||||
/* Amount of spektrum channels */
|
/* Amount of Spektrum channels */
|
||||||
#ifndef RADIO_CONTROL_NB_CHANNEL
|
#ifndef RADIO_CONTROL_NB_CHANNEL
|
||||||
#define RADIO_CONTROL_NB_CHANNEL 14
|
#define RADIO_CONTROL_NB_CHANNEL 14
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if RADIO_CONTROL_NB_CHANNEL > 14
|
#if RADIO_CONTROL_NB_CHANNEL > 14
|
||||||
#error "RADIO_CONTROL_NB_CHANNEL mustn't be higher than 14."
|
#error "RADIO_CONTROL_NB_CHANNEL mustn't be higher than 14. X-Plus channel expansion is not (yet) usable"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* default channel assignments */
|
/* Default channel assignments */
|
||||||
#ifndef RADIO_THROTTLE
|
#ifndef RADIO_THROTTLE
|
||||||
#define RADIO_THROTTLE 0
|
#define RADIO_THROTTLE 0
|
||||||
#endif
|
#endif
|
||||||
@@ -50,19 +50,41 @@
|
|||||||
#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
|
||||||
|
#ifndef RADIO_AUX1
|
||||||
#define RADIO_AUX1 5
|
#define RADIO_AUX1 5
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX2
|
||||||
#define RADIO_AUX2 6
|
#define RADIO_AUX2 6
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX3
|
||||||
#define RADIO_AUX3 7
|
#define RADIO_AUX3 7
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX4
|
||||||
#define RADIO_AUX4 8
|
#define RADIO_AUX4 8
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX5
|
||||||
#define RADIO_AUX5 9
|
#define RADIO_AUX5 9
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX6
|
||||||
#define RADIO_AUX6 10
|
#define RADIO_AUX6 10
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX7
|
||||||
#define RADIO_AUX7 11
|
#define RADIO_AUX7 11
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX8
|
||||||
#define RADIO_AUX8 12
|
#define RADIO_AUX8 12
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX9
|
||||||
#define RADIO_AUX9 13
|
#define RADIO_AUX9 13
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Default Mode channel is GEAR (number 5) */
|
/* Default Mode channel is GEAR */
|
||||||
#ifndef RADIO_MODE
|
#ifndef RADIO_MODE
|
||||||
#define RADIO_MODE RADIO_GEAR
|
#define RADIO_MODE RADIO_GEAR
|
||||||
#endif
|
#endif
|
||||||
@@ -71,7 +93,7 @@
|
|||||||
#ifndef RADIO_CONTROL_SPEKTRUM_SIGNS
|
#ifndef RADIO_CONTROL_SPEKTRUM_SIGNS
|
||||||
//
|
//
|
||||||
#ifdef RADIO_CONTROL_SPEKTRUM_OLD_SIGNS
|
#ifdef RADIO_CONTROL_SPEKTRUM_OLD_SIGNS
|
||||||
#define RADIO_CONTROL_SPEKTRUM_SIGNS {1,-1,-1,-1,1,-1,1,1,1,1,1,1,1,1} // As most transmitters are sold
|
#define RADIO_CONTROL_SPEKTRUM_SIGNS {1,-1,-1,-1,1,-1,1,1,1,1,1,1,1,1} // As most transmitters are sold and set per default
|
||||||
#else
|
#else
|
||||||
#define RADIO_CONTROL_SPEKTRUM_SIGNS {1,1,1,1,1,1,1,1,1,1,1,1,1,1} // PPRZ sign convention
|
#define RADIO_CONTROL_SPEKTRUM_SIGNS {1,1,1,1,1,1,1,1,1,1,1,1,1,1} // PPRZ sign convention
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -34,25 +34,55 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if RADIO_CONTROL_NB_CHANNEL > 14
|
#if RADIO_CONTROL_NB_CHANNEL > 14
|
||||||
#error "RADIO_CONTROL_NB_CHANNEL mustn't be higher than 14."
|
#error "RADIO_CONTROL_NB_CHANNEL mustn't be higher than 14. X-Plus channel expansion is not (yet) usable"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The channel ordering is always the same for DSM2 and DSMX */
|
/* Default channel assignments */
|
||||||
|
#ifndef RADIO_THROTTLE
|
||||||
#define RADIO_THROTTLE 0
|
#define RADIO_THROTTLE 0
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_ROLL
|
||||||
#define RADIO_ROLL 1
|
#define RADIO_ROLL 1
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_PITCH
|
||||||
#define RADIO_PITCH 2
|
#define RADIO_PITCH 2
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_YAW
|
||||||
#define RADIO_YAW 3
|
#define RADIO_YAW 3
|
||||||
|
#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
|
||||||
|
#ifndef RADIO_AUX1
|
||||||
#define RADIO_AUX1 5
|
#define RADIO_AUX1 5
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX2
|
||||||
#define RADIO_AUX2 6
|
#define RADIO_AUX2 6
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX3
|
||||||
#define RADIO_AUX3 7
|
#define RADIO_AUX3 7
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX4
|
||||||
#define RADIO_AUX4 8
|
#define RADIO_AUX4 8
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX5
|
||||||
#define RADIO_AUX5 9
|
#define RADIO_AUX5 9
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX6
|
||||||
#define RADIO_AUX6 10
|
#define RADIO_AUX6 10
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX7
|
||||||
#define RADIO_AUX7 11
|
#define RADIO_AUX7 11
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX8
|
||||||
#define RADIO_AUX8 12
|
#define RADIO_AUX8 12
|
||||||
|
#endif
|
||||||
|
#ifndef RADIO_AUX9
|
||||||
#define RADIO_AUX9 13
|
#define RADIO_AUX9 13
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Map the MODE default to the gear switch */
|
/* Map the MODE default to the gear switch */
|
||||||
#ifndef RADIO_MODE
|
#ifndef RADIO_MODE
|
||||||
|
|||||||
@@ -109,7 +109,9 @@ class ParrotUtils:
|
|||||||
print('Could not connect to the ' + self.uav_name + ' (address: ' + self.address + ')')
|
print('Could not connect to the ' + self.uav_name + ' (address: ' + self.address + ')')
|
||||||
print('Check if the ' + self.uav_name + ' is turned on and the computer is connected over wifi or bluetooth.')
|
print('Check if the ' + self.uav_name + ' is turned on and the computer is connected over wifi or bluetooth.')
|
||||||
if self.address == '192.168.42.1':
|
if self.address == '192.168.42.1':
|
||||||
print("If you are using Bebop 1 or 2, don't forget pressing the power button 4 times after the Bebop has booted!")
|
print("If you are using Bebop 1 or 2, don't forget pressing the power button 4 times after the Bebop has booted!\n")
|
||||||
|
print("And if using Disco pressing the power button 2 times after aircraft powerup.")
|
||||||
|
print("Or run the buttonpress script to get rid of this buttonpress annoyance.")
|
||||||
exit(2)
|
exit(2)
|
||||||
|
|
||||||
# Close the telnet and ftp
|
# Close the telnet and ftp
|
||||||
@@ -274,7 +276,7 @@ class ParrotUtils:
|
|||||||
if ((not v == ParrotVersion('0.0.0.0')) and ((v < ParrotVersion(min_ver)) or (v > ParrotVersion(max_ver)))):
|
if ((not v == ParrotVersion('0.0.0.0')) and ((v < ParrotVersion(min_ver)) or (v > ParrotVersion(max_ver)))):
|
||||||
print("Error: please upgrade your " + self.uav_name + " firmware to version between " + min_ver + " and " + max_ver + "!")
|
print("Error: please upgrade your " + self.uav_name + " firmware to version between " + min_ver + " and " + max_ver + "!")
|
||||||
return
|
return
|
||||||
|
|
||||||
f = self.split_into_path_and_file(name)
|
f = self.split_into_path_and_file(name)
|
||||||
|
|
||||||
# Upload the file
|
# Upload the file
|
||||||
|
|||||||
Reference in New Issue
Block a user