Skip to content

Commit

Permalink
[modules] nav_survey_poly_osam: sweep improvements
Browse files Browse the repository at this point in the history
Added half U-turn even if not sweepback
Some modification to change sweep distance and number of points using telemetry parametrers
option to use default 1/2 sweep distance for start line or using alternative 1/32 sweep start

Its is very useful when using poligon survey osam for photogrametry

closes #938
  • Loading branch information
agressiva authored and flixr committed Dec 14, 2014
1 parent d148a18 commit 918fc95
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 53 deletions.
19 changes: 9 additions & 10 deletions conf/flight_plans/nav_modules.xml
Expand Up @@ -3,17 +3,17 @@
<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/datalink/datalink.h"

#include "modules/digital_cam/dc.h"
#define LINE_START_FUNCTION dc_Survey(40);
#define LINE_STOP_FUNCTION dc_autoshoot = DC_AUTOSHOOT_STOP;
</header>
</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_angle" x="156.2" y="222.2"/>
<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"/>
Expand All @@ -24,17 +24,15 @@
<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">
<sector color="green" name="POLY_SURVEY">
<corner name="S1"/>
<corner name="S2"/>
<corner name="S3"/>
<corner name="S4"/>
<corner name="S5"/>
</sector>
</sectors>

<exceptions/>
<blocks>
<block name="Wait GPS">
Expand Down Expand Up @@ -76,7 +74,6 @@
<block group="extra_pattern" name="Survey S1-S3" strip_button="Survey (wp S1-S3)" strip_icon="survey.png">
<survey_rectangle grid="150" wp1="S1" wp2="S3"/>
</block>
<!--===================== Nav modules example blocks =================================-->
<block name="Bungee take-off">
<call fun="nav_bungee_takeoff_setup(WP_HOME)"/>
<call fun="nav_bungee_takeoff_run()"/>
Expand All @@ -90,7 +87,7 @@
<call fun="nav_line_border_run(WP_1, WP_2, nav_radius)"/>
</block>
<block group="nav_pattern" name="Smooth nav (wp 1-2)" strip_button="Smooth nav">
<set var="snav_desired_tow" value="gps.tow / 1000. + 60."/>
<set value="gps.tow / 1000. + 60." var="snav_desired_tow"/>
<call fun="snav_init(WP_1, M_PI_2-atan2(WaypointY(WP_2)-WaypointY(WP_1),WaypointX(WP_2)-WaypointX(WP_1)), DEFAULT_CIRCLE_RADIUS/2.)"/>
<call fun="snav_circle1()"/>
<call fun="snav_route()"/>
Expand All @@ -104,7 +101,11 @@
<call fun="nav_flower_run()"/>
</block>
<block name="Poly survey osam">
<call fun="nav_survey_poly_osam_setup(WP_S1, 5, 100, 45)"/>
<call fun="nav_survey_poly_osam_setup(WP_S1, 5, 100, -5)"/>
<call fun="nav_survey_poly_osam_run()"/>
</block>
<block name="Poly survey osam dynamic">
<call fun="nav_survey_poly_osam_setup_towards(WP_S1, 0, 0, WP_S1_angle)"/>
<call fun="nav_survey_poly_osam_run()"/>
</block>
<block name="ZamboniSurvey">
Expand All @@ -122,8 +123,6 @@
<call fun="nav_spiral_setup(WP_S1, WP_S2, 30, 10, 3)"/>
<call fun="nav_spiral_run()"/>
</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"/>
Expand Down
21 changes: 20 additions & 1 deletion conf/modules/nav_survey_poly_osam.xml
Expand Up @@ -3,9 +3,28 @@
<module name="nav_survey_poly" dir="nav">
<doc>
<description>
Polygon survey from OSAM
Polygon survey from OSAM.
You can use:
* nav_survey_poly_osam_setup function for static definitions or
* nav_survey_poly_osam_setup_towards for a more flexible setup
</description>
<define name="POLY_OSAM_POLYGONSIZE" value="10" description="max waypoints usable in polygon survey"/>
<define name="POLY_OSAM_ENTRY_RADIUS" value="0" description="entry circle radius in meters. If 0 radius equal to half sweep"/>
<define name="POLY_OSAM_DEFAULT_SIZE" value="5" description="default number of waypoints/corners used in polygon survey. Can be changed by telemetry"/>
<define name="POLY_OSAM_DEFAULT_SWEEP" value="120" description="default distance in m between lines. Can be changed by telemetry"/>
<define name="POLY_OSAM_MIN_RADIUS" value="30" description="min radius used in U-turns"/>
<define name="POLY_OSAM_FIRST_SWEEP_DISTANCE" value="4" description="distante between the polygon border and first line.If 0 the distance well be equal to half sweep"/>
</doc>

<settings>
<dl_settings>
<dl_settings NAME="P_Survey">
<dl_setting min="0" max="20" step="1" var="Poly_Size" type="uint8_t" shortname="Size" module="modules/nav/nav_survey_poly_osam"/>
<dl_setting min="0" max="500" step="1" var="Poly_Sweep" type="float" shortname="Sweep" module="modules/nav/nav_survey_poly_osam"/>
</dl_settings>
</dl_settings>
</settings>

<header>
<file name="nav_survey_poly_osam.h"/>
</header>
Expand Down

0 comments on commit 918fc95

Please sign in to comment.