mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-23 13:24:03 +08:00
Merge pull request #714
For displaying AGL in GCS: use ground_alt from autopilot if no SRTM data available. Please replace ground_alt with GetAltRef() in your fligh plans. * nav_ref: [ground_alt] add GetAltRef() to FW nav and update flight plans [ground_alt] remove ground_alt from rotorcraft firmware [srtm] improving information messages about SRTM data [agl] fix waypoint edit box display and sim ground detect [agl] use ground_alt from autopilot if no SRTM data available
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+40" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+40" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<go wp="CLIMB"/>
|
||||
</block>
|
||||
@@ -86,11 +86,11 @@
|
||||
<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">
|
||||
<!-- <exception cond="ground_alt + 6 > GetPosAlt()" deroute="flare"/> -->
|
||||
<!-- <exception cond="GetAltRef() + 6 > GetPosAlt()" deroute="flare"/> -->
|
||||
<go approaching_time="0" from="AF" hmode="route" wp="SF"/>
|
||||
</block>
|
||||
<block name="shortfinal">
|
||||
<!-- <exception cond="ground_alt + 6 > GetPosAlt()" deroute="flare"/> -->
|
||||
<!-- <exception cond="GetAltRef() + 6 > GetPosAlt()" deroute="flare"/> -->
|
||||
<go approaching_time="0" from="SF" hmode="route" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" pitch="15" throttle="1.0" vmode="throttle" wp="CLIMB"/>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<procedure>
|
||||
<exceptions>
|
||||
<exception cond="Or(! InsideGreen(GetPosX(), GetPosY()), GetPosAlt() > ground_alt + 150)" deroute="Center"/>
|
||||
<exception cond="Or(! InsideGreen(GetPosX(), GetPosY()), GetPosAlt() > GetAltRef() + 150)" deroute="Center"/>
|
||||
</exceptions>
|
||||
|
||||
<blocks>
|
||||
|
||||
@@ -101,15 +101,15 @@
|
||||
</block>
|
||||
|
||||
<block name="climb 75">
|
||||
<circle radius="50+(GetPosAlt()-ground_alt)/2" wp="1" throttle="0.75" pitch="15" vmode="throttle" until="10 > PowerVoltage()"/>
|
||||
<circle radius="50+(GetPosAlt()-GetAltRef())/2" wp="1" throttle="0.75" pitch="15" vmode="throttle" until="10 > PowerVoltage()"/>
|
||||
</block>
|
||||
|
||||
<block name="climb 1">
|
||||
<circle radius="50+(GetPosAlt()-ground_alt)/2" wp="1" climb="1" pitch="5" vmode="climb" until="10 > PowerVoltage()"/>
|
||||
<circle radius="50+(GetPosAlt()-GetAltRef())/2" wp="1" climb="1" pitch="5" vmode="climb" until="10 > PowerVoltage()"/>
|
||||
</block>
|
||||
|
||||
<block name="descent 0">
|
||||
<circle radius="50+(GetPosAlt()-ground_alt)/2" wp="1" throttle="0.0" pitch="-15" vmode="throttle" until="ground_alt+50 > GetPosAlt()"/>
|
||||
<circle radius="50+(GetPosAlt()-GetAltRef())/2" wp="1" throttle="0.0" pitch="-15" vmode="throttle" until="GetAltRef()+50 > GetPosAlt()"/>
|
||||
<deroute block="wait"/>
|
||||
</block>
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
</block>
|
||||
|
||||
<block name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block key="t" name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png" group="home">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" throttle="1.0" vmode="throttle" wp="CLIMB" pitch="15"/>
|
||||
@@ -76,7 +76,7 @@
|
||||
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10), 10 > fabs(GetPosAlt() - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/>
|
||||
</block>
|
||||
<block name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</includes>
|
||||
|
||||
<exceptions>
|
||||
<exception cond="Or(! InsideZRT(GetPosX(), GetPosY()), GetPosAlt() > ground_alt + 300)" deroute="Kill"/>
|
||||
<exception cond="Or(! InsideZRT(GetPosX(), GetPosY()), GetPosAlt() > GetAltRef() + 300)" deroute="Kill"/>
|
||||
</exceptions>
|
||||
<blocks>
|
||||
<block name="Wait GPS">
|
||||
@@ -33,7 +33,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby Menton"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby Menton"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go throttle="1.0" vmode="throttle" wp="CLIMB" pitch="15"/>
|
||||
@@ -66,7 +66,7 @@
|
||||
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-10), 10 > fabs(GetPosAlt() - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/>
|
||||
</block>
|
||||
<block name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
@@ -74,7 +74,7 @@
|
||||
<attitude roll="0.0" throttle="0.0" until="FALSE" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Kill">
|
||||
<exception cond="And(InsideZRT(GetPosX(), GetPosY()), ground_alt + 300 > GetPosAlt())" deroute="Resume Mission"/>
|
||||
<exception cond="And(InsideZRT(GetPosX(), GetPosY()), GetAltRef() + 300 > GetPosAlt())" deroute="Resume Mission"/>
|
||||
<attitude roll="0" vmode="throttle" throttle="0.2"/>
|
||||
</block>
|
||||
<block name="Resume Mission">
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" throttle="1.0" vmode="throttle" wp="CLIMB"/>
|
||||
@@ -45,7 +45,7 @@
|
||||
<circle radius="nav_radius" wp="PROFILE"/>
|
||||
</block>
|
||||
<block name="profile_down" strip_button="Profile Down" strip_icon="down_profile.png">
|
||||
<circle pitch="RadOfDeg(-10)" radius="nav_radius" throttle="0" until="(ground_alt+150 > GetPosAlt())" vmode="throttle" wp="PROFILE"/>
|
||||
<circle pitch="RadOfDeg(-10)" radius="nav_radius" throttle="0" until="(GetAltRef()+150 > GetPosAlt())" vmode="throttle" wp="PROFILE"/>
|
||||
<deroute block="Standby"/>
|
||||
</block>
|
||||
<block name="MOB" strip_button="Circle around here" strip_icon="mob.png">
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff (wp CLIMB)">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<go wp="CLIMB"/>
|
||||
</block>
|
||||
@@ -65,19 +65,19 @@
|
||||
<circle pitch="auto" radius="75" throttle="0.7" wp="1"/>
|
||||
</block>
|
||||
<block name="Climb 75% throttle">
|
||||
<circle pitch="10" radius="50+(GetPosAlt()-ground_alt)/2" throttle="0.75" until="(10 > PowerVoltage()) || (GetPosAlt() > ground_alt+ 1350)" vmode="throttle" wp="1"/>
|
||||
<circle pitch="10" radius="50+(GetPosAlt()-GetAltRef())/2" throttle="0.75" until="(10 > PowerVoltage()) || (GetPosAlt() > GetAltRef()+ 1350)" vmode="throttle" wp="1"/>
|
||||
</block>
|
||||
<block name="Climb 0m/s">
|
||||
<circle climb="0" radius="nav_radius" until="10 > PowerVoltage()" vmode="climb" wp="1"/>
|
||||
</block>
|
||||
<block name="Climb 1m/s">
|
||||
<circle climb="1" radius="50+(GetPosAlt()-ground_alt)/2" until="10 > PowerVoltage()" vmode="climb" wp="1"/>
|
||||
<circle climb="1" radius="50+(GetPosAlt()-GetAltRef())/2" until="10 > PowerVoltage()" vmode="climb" wp="1"/>
|
||||
</block>
|
||||
<block name="Climb nav_climb m/s">
|
||||
<circle climb="nav_climb" radius="nav_radius" until="(10 > PowerVoltage()) || (GetPosAlt() > ground_alt+ 1350)" vmode="climb" wp="1"/>
|
||||
<circle climb="nav_climb" radius="nav_radius" until="(10 > PowerVoltage()) || (GetPosAlt() > GetAltRef()+ 1350)" vmode="climb" wp="1"/>
|
||||
</block>
|
||||
<block name="Descent 0% throttle">
|
||||
<circle pitch="-5" radius="50+(GetPosAlt()-ground_alt)/2" throttle="0.0" until="ground_alt+50 > GetPosAlt()" vmode="throttle" wp="1"/>
|
||||
<circle pitch="-5" radius="50+(GetPosAlt()-GetAltRef())/2" throttle="0.0" until="GetAltRef()+50 > GetPosAlt()" vmode="throttle" wp="1"/>
|
||||
<deroute block="Standby"/>
|
||||
</block>
|
||||
<block name="Route 1-2">
|
||||
@@ -114,7 +114,7 @@
|
||||
<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 name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
@@ -140,7 +140,7 @@
|
||||
</while>
|
||||
</block>
|
||||
<block name="Heading 30">
|
||||
<heading alt="ground_alt+50" course="30" until="FALSE"/>
|
||||
<heading alt="GetAltRef()+50" course="30" until="FALSE"/>
|
||||
</block>
|
||||
</blocks>
|
||||
</flight_plan>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<circle radius="-75" wp="HOME"/>
|
||||
</block>
|
||||
<block name="climb 75">
|
||||
<circle radius="50+(GetPosAlt()-ground_alt)/2" wp="1" throttle="0.75" pitch="15" vmode="throttle" until="10>PowerVoltage()"/>
|
||||
<circle radius="50+(GetPosAlt()-GetAltRef())/2" wp="1" throttle="0.75" pitch="15" vmode="throttle" until="10>PowerVoltage()"/>
|
||||
</block>
|
||||
<block name="stack 1">
|
||||
<circle radius="GetPosAlt()/2" wp="1"/>
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
<set value="TRUE" var="h_ctl_disabled"/>
|
||||
<set value="(-0.6*MAX_PPRZ)" var="h_ctl_aileron_setpoint"/>
|
||||
<set value="(0.9*MAX_PPRZ)" var="h_ctl_elevator_setpoint"/>
|
||||
<while cond="GetPosAlt() > ground_alt + 220"/>
|
||||
<while cond="GetPosAlt() > GetAltRef() + 220"/>
|
||||
<set value="0" var="h_ctl_aileron_setpoint"/>
|
||||
<set value="0" var="h_ctl_elevator_setpoint"/>
|
||||
</block>
|
||||
@@ -78,7 +78,7 @@
|
||||
<circle radius="nav_radius" until="NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10) && 20 > fabs(GetPosAlt() - WaypointAlt(WP__BASELEG))" wp="_BASELEG"/>
|
||||
</block>
|
||||
<block name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<call fun="NavSetGroundReferenceHere()"/>
|
||||
</block>
|
||||
<block name="Takeoff">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="HSIF"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="HSIF"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" pitch="15" throttle="1.0" vmode="throttle" wp="CLIMB"/>
|
||||
|
||||
@@ -58,22 +58,22 @@
|
||||
</block>
|
||||
<block name="profile">
|
||||
<for from="1" to="5" var="i">
|
||||
<circle alt="ground_alt+50* $i" radius="nav_radius" until="stage_time>120" wp="1"/>
|
||||
<circle alt="GetAltRef()+50* $i" radius="nav_radius" until="stage_time>120" wp="1"/>
|
||||
</for>
|
||||
</block>
|
||||
<block name="climb">
|
||||
<circle radius="nav_radius" wp="CLIMB"/>
|
||||
</block>
|
||||
<block name="descent">
|
||||
<circle radius="nav_radius" wp="CLIMB" vmode="throttle" throttle="0" pitch="RadOfDeg(my_nav_pitch)" until="(ground_alt+150 > GetPosAlt())"/>
|
||||
<circle radius="nav_radius" wp="CLIMB" vmode="throttle" throttle="0" pitch="RadOfDeg(my_nav_pitch)" until="(GetAltRef()+150 > GetPosAlt())"/>
|
||||
<deroute block="wait"/>
|
||||
</block>
|
||||
<block name="wind">
|
||||
<attitude pitch="RadOfDeg(my_nav_pitch)" roll="my_nav_roll" throttle="0.0" until="(ground_alt+150 > GetPosAlt())" vmode="throttle"/>
|
||||
<attitude pitch="RadOfDeg(my_nav_pitch)" roll="my_nav_roll" throttle="0.0" until="(GetAltRef()+150 > GetPosAlt())" vmode="throttle"/>
|
||||
<deroute block="wait"/>
|
||||
</block>
|
||||
<block name="wait" strip_button="Wait">
|
||||
<circle radius="nav_radius" wp="CLIMB" alt="ground_alt+200"/>
|
||||
<circle radius="nav_radius" wp="CLIMB" alt="GetAltRef()+200"/>
|
||||
</block>
|
||||
<block name="roll">
|
||||
<set value="TRUE" var="h_ctl_disabled"/>
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" throttle="1.0" vmode="throttle" wp="CLIMB" pitch="15"/>
|
||||
@@ -82,7 +82,7 @@
|
||||
<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 name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
|
||||
@@ -26,48 +26,48 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Circle"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Circle"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" throttle="1.0" vmode="throttle" wp="CLIMB" pitch="15"/>
|
||||
</block>
|
||||
<block name="Circle" strip_button="Circle" strip_icon="home.png">
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="ground_alt+200" until="GetPosAlt() > ground_alt+195"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="ground_alt+200" until="NavCircleCount() > 2"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="ground_alt+300" until="GetPosAlt() > ground_alt+295"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="ground_alt+300" until="NavCircleCount() > 2"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="ground_alt+400" until="GetPosAlt() > ground_alt+395"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="ground_alt+400" until="NavCircleCount() > 2"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="ground_alt+300" until="ground_alt+305 > GetPosAlt()"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="ground_alt+300" until="NavCircleCount() > 2"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="ground_alt+200" until="ground_alt+205 > GetPosAlt()"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="ground_alt+200" until="NavCircleCount() > 2"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+200" until="GetPosAlt() > GetAltRef()+195"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+200" until="NavCircleCount() > 2"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+300" until="GetPosAlt() > GetAltRef()+295"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+300" until="NavCircleCount() > 2"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+400" until="GetPosAlt() > GetAltRef()+395"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+400" until="NavCircleCount() > 2"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+300" until="GetAltRef()+305 > GetPosAlt()"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+300" until="NavCircleCount() > 2"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+200" until="GetAltRef()+205 > GetPosAlt()"/>
|
||||
<circle radius="nav_radius" wp="CIRCLE" alt="GetAltRef()+200" until="NavCircleCount() > 2"/>
|
||||
<deroute block="Circle"/>
|
||||
</block>
|
||||
<block name="Racetrack E-W" strip_button="Racetrack E-W" strip_icon="oval.png">
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="ground_alt+200" until="GetPosAlt() > ground_alt+195"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="ground_alt+200" until="nav_oval_count > 2"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="ground_alt+300" until="GetPosAlt() > ground_alt+295"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="ground_alt+300" until="nav_oval_count > 2"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="ground_alt+400" until="GetPosAlt() > ground_alt+395"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="ground_alt+400" until="nav_oval_count > 2"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="ground_alt+300" until="ground_alt+305 > GetPosAlt()"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="ground_alt+300" until="nav_oval_count > 2"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="ground_alt+200" until="ground_alt+205 > GetPosAlt()"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="ground_alt+200" until="nav_oval_count > 2"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+200" until="GetPosAlt() > GetAltRef()+195"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+200" until="nav_oval_count > 2"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+300" until="GetPosAlt() > GetAltRef()+295"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+300" until="nav_oval_count > 2"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+400" until="GetPosAlt() > GetAltRef()+395"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+400" until="nav_oval_count > 2"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+300" until="GetAltRef()+305 > GetPosAlt()"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+300" until="nav_oval_count > 2"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+200" until="GetAltRef()+205 > GetPosAlt()"/>
|
||||
<oval p1="1" p2="2" radius="nav_radius" alt="GetAltRef()+200" until="nav_oval_count > 2"/>
|
||||
<deroute block="Racetrack E-W"/>
|
||||
</block>
|
||||
<block name="Racetrack N-S" strip_button="Racetrack N-S" strip_icon="oval.png">
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="ground_alt+200" until="GetPosAlt() > ground_alt+195"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="ground_alt+200" until="nav_oval_count > 2"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="ground_alt+300" until="GetPosAlt() > ground_alt+295"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="ground_alt+300" until="nav_oval_count > 2"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="ground_alt+400" until="GetPosAlt() > ground_alt+395"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="ground_alt+400" until="nav_oval_count > 2"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="ground_alt+300" until="ground_alt+305 > GetPosAlt()"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="ground_alt+300" until="nav_oval_count > 2"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="ground_alt+200" until="ground_alt+305 > GetPosAlt()"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="ground_alt+200" until="nav_oval_count > 2"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+200" until="GetPosAlt() > GetAltRef()+195"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+200" until="nav_oval_count > 2"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+300" until="GetPosAlt() > GetAltRef()+295"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+300" until="nav_oval_count > 2"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+400" until="GetPosAlt() > GetAltRef()+395"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+400" until="nav_oval_count > 2"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+300" until="GetAltRef()+305 > GetPosAlt()"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+300" until="nav_oval_count > 2"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+200" until="GetAltRef()+305 > GetPosAlt()"/>
|
||||
<oval p1="2" p2="3" radius="nav_radius" alt="GetAltRef()+200" until="nav_oval_count > 2"/>
|
||||
<deroute block="Racetrack N-S"/>
|
||||
</block>
|
||||
</blocks>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" throttle="1.0" vmode="throttle" wp="CLIMB"/>
|
||||
@@ -47,7 +47,7 @@
|
||||
<circle radius="nav_radius" wp="PROFILE"/>
|
||||
</block>
|
||||
<block name="profile_down" strip_button="Profile Down" strip_icon="down_profile.png">
|
||||
<circle radius="nav_radius" wp="PROFILE" vmode="throttle" throttle="0" pitch="RadOfDeg(-10)" until="(ground_alt+150 > GetPosAlt())"/>
|
||||
<circle radius="nav_radius" wp="PROFILE" vmode="throttle" throttle="0" pitch="RadOfDeg(-10)" until="(GetAltRef()+150 > GetPosAlt())"/>
|
||||
<deroute block="Standby"/>
|
||||
</block>
|
||||
<block name="MOB" strip_button="Circle around here" strip_icon="mob.png">
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10), 10 > fabs(GetPosAlt() - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/>
|
||||
</block>
|
||||
<block name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD" alt="ground_alt"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD" alt="GetAltRef()"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
<go approaching_time="0" from="AF" hmode="route" throttle="0.0" vmode="throttle" wp="TD"/>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
</block>
|
||||
|
||||
<block name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go alt="baseleg_alt" approaching_time="16" from="AF" hmode="route" wp="TD"/>
|
||||
<go approaching_time="2" from="AF" hmode="route" throttle="0.1" vmode="throttle" wp="TD"/>
|
||||
</block>
|
||||
@@ -48,7 +48,7 @@
|
||||
</block>
|
||||
|
||||
<block name="climb">
|
||||
<exception cond=" GetPosAlt() > ground_alt +30" deroute="wait"/>
|
||||
<exception cond=" GetPosAlt() > GetAltRef() +30" deroute="wait"/>
|
||||
<attitude pitch="15" roll="0" throttle="0.8" until="10> stage_time" vmode="throttle"/>
|
||||
</block>-->
|
||||
<block name="wait" strip_button="Wait">
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
</while>
|
||||
</block>
|
||||
<block name="takeoff">
|
||||
<exception cond="GetPosAlt() > ground_alt + 25" deroute="standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef() + 25" deroute="standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<go wp="TAKEOFF"/>
|
||||
</block>
|
||||
@@ -132,7 +132,7 @@
|
||||
<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 name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<call fun="compute_TOD(WP_AF, WP_TD, WP_TOD, GLIDE_AIRSPEED, GLIDE_VSPEED)"/>
|
||||
<go approaching_time="0" from="AF" hmode="route" wp="TOD"/>
|
||||
<go from="TOD" hmode="route" pitch="stage_time*(GLIDE_PITCH/3)" throttle="0" vmode="throttle" wp="TD"/>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" pitch="15" throttle="1.0" vmode="throttle" wp="CLIMB"/>
|
||||
@@ -100,7 +100,7 @@
|
||||
<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 name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block key="t" name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png" group="home">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" throttle="1.0" vmode="throttle" wp="CLIMB" pitch="15"/>
|
||||
@@ -52,7 +52,7 @@
|
||||
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10), 10 > fabs(GetPosAlt() - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/>
|
||||
</block>
|
||||
<block name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</while>
|
||||
</block>
|
||||
<block name="circle">
|
||||
<circle wp="road_end" ALT="ground_alt+50" radius="75"/>
|
||||
<circle wp="road_end" ALT="GetAltRef()+50" radius="75"/>
|
||||
</block>
|
||||
<block name="go too far">
|
||||
<go wp="too far"/>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</block>
|
||||
<block name="for">
|
||||
<for from="0" to="3" var="i">
|
||||
<circle alt="ground_alt+50+50*$i" radius="75" until="stage_time>10" wp="HOME"/>
|
||||
<circle alt="GetAltRef()+50+50*$i" radius="75" until="stage_time>10" wp="HOME"/>
|
||||
</for>
|
||||
<circle wp="HOME" radius="50"/>
|
||||
</block>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block group="home" key="t" name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" pitch="15" throttle="1.0" vmode="throttle" wp="CLIMB"/>
|
||||
@@ -82,7 +82,7 @@
|
||||
<call fun="nav_bungee_takeoff_run()"/>
|
||||
</block>
|
||||
<block group="nav_pattern" name="Poly Survey" strip_button="Poly Survey">
|
||||
<call fun="nav_survey_polygon_setup(WP_S1,5,80,30,10,50,ground_alt+60)"/>
|
||||
<call fun="nav_survey_polygon_setup(WP_S1,5,80,30,10,50,GetAltRef()+60)"/>
|
||||
<call fun="nav_survey_polygon_run()"/>
|
||||
</block>
|
||||
<block group="nav_pattern" name="Border line 1-2" strip_button="Border Line">
|
||||
@@ -130,7 +130,7 @@
|
||||
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10), 10 > fabs(GetPosAlt() - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/>
|
||||
</block>
|
||||
<block name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<set value="TRUE" var="h_ctl_disabled"/>
|
||||
<set value="(-0.6*MAX_PPRZ)" var="h_ctl_aileron_setpoint"/>
|
||||
<set value="(0.9*MAX_PPRZ)" var="h_ctl_elevator_setpoint"/>
|
||||
<while cond="GetPosAlt() > ground_alt + 220"/>
|
||||
<while cond="GetPosAlt() > GetAltRef() + 220"/>
|
||||
<set value="0" var="h_ctl_aileron_setpoint"/>
|
||||
<set value="0" var="h_ctl_elevator_setpoint"/>
|
||||
</block>
|
||||
@@ -70,7 +70,7 @@
|
||||
<circle radius="nav_radius" wp="PROF_LAND"/>
|
||||
</block>
|
||||
<block name="profile_down land" strip_button="Profile Down Land" strip_icon="down_profile.png">
|
||||
<circle pitch="RadOfDeg(-10)" radius="nav_radius" throttle="0" until="(ground_alt+100 > GetPosAlt())" vmode="throttle" wp="PROF_LAND"/>
|
||||
<circle pitch="RadOfDeg(-10)" radius="nav_radius" throttle="0" until="(GetAltRef()+100 > GetPosAlt())" vmode="throttle" wp="PROF_LAND"/>
|
||||
<deroute block="wait"/>
|
||||
</block>
|
||||
<block name="Land Right AF-TD" strip_button="Land right (wp AF-TD)" strip_icon="land-right.png">
|
||||
@@ -87,7 +87,7 @@
|
||||
<circle radius="nav_radius" until="NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10) && 20 > fabs(GetPosAlt() - WaypointAlt(WP__BASELEG))" wp="_BASELEG"/>
|
||||
</block>
|
||||
<block name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block key="t" name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" pitch="15" throttle="1.0" vmode="throttle" wp="CLIMB"/>
|
||||
@@ -73,7 +73,7 @@
|
||||
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10), 10 > fabs(GetPosAlt() - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/>
|
||||
</block>
|
||||
<block name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</sectors>
|
||||
<exceptions>
|
||||
<!-- Check inside Flight Area, then goto Standby -->
|
||||
<exception cond="Or(!InsideFlight_Area(GetPosX(), GetPosY()), GetPosAlt() > ground_alt + 50) && !(nav_block == IndexOfBlock('Wait GPS')) && !(nav_block == IndexOfBlock('Geo init')) && !(nav_block == IndexOfBlock('Holding point')) && !(nav_block == IndexOfBlock('landed')) && !(nav_block == IndexOfBlock('Standby'))" deroute="Standby"/>
|
||||
<exception cond="Or(!InsideFlight_Area(GetPosX(), GetPosY()), GetPosAlt() > GetAltRef() + 50) && !(nav_block == IndexOfBlock('Wait GPS')) && !(nav_block == IndexOfBlock('Geo init')) && !(nav_block == IndexOfBlock('Holding point')) && !(nav_block == IndexOfBlock('landed')) && !(nav_block == IndexOfBlock('Standby'))" deroute="Standby"/>
|
||||
</exceptions>
|
||||
<blocks>
|
||||
<block name="Wait GPS">
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
</sectors>
|
||||
<exceptions>
|
||||
<!-- Check inside small flight area, then goto Center(Standby) -->
|
||||
<exception cond="Or(! InsideFlight_Area(GetPosX(), GetPosY()), GetPosAlt() > ground_alt + 50) && !(nav_block == BLOCK_Init) && !(nav_block == BLOCK_Geo_init) && !(nav_block == BLOCK_Landed)" deroute="Standby"/>
|
||||
<exception cond="Or(! InsideFlight_Area(GetPosX(), GetPosY()), GetPosAlt() > GetAltRef() + 50) && !(nav_block == BLOCK_Init) && !(nav_block == BLOCK_Geo_init) && !(nav_block == BLOCK_Landed)" deroute="Standby"/>
|
||||
<!-- Check if battery is empty, then Land Here -->
|
||||
<exception cond="electrical.bat_low && !(nav_block == BLOCK_Land) && !(nav_block == BLOCK_Flare) && !(nav_block == BLOCK_Landed)" deroute="Land_Here"/>
|
||||
<!-- Check if time is up(10 seconds range), then Land Here -->
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<deroute block="climb"/>
|
||||
</block>
|
||||
<block name="climb">
|
||||
<attitude pitch="10" roll="0" throttle="0.9" until="GetPosAlt() > ground_alt+30" vmode="throttle"/>
|
||||
<attitude pitch="10" roll="0" throttle="0.9" until="GetPosAlt() > GetAltRef()+30" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="standby" strip_button="STDBY">
|
||||
<circle radius="nav_radius" wp="STDBY"/>
|
||||
@@ -77,7 +77,7 @@
|
||||
<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 name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" throttle="1.0" vmode="throttle" wp="CLIMB"/>
|
||||
@@ -74,7 +74,7 @@
|
||||
<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 name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff (wp CLIMB)">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<go wp="CLIMB"/>
|
||||
</block>
|
||||
@@ -70,25 +70,25 @@
|
||||
<circle pitch="auto" radius="75" throttle="0.7" wp="1"/>
|
||||
</block>
|
||||
<block name="Climb 75% throttle">
|
||||
<circle pitch="10" radius="50+(GetPosAlt()-ground_alt)/2" throttle="0.75" until="(10 > PowerVoltage()) || (GetPosAlt() > ground_alt+ 1350)" vmode="throttle" wp="1"/>
|
||||
<circle pitch="10" radius="50+(GetPosAlt()-GetAltRef())/2" throttle="0.75" until="(10 > PowerVoltage()) || (GetPosAlt() > GetAltRef()+ 1350)" vmode="throttle" wp="1"/>
|
||||
</block>
|
||||
<block name="Climb 0m/s">
|
||||
<circle climb="0" radius="nav_radius" until="10 > PowerVoltage()" vmode="climb" wp="1"/>
|
||||
</block>
|
||||
<block name="Climb 1m/s">
|
||||
<circle climb="1" pitch="5" radius="50+(GetPosAlt()-ground_alt)/2" until="10 > PowerVoltage()" vmode="climb" wp="1"/>
|
||||
<circle climb="1" pitch="5" radius="50+(GetPosAlt()-GetAltRef())/2" until="10 > PowerVoltage()" vmode="climb" wp="1"/>
|
||||
</block>
|
||||
<block name="Climb nav_climb m/s">
|
||||
<circle climb="nav_climb" radius="nav_radius" until="(10 > PowerVoltage()) || (GetPosAlt() > ground_alt+ 1350)" vmode="climb" wp="1"/>
|
||||
<circle climb="nav_climb" radius="nav_radius" until="(10 > PowerVoltage()) || (GetPosAlt() > GetAltRef()+ 1350)" vmode="climb" wp="1"/>
|
||||
</block>
|
||||
|
||||
<block name="Circle 0% throttle">
|
||||
<circle pitch="fp_pitch" radius="nav_radius" throttle="0.0" until="ground_alt+50 > GetPosAlt()" vmode="throttle" wp="1"/>
|
||||
<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="ground_alt+50 > GetPosAlt()" vmode="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>
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
<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 name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
@@ -153,7 +153,7 @@
|
||||
</while>
|
||||
</block>
|
||||
<block name="Heading 30">
|
||||
<heading alt="ground_alt+50" course="30" until="FALSE"/>
|
||||
<heading alt="GetAltRef()+50" course="30" until="FALSE"/>
|
||||
</block>
|
||||
<block name="For loop (circles wp 1)">
|
||||
<for from="0" to="3" var="i">
|
||||
@@ -168,7 +168,7 @@
|
||||
</block>
|
||||
<block name="Fly in Square">
|
||||
<exception cond="! InsideSquare(GetPosX(), GetPosY())" deroute="Come back wp 1"/>
|
||||
<attitude alt="ground_alt+75" roll="0" vmode="alt"/>
|
||||
<attitude alt="GetAltRef()+75" roll="0" vmode="alt"/>
|
||||
</block>
|
||||
<block name="Come back wp 1">
|
||||
<exception cond="InsideSquare(GetPosX(), GetPosY())" deroute="Fly in Square"/>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block name="Takeoff" strip_icon="takeoff.png" strip_button="Takeoff (wp CLIMB)">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="CLIMB_AIRSPEED" var="v_ctl_auto_airspeed_setpoint" />
|
||||
<go wp="CLIMB"/>
|
||||
@@ -69,25 +69,25 @@
|
||||
<circle pitch="auto" radius="75" throttle="0.7" wp="1"/>
|
||||
</block>
|
||||
<block name="Climb 75% throttle">
|
||||
<circle pitch="10" radius="50+(GetPosAlt()-ground_alt)/2" throttle="0.75" until="(10 > PowerVoltage()) || (GetPosAlt() > ground_alt+ 1350)" vmode="throttle" wp="1"/>
|
||||
<circle pitch="10" radius="50+(GetPosAlt()-GetAltRef())/2" throttle="0.75" until="(10 > PowerVoltage()) || (GetPosAlt() > GetAltRef()+ 1350)" vmode="throttle" wp="1"/>
|
||||
</block>
|
||||
<block name="Climb 0m/s">
|
||||
<circle climb="0" radius="nav_radius" until="10 > PowerVoltage()" vmode="climb" wp="1"/>
|
||||
</block>
|
||||
<block name="Climb 1m/s">
|
||||
<circle climb="1" pitch="5" radius="50+(GetPosAlt()-ground_alt)/2" until="10 > PowerVoltage()" vmode="climb" wp="1"/>
|
||||
<circle climb="1" pitch="5" radius="50+(GetPosAlt()-GetAltRef())/2" until="10 > PowerVoltage()" vmode="climb" wp="1"/>
|
||||
</block>
|
||||
<block name="Climb nav_climb m/s">
|
||||
<circle climb="nav_climb" radius="nav_radius" until="(10 > PowerVoltage()) || (GetPosAlt() > ground_alt+ 1350)" vmode="climb" wp="1"/>
|
||||
<circle climb="nav_climb" radius="nav_radius" until="(10 > PowerVoltage()) || (GetPosAlt() > GetAltRef()+ 1350)" vmode="climb" wp="1"/>
|
||||
</block>
|
||||
|
||||
<block name="Circle 0% throttle">
|
||||
<circle pitch="fp_pitch" radius="nav_radius" throttle="0.0" until="ground_alt+50 > GetPosAlt()" vmode="throttle" wp="1"/>
|
||||
<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="ground_alt+50 > GetPosAlt()" vmode="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>
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
</while>
|
||||
</block>
|
||||
<block name="Heading 30">
|
||||
<heading alt="ground_alt+50" course="30" until="FALSE"/>
|
||||
<heading alt="GetAltRef()+50" course="30" until="FALSE"/>
|
||||
</block>
|
||||
<block name="For loop (circles wp 1)">
|
||||
<for from="0" to="3" var="i">
|
||||
@@ -178,7 +178,7 @@
|
||||
</block>
|
||||
<block name="Fly in Square">
|
||||
<exception cond="! InsideSquare(GetPosX(), GetPosY())" deroute="Come back wp 1"/>
|
||||
<attitude alt="ground_alt+75" roll="0" vmode="alt"/>
|
||||
<attitude alt="GetAltRef()+75" roll="0" vmode="alt"/>
|
||||
</block>
|
||||
<block name="Come back wp 1">
|
||||
<exception cond="InsideSquare(GetPosX(), GetPosY())" deroute="Fly in Square"/>
|
||||
|
||||
@@ -61,7 +61,7 @@ float varsweepsize=110;
|
||||
</block>
|
||||
|
||||
<block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<go wp="CLIMB"/>
|
||||
</block>
|
||||
@@ -111,8 +111,8 @@ float varsweepsize=110;
|
||||
<block name="Monter">
|
||||
<call fun="NavSetWaypointHere(WP_MOB)"/>
|
||||
<set value="DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
||||
<circle alt="ground_alt+105" radius="nav_radius" wp="MOB"/>
|
||||
<exception cond="GetPosAlt() > ground_alt+100" deroute="Carto survey S1-S2-S3"/>
|
||||
<circle alt="GetAltRef()+105" radius="nav_radius" wp="MOB"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+100" deroute="Carto survey S1-S2-S3"/>
|
||||
</block>
|
||||
|
||||
|
||||
@@ -139,8 +139,8 @@ float varsweepsize=110;
|
||||
<block name="Descendre">
|
||||
<call fun="NavSetWaypointHere(WP_MOB)"/>
|
||||
<set value="DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
||||
<circle alt="ground_alt+35" radius="nav_radius" wp="MOB"/>
|
||||
<exception cond="ground_alt+40 > GetPosAlt() " deroute="Carto survey SP1-SP2-SP3 fin"/>
|
||||
<circle alt="GetAltRef()+35" radius="nav_radius" wp="MOB"/>
|
||||
<exception cond="GetAltRef()+40 > GetPosAlt() " deroute="Carto survey SP1-SP2-SP3 fin"/>
|
||||
</block>
|
||||
|
||||
<block name="Carto survey SP1-SP2-SP3 fin" strip_button="Survey (wp S1-S2)" strip_icon="survey.png">
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<exceptions/>
|
||||
<blocks>
|
||||
<block name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" pitch="15" throttle="1.0" vmode="throttle" wp="CLIMB"/>
|
||||
@@ -91,7 +91,7 @@
|
||||
<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 name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
<block name="flare">
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<attitude roll="0" throttle="0" vmode="throttle"/>
|
||||
</block>
|
||||
<block key="t" name="Takeoff" strip_button="Takeoff (wp CLIMB)" strip_icon="takeoff.png" group="home">
|
||||
<exception cond="GetPosAlt() > ground_alt+25" deroute="Standby"/>
|
||||
<exception cond="GetPosAlt() > GetAltRef()+25" deroute="Standby"/>
|
||||
<set value="0" var="kill_throttle"/>
|
||||
<set value="0" var="autopilot_flight_time"/>
|
||||
<go from="HOME" throttle="1.0" vmode="throttle" wp="CLIMB" pitch="15"/>
|
||||
@@ -66,7 +66,7 @@
|
||||
<circle radius="nav_radius" until="And(NavQdrCloseTo(DegOfRad(baseleg_out_qdr)-(nav_radius/fabs(nav_radius))*10), 10 > fabs(GetPosAlt() - WaypointAlt(WP__BASELEG)))" wp="_BASELEG"/>
|
||||
</block>
|
||||
<block name="final">
|
||||
<exception cond="ground_alt + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<exception cond="GetAltRef() + 10 > GetPosAlt()" deroute="flare"/>
|
||||
<go from="AF" hmode="route" vmode="glide" wp="TD"/>
|
||||
</block>
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
<field name="utm_east" type="int32" unit="m"/>
|
||||
<field name="utm_north" type="int32" unit="m"/>
|
||||
<field name="utm_zone" type="uint8"/>
|
||||
<field name="ground_alt" type="float" unit="m"/>
|
||||
</message>
|
||||
|
||||
<message name="NAVIGATION" id="10">
|
||||
@@ -2718,6 +2719,7 @@
|
||||
<field name="lat" type="float" unit="deg"></field>
|
||||
<field name="long" type="float" unit="deg"></field>
|
||||
<field name="alt" type="float" unit="m"></field>
|
||||
<field name="ground_alt" type="float" unit="m"/>
|
||||
</message>
|
||||
|
||||
<message name="SURVEY_STATUS" id="31">
|
||||
|
||||
@@ -452,7 +452,7 @@ void nav_periodic_task(void) {
|
||||
|
||||
static void send_nav_ref(void) {
|
||||
DOWNLINK_SEND_NAVIGATION_REF(DefaultChannel, DefaultDevice,
|
||||
&nav_utm_east0, &nav_utm_north0, &nav_utm_zone0);
|
||||
&nav_utm_east0, &nav_utm_north0, &nav_utm_zone0, &ground_alt);
|
||||
}
|
||||
|
||||
static void send_nav(void) {
|
||||
|
||||
@@ -199,6 +199,7 @@ bool_t nav_approaching_xy(float x, float y, float from_x, float from_y, float ap
|
||||
#define GetPosX() (stateGetPositionEnu_f()->x)
|
||||
#define GetPosY() (stateGetPositionEnu_f()->y)
|
||||
#define GetPosAlt() (stateGetPositionUtm_f()->alt)
|
||||
#define GetAltRef() (ground_alt)
|
||||
|
||||
#define SEND_NAVIGATION(_trans, _dev) { \
|
||||
uint8_t _circle_count = NavCircleCount(); \
|
||||
|
||||
@@ -58,8 +58,6 @@ struct EnuCoor_i nav_last_point;
|
||||
|
||||
uint8_t last_wp __attribute__ ((unused));
|
||||
|
||||
int32_t ground_alt;
|
||||
|
||||
/** Maximum distance from HOME waypoint before going into failsafe mode */
|
||||
#ifndef FAILSAFE_MODE_DISTANCE
|
||||
#define FAILSAFE_MODE_DISTANCE (1.5*MAX_DIST_FROM_HOME)
|
||||
@@ -149,7 +147,6 @@ void nav_init(void) {
|
||||
}
|
||||
nav_block = 0;
|
||||
nav_stage = 0;
|
||||
ground_alt = POS_BFP_OF_REAL(GROUND_ALT);
|
||||
nav_altitude = POS_BFP_OF_REAL(SECURITY_HEIGHT);
|
||||
nav_flight_altitude = nav_altitude;
|
||||
flight_altitude = SECURITY_ALT;
|
||||
@@ -380,13 +377,11 @@ static inline void nav_set_altitude( void ) {
|
||||
/** Reset the geographic reference to the current GPS fix */
|
||||
unit_t nav_reset_reference( void ) {
|
||||
ins_reset_local_origin();
|
||||
ground_alt = POS_BFP_OF_REAL(state.ned_origin_f.hmsl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
unit_t nav_reset_alt( void ) {
|
||||
ins_reset_altitude_ref();
|
||||
ground_alt = POS_BFP_OF_REAL(state.ned_origin_f.hmsl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,9 +47,6 @@ extern void nav_run(void);
|
||||
|
||||
extern uint8_t last_wp __attribute__ ((unused));
|
||||
|
||||
/** ground reference altitude in meters << #INT32_POS_FRAC */
|
||||
extern int32_t ground_alt;
|
||||
|
||||
extern uint8_t horizontal_mode;
|
||||
extern uint8_t nav_segment_start, nav_segment_end;
|
||||
extern uint8_t nav_circle_centre;
|
||||
@@ -209,13 +206,14 @@ bool_t nav_check_wp_time(uint8_t wp_idx, uint16_t stay_time);
|
||||
|
||||
#define navigation_SetFlightAltitude(x) { \
|
||||
flight_altitude = x; \
|
||||
nav_flight_altitude = POS_BFP_OF_REAL(flight_altitude) - ground_alt; \
|
||||
nav_flight_altitude = POS_BFP_OF_REAL(flight_altitude - state.ned_origin_f.hmsl); \
|
||||
}
|
||||
|
||||
|
||||
#define GetPosX() (stateGetPositionEnu_f()->x)
|
||||
#define GetPosY() (stateGetPositionEnu_f()->y)
|
||||
#define GetPosAlt() (stateGetPositionEnu_f()->z+ground_alt)
|
||||
#define GetPosAlt() (stateGetPositionEnu_f()->z+state.ned_origin_f.hmsl)
|
||||
#define GetAltRef() (state.ned_origin_f.hmsl)
|
||||
|
||||
|
||||
extern void navigation_update_wp_from_speed(uint8_t wp, struct Int16Vect3 speed_sp, int16_t heading_rate_sp );
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
<child>
|
||||
<widget class="GtkEventBox" id="eventbox14">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Above Ground Level (m), climb indicator, vertical speed (m/s)</property>
|
||||
<property name="tooltip" translatable="yes">Above Ground Level from SRTM if available, ground reference otherwise (m), climb indicator, vertical speed (m/s)</property>
|
||||
<child>
|
||||
<widget class="GtkDrawingArea" id="drawingarea_agl">
|
||||
<property name="visible">True</property>
|
||||
|
||||
@@ -1288,10 +1288,12 @@ let listen_waypoint_moved = fun () ->
|
||||
let wp_id = Pprz.int_assoc "wp_id" vs in
|
||||
let a = fun s -> Pprz.float_assoc s vs in
|
||||
let geo = { posn_lat = (Deg>>Rad)(a "lat"); posn_long = (Deg>>Rad)(a "long") }
|
||||
and altitude = a "alt" in
|
||||
and altitude = a "alt"
|
||||
and ground_alt = a "ground_alt" in
|
||||
|
||||
try
|
||||
let w = ac.fp_group#get_wp wp_id in
|
||||
w#set_ground_alt ground_alt;
|
||||
w#set ~altitude ~update:true geo
|
||||
with
|
||||
Not_found -> () (* Silently ignore unknown waypoints *)
|
||||
|
||||
@@ -121,6 +121,7 @@ type aircraft = {
|
||||
mutable climb : float;
|
||||
mutable nav_ref : nav_ref option;
|
||||
mutable d_hmsl : float;
|
||||
mutable ground_alt : float; (* ground alt ref if no SRTM data *)
|
||||
mutable desired_pos : Latlong.geographic;
|
||||
mutable desired_altitude : float;
|
||||
mutable desired_course : float;
|
||||
@@ -169,7 +170,7 @@ let new_aircraft = fun id name fp airframe ->
|
||||
unix_time = 0.; itow = Int32.of_int 0;
|
||||
roll = 0.; pitch = 0.;
|
||||
gspeed=0.; airspeed= -1.; course = 0.; heading = 0.; alt=0.; climb=0.; agl = 0.;
|
||||
nav_ref = None; d_hmsl = 0.;
|
||||
nav_ref = None; d_hmsl = 0.; ground_alt = 0.;
|
||||
desired_pos = { Latlong.posn_lat = 0.; posn_long = 0. };
|
||||
desired_course = 0.; desired_altitude = 0.; desired_climb = 0.;
|
||||
cur_block=0; cur_stage=0;
|
||||
|
||||
@@ -87,6 +87,7 @@ type aircraft = {
|
||||
mutable climb : float;
|
||||
mutable nav_ref : nav_ref option;
|
||||
mutable d_hmsl : float; (* difference between geoid and ellipsoid *)
|
||||
mutable ground_alt : float; (* ground alt ref if no SRTM data *)
|
||||
mutable desired_pos : Latlong.geographic;
|
||||
mutable desired_altitude : float;
|
||||
mutable desired_course : float;
|
||||
|
||||
@@ -113,7 +113,7 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values ->
|
||||
a.course <- norm_course ((Deg>>Rad)(fvalue "course" /. 10.));
|
||||
if !heading_from_course then
|
||||
a.heading <- a.course;
|
||||
a.agl <- a.alt -. float (try Srtm.of_wgs84 a.pos with _ -> 0);
|
||||
a.agl <- a.alt -. (try float (Srtm.of_wgs84 a.pos) with _ -> a.ground_alt);
|
||||
if a.gspeed > 3. && a.ap_mode = _AUTO2 then
|
||||
Wind.update ac_name a.gspeed a.course
|
||||
end
|
||||
@@ -128,7 +128,7 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values ->
|
||||
a.course <- norm_course ((Deg>>Rad)(fvalue "course" /. 10.));
|
||||
if !heading_from_course then
|
||||
a.heading <- a.course;
|
||||
a.agl <- a.alt -. float (try Srtm.of_wgs84 a.pos with _ -> 0);
|
||||
a.agl <- a.alt -. (try float (Srtm.of_wgs84 a.pos) with _ -> a.ground_alt);
|
||||
a.gps_mode <- check_index (ivalue "mode") gps_modes "GPS_MODE";
|
||||
if a.gspeed > 3. && a.ap_mode = _AUTO2 then
|
||||
Wind.update ac_name a.gspeed a.course
|
||||
@@ -152,12 +152,14 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values ->
|
||||
a.desired_climb <- (try fvalue "climb" with _ -> fvalue "desired_climb");
|
||||
begin try a.desired_course <- norm_course (fvalue "course") with _ -> () end
|
||||
| "NAVIGATION_REF" ->
|
||||
a.nav_ref <- Some (Utm { utm_x = fvalue "utm_east"; utm_y = fvalue "utm_north"; utm_zone = ivalue "utm_zone" })
|
||||
a.nav_ref <- Some (Utm { utm_x = fvalue "utm_east"; utm_y = fvalue "utm_north"; utm_zone = ivalue "utm_zone" });
|
||||
a.ground_alt <- fvalue "ground_alt"
|
||||
| "NAVIGATION_REF_LLA" ->
|
||||
let lat = ivalue "lat"
|
||||
and lon = ivalue "lon" in
|
||||
let geo = make_geo (float lat /. 1e7) (float lon /. 1e7) in
|
||||
a.nav_ref <- Some (Geo geo)
|
||||
a.nav_ref <- Some (Geo geo);
|
||||
a.ground_alt <- fvalue "ground_alt"
|
||||
| "ATTITUDE" ->
|
||||
let roll = fvalue "phi"
|
||||
and pitch = fvalue "theta" in
|
||||
@@ -316,7 +318,7 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values ->
|
||||
a.course <- norm_course (fvalue "course" /. 1e3);
|
||||
if !heading_from_course then
|
||||
a.heading <- a.course;
|
||||
a.agl <- a.alt -. float (try Srtm.of_wgs84 a.pos with _ -> 0);
|
||||
a.agl <- a.alt -. (try float (Srtm.of_wgs84 a.pos) with _ -> a.ground_alt);
|
||||
a.bat <- fvalue "vsupply" /. 10.;
|
||||
a.energy <- ivalue "energy" * 100;
|
||||
a.throttle <- fvalue "throttle";
|
||||
|
||||
@@ -30,8 +30,6 @@ module LL = Latlong
|
||||
module U = Unix
|
||||
module Dl_Pprz = Pprz.Messages (struct let name = "datalink" end)
|
||||
|
||||
let nav_ref_alt = ref 0.
|
||||
let nav_ref_hmsl = ref 0.
|
||||
|
||||
(* FIXME: bound the loop *)
|
||||
let rec norm_course =
|
||||
@@ -168,7 +166,7 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values ->
|
||||
and vnorth = foi32value "vnorth" /. speed_frac in
|
||||
a.gspeed <- sqrt(vnorth*.vnorth +. veast*.veast);
|
||||
a.climb <- foi32value "vup" /. speed_frac;
|
||||
a.agl <- a.alt -. float (try Srtm.of_wgs84 a.pos with _ -> 0);
|
||||
a.agl <- a.alt -. (try float (Srtm.of_wgs84 a.pos) with _ -> a.ground_alt);
|
||||
a.course <- norm_course ((Rad>>Deg) (foi32value "psi" /. angle_frac));
|
||||
a.heading <- norm_course (foi32value "psi" /. angle_frac);
|
||||
a.roll <- foi32value "phi" /. angle_frac;
|
||||
@@ -200,6 +198,7 @@ let log_and_parse = fun ac_name (a:Aircraft.aircraft) msg values ->
|
||||
let nav_ref_ecef = LL.make_ecef [| x; y; z |] in
|
||||
a.nav_ref <- Some (Ltp nav_ref_ecef);
|
||||
a.d_hmsl <- hmsl -. alt;
|
||||
a.ground_alt <- hmsl;
|
||||
| "ROTORCRAFT_NAV_STATUS" ->
|
||||
a.block_time <- ivalue "block_time";
|
||||
a.stage_time <- ivalue "stage_time";
|
||||
|
||||
@@ -294,7 +294,8 @@ let send_moved_waypoints = fun a ->
|
||||
"wp_id", Pprz.Int wp_id;
|
||||
"long", Pprz.Float ((Rad>>Deg)geo.posn_long);
|
||||
"lat", Pprz.Float ((Rad>>Deg)geo.posn_lat);
|
||||
"alt", Pprz.Float wp.altitude] in
|
||||
"alt", Pprz.Float wp.altitude;
|
||||
"ground_alt", Pprz.Float (try float (Srtm.of_wgs84 geo) with _ -> a.ground_alt)] in
|
||||
Ground_Pprz.message_send my_id "WAYPOINT_MOVED" vs)
|
||||
a.waypoints
|
||||
|
||||
|
||||
@@ -645,7 +645,7 @@ object (self)
|
||||
|
||||
|
||||
class widget = fun ?(height=800) ?(srtm=false) ?width ?projection ?georef () ->
|
||||
let srtm = GMenu.check_menu_item ~label:"SRTM" ~active:srtm () in
|
||||
let srtm = GMenu.check_menu_item ~label:"display SRTM alt" ~active:srtm () in
|
||||
let lbl_xy = GMisc.label ()
|
||||
and lbl_geo = GMisc.label ()
|
||||
and lbl_alt = GMisc.label ()
|
||||
@@ -676,6 +676,7 @@ class widget = fun ?(height=800) ?(srtm=false) ?width ?projection ?georef () ->
|
||||
let bg_menu = my_check_menu_item "Background" ~active:true ~callback:self#switch_background ~packing:self#file_menu#append () in
|
||||
|
||||
let tooltips = GData.tooltips () in
|
||||
tooltips#set_tip srtm#coerce ~text:"Display SRTM alt at pointer position (will request for download if not available)";
|
||||
|
||||
let b = GButton.button ~packing:toolbar#add () in
|
||||
ignore (b#connect#clicked (fun _ -> bg_menu#activate ()));
|
||||
@@ -777,7 +778,9 @@ class widget = fun ?(height=800) ?(srtm=false) ?width ?projection ?georef () ->
|
||||
|
||||
method display_alt = fun wgs84 ->
|
||||
if srtm#active then
|
||||
lbl_alt#set_text (sprintf " SRTM:%dm"(self#altitude wgs84))
|
||||
lbl_alt#set_text (sprintf " SRTM:%dm"(self#altitude wgs84))
|
||||
else if not (Srtm.available wgs84) then
|
||||
lbl_alt#set_text (sprintf " SRTM: N/A")
|
||||
|
||||
method display_group = fun s -> lbl_group#set_text s
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ object (self)
|
||||
val label = new CL.widget ~name:name ~color:"white" s 0. wpt_group
|
||||
val mutable name = name (* FIXME: already in label ! *)
|
||||
val mutable alt = alt
|
||||
val mutable ground_alt = 0.
|
||||
val mutable moved = None
|
||||
val mutable deleted = false
|
||||
val mutable commit_cb = None
|
||||
@@ -145,7 +146,7 @@ object (self)
|
||||
ea#set_adjustment adj;
|
||||
ea#set_value alt; (* this should be done by set_adjustment but seems to fail on ubuntu 13.10 (at least) *)
|
||||
|
||||
let agl = alt -. float (try Srtm.of_wgs84 initial_wgs84 with _ -> 0) in
|
||||
let agl = alt -. (try float (Srtm.of_wgs84 initial_wgs84) with _ -> ground_alt) in
|
||||
let agl_lab = GMisc.label ~text:(sprintf " AGL: %4.0fm" agl) ~packing:ha#add () in
|
||||
let plus10= GButton.button ~label:"+10" ~packing:ha#add () in
|
||||
let change_alt = fun x ->
|
||||
@@ -202,7 +203,7 @@ object (self)
|
||||
try
|
||||
set_coordinates ();
|
||||
let wgs84 = self#pos in
|
||||
let agl = ea#value -. float (try Srtm.of_wgs84 wgs84 with _ -> 0) in
|
||||
let agl = ea#value -. (try float (Srtm.of_wgs84 wgs84) with _ -> ground_alt) in
|
||||
agl_lab#set_text (sprintf " AGL: %4.0fm" agl)
|
||||
with _ -> ()
|
||||
in
|
||||
@@ -282,6 +283,7 @@ object (self)
|
||||
if update then updated ()
|
||||
| (None, false) | (Some _, true) -> ()
|
||||
| Some _, false -> self#reset_moved ()
|
||||
method set_ground_alt ga = ground_alt <- ga
|
||||
method delete () =
|
||||
deleted <- true; (* BOF *)
|
||||
wpt_group#destroy ()
|
||||
|
||||
@@ -52,6 +52,7 @@ class waypoint :
|
||||
method move : float -> float -> unit
|
||||
method name : string
|
||||
method set : ?altitude:float -> ?update:bool -> Latlong.geographic -> unit
|
||||
method set_ground_alt : float -> unit
|
||||
method set_name : string -> unit
|
||||
method xy : float * float
|
||||
method zoom : float -> unit
|
||||
|
||||
@@ -79,6 +79,9 @@ let of_wgs84 = fun geo ->
|
||||
let of_utm = fun utm ->
|
||||
of_wgs84 (Latlong.of_utm WGS84 utm)
|
||||
|
||||
let available = fun geo ->
|
||||
try ignore(of_wgs84 geo); true with _ -> false
|
||||
|
||||
let area_of_tile = fun tile ->
|
||||
let area = open_compressed "srtm.data.bz2" in
|
||||
let rec _area_of_tile = fun () ->
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user