mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-04 13:55:40 +08:00
[fixedwing] convert poly_survey_adv to a module
This commit is contained in:
committed by
Felix Ruess
parent
a47a9b46ca
commit
ea9c4e8357
@@ -195,6 +195,7 @@
|
|||||||
<modules>
|
<modules>
|
||||||
<load name="openlog.xml"/>
|
<load name="openlog.xml"/>
|
||||||
<load name="nav_survey_rectangle.xml"/>
|
<load name="nav_survey_rectangle.xml"/>
|
||||||
|
<load name="nav_survey_poly_adv.xml"/>
|
||||||
<load name="infrared_adc.xml"/>
|
<load name="infrared_adc.xml"/>
|
||||||
<load name="digital_cam_servo.xml">
|
<load name="digital_cam_servo.xml">
|
||||||
<define name="DC_SHUTTER_SERVO" value="COMMAND_SHUTTER" />
|
<define name="DC_SHUTTER_SERVO" value="COMMAND_SHUTTER" />
|
||||||
|
|||||||
@@ -13,6 +13,5 @@ $(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/nav_line.c
|
|||||||
|
|
||||||
$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/OSAMNav.c
|
$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/OSAMNav.c
|
||||||
$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/snav.c
|
$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/snav.c
|
||||||
$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/poly_survey_adv.c
|
|
||||||
$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/border_line.c
|
$(TARGET).srcs += $(SRC_SUBSYSTEMS)/navigation/border_line.c
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
<!DOCTYPE flight_plan SYSTEM "flight_plan.dtd">
|
||||||
|
|
||||||
|
<flight_plan alt="260" ground_alt="185" lat0="43.46223" lon0="1.27289" max_dist_from_home="1500" name="Basic" security_height="25">
|
||||||
|
<header>
|
||||||
|
#include "subsystems/navigation/nav_line.h"
|
||||||
|
#include "subsystems/datalink/datalink.h"
|
||||||
|
</header>
|
||||||
|
<waypoints>
|
||||||
|
<waypoint name="HOME" x="0" y="0"/>
|
||||||
|
<waypoint name="STDBY" x="49.5" y="100.1"/>
|
||||||
|
<waypoint name="1" x="10.1" y="189.9"/>
|
||||||
|
<waypoint name="2" x="132.3" y="139.1"/>
|
||||||
|
<waypoint name="MOB" x="137.0" y="-11.6"/>
|
||||||
|
<waypoint name="S1" x="-109.0" y="245.9"/>
|
||||||
|
<waypoint name="S2" x="274.4" y="209.5"/>
|
||||||
|
<waypoint name="S3" x="322.1" y="29.9"/>
|
||||||
|
<waypoint name="S4" x="0.8" y="-68.1"/>
|
||||||
|
<waypoint name="S5" x="-239.9" y="81.8"/>
|
||||||
|
<waypoint alt="215.0" name="AF" x="177.4" y="45.1"/>
|
||||||
|
<waypoint alt="185.0" name="TD" x="28.8" y="57.0"/>
|
||||||
|
<waypoint name="_BASELEG" x="168.8" y="-13.8"/>
|
||||||
|
<waypoint name="CLIMB" x="-114.5" y="162.3"/>
|
||||||
|
</waypoints>
|
||||||
|
|
||||||
|
<sectors>
|
||||||
|
<sector name="POLY_SURVEY" color="green">
|
||||||
|
<corner name="S1"/>
|
||||||
|
<corner name="S2"/>
|
||||||
|
<corner name="S3"/>
|
||||||
|
<corner name="S4"/>
|
||||||
|
<corner name="S5"/>
|
||||||
|
</sector>
|
||||||
|
</sectors>
|
||||||
|
|
||||||
|
<exceptions/>
|
||||||
|
<blocks>
|
||||||
|
<block name="Wait GPS">
|
||||||
|
<set value="1" var="kill_throttle"/>
|
||||||
|
<while cond="!GpsFixValid()"/>
|
||||||
|
</block>
|
||||||
|
<block name="Geo init">
|
||||||
|
<while cond="LessThan(NavBlockTime(), 10)"/>
|
||||||
|
<call fun="NavSetGroundReferenceHere()"/>
|
||||||
|
</block>
|
||||||
|
<block name="Holding point">
|
||||||
|
<set value="1" var="kill_throttle"/>
|
||||||
|
<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"/>
|
||||||
|
<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"/>
|
||||||
|
</block>
|
||||||
|
<block group="home" key="<Control>a" name="Standby" strip_button="Standby" strip_icon="home.png">
|
||||||
|
<circle radius="nav_radius" wp="STDBY"/>
|
||||||
|
</block>
|
||||||
|
<block group="base_pattern" key="F8" name="Figure 8 around wp 1" strip_button="Figure 8 (wp 1-2)" strip_icon="eight.png">
|
||||||
|
<eight center="1" radius="nav_radius" turn_around="2"/>
|
||||||
|
</block>
|
||||||
|
<block group="base_pattern" name="Oval 1-2" strip_button="Oval (wp 1-2)" strip_icon="oval.png">
|
||||||
|
<oval p1="1" p2="2" radius="nav_radius"/>
|
||||||
|
</block>
|
||||||
|
<block group="base_pattern" name="MOB" strip_button="Turn around here" strip_icon="mob.png">
|
||||||
|
<call fun="NavSetWaypointHere(WP_MOB)"/>
|
||||||
|
<set value="DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
||||||
|
<circle radius="nav_radius" wp="MOB"/>
|
||||||
|
</block>
|
||||||
|
<block group="extra_pattern" name="Line 1-2" strip_button="Line (wp 1-2)" strip_icon="line.png">
|
||||||
|
<call fun="nav_line_init()"/>
|
||||||
|
<call fun="nav_line(WP_1, WP_2, nav_radius)"/>
|
||||||
|
</block>
|
||||||
|
<block group="extra_pattern" name="Survey S1-S2" strip_button="Survey (wp S1-S2)" strip_icon="survey.png">
|
||||||
|
<survey_rectangle grid="150" wp1="S1" wp2="S2"/>
|
||||||
|
</block>
|
||||||
|
<block name="Poly Survey S1-S2" strip_button="Poly Survey">
|
||||||
|
<call fun="init_poly_survey_adv(WP_S1,5,0,30,10,50,100)"/>
|
||||||
|
<call fun="poly_survey_adv()"/>
|
||||||
|
</block>
|
||||||
|
<block group="extra_pattern" name="Path 1,2,S1,S2,STDBY" strip_button="Path (1,2,S1,S2,STDBY)" strip_icon="path.png">
|
||||||
|
<path wpts="1,2 S1"/>
|
||||||
|
<path approaching_time="1" pitch="auto" throttle="0.4" wpts="S1, S2 STDBY"/>
|
||||||
|
<deroute block="Standby"/>
|
||||||
|
</block>
|
||||||
|
<block group="land" name="Land Right AF-TD" strip_button="Land right (wp AF-TD)" strip_icon="land-right.png">
|
||||||
|
<set value="DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
||||||
|
<deroute block="land"/>
|
||||||
|
</block>
|
||||||
|
<block group="land" name="Land Left AF-TD" strip_button="Land left (wp AF-TD)" strip_icon="land-left.png">
|
||||||
|
<set value="-DEFAULT_CIRCLE_RADIUS" var="nav_radius"/>
|
||||||
|
<deroute block="land"/>
|
||||||
|
</block>
|
||||||
|
<block name="land">
|
||||||
|
<call 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="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"/>
|
||||||
|
</block>
|
||||||
|
<block name="flare">
|
||||||
|
<go approaching_time="0" from="AF" hmode="route" throttle="0.0" vmode="throttle" wp="TD"/>
|
||||||
|
<attitude roll="0.0" throttle="0.0" until="FALSE" vmode="throttle"/>
|
||||||
|
</block>
|
||||||
|
</blocks>
|
||||||
|
</flight_plan>
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
<!DOCTYPE module SYSTEM "module.dtd">
|
||||||
|
|
||||||
|
<module name="nav_survey_poly_adv" dir="nav">
|
||||||
|
<doc>
|
||||||
|
<description>
|
||||||
|
Advanced polygon survey for fixedwings from Uni Stuttgart.
|
||||||
|
In the flight plan, the survey blocks call init and run functions:
|
||||||
|
1- Initialize the variables needed for the survey to start, with init_poly_survey_adv(first_wp, size,angle, sweep_width, shot_dist, min_rad, altitude):
|
||||||
|
first_wp the first Waypoint of the polygon (WP_waypoint_name)
|
||||||
|
size the number of points that make up the polygon
|
||||||
|
angle angle in which to do the flyovers
|
||||||
|
sweep_width distance between the sweeps
|
||||||
|
shot_dist distance between the shots
|
||||||
|
min_rad minimal radius when navigating
|
||||||
|
altitude the altitude that must be reached before the flyover starts
|
||||||
|
2- Run the survey with poly_survey_adv()
|
||||||
|
Block example:
|
||||||
|
<!--<block name="Poly Survey" strip_button="Poly Survey">
|
||||||
|
<call fun="init_poly_survey_adv(first_wp,size,angle,sweep_width,shot_dist,min_rad,altitude)"/>
|
||||||
|
<call fun="poly_survey_adv()"/>
|
||||||
|
</block>-->
|
||||||
|
</description>
|
||||||
|
</doc>
|
||||||
|
<header>
|
||||||
|
<file name="nav_survey_poly_adv.h"/>
|
||||||
|
</header>
|
||||||
|
<makefile>
|
||||||
|
<file name="nav_survey_poly_adv.c"/>
|
||||||
|
</makefile>
|
||||||
|
</module>
|
||||||
+2
-2
@@ -20,13 +20,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file subsystems/navigation/poly_survey_adv.c
|
* @file modules/nav/nav_survey_poly_adv.c
|
||||||
*
|
*
|
||||||
* Advanced polygon survey for fixedwings from Uni Stuttgart.
|
* Advanced polygon survey for fixedwings from Uni Stuttgart.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "poly_survey_adv.h"
|
#include "nav_survey_poly_adv.h"
|
||||||
|
|
||||||
#include "subsystems/nav.h"
|
#include "subsystems/nav.h"
|
||||||
#include "state.h"
|
#include "state.h"
|
||||||
+1
-1
@@ -20,7 +20,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file subsystems/navigation/poly_survey_adv.h
|
* @file modules/nav/nav_survey_poly_adv.h
|
||||||
*
|
*
|
||||||
* Advanced polygon survey for fixedwings from Uni Stuttgart.
|
* Advanced polygon survey for fixedwings from Uni Stuttgart.
|
||||||
*
|
*
|
||||||
Reference in New Issue
Block a user