Digital camera shots on a 100m UTM grid

This commit is contained in:
Pascal Brisset
2008-07-21 17:13:05 +00:00
parent b31e80eb33
commit ae8133fae5
4 changed files with 17 additions and 2 deletions
+2 -2
View File
@@ -4,6 +4,7 @@
<header>
#include "nav_line.h"
#include "datalink.h"
#include "dc.h"
</header>
<waypoints>
<waypoint name="HOME" x="0" y="0"/>
@@ -18,7 +19,6 @@
<waypoint name="_BASELEG" x="168.8" y="-13.8"/>
<waypoint name="CLIMB" x="-129.9" y="54.6"/>
</waypoints>
<exceptions/>
<blocks>
<block name="Wait GPS">
<set value="1" var="kill_throttle"/>
@@ -57,7 +57,7 @@
<call fun="nav_line_init()"/>
<call fun="nav_line(WP_1, WP_2, nav_radius)"/>
</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" pre_call="dc_shot_on_utm_north_close_to_100m_grid()">
<survey_rectangle grid="150" wp1="S1" wp2="S2"/>
</block>
<block name="Survey E-W" strip_button="Survey E-W">
+1
View File
@@ -10,6 +10,7 @@
<strip_button name="Zoom" icon="zoom.png" value="1"/>
</dl_setting>
<dl_setting MAX="60" MIN="0" STEP="1" VAR="dc_periodic_shutter" module="dc" handler="Periodic" shortname="Periodic"/>
<dl_setting MAX="5" MIN="0" STEP="1" VAR="dc_utm_threshold" shortname="UTM%"/>
</dl_settings>
</dl_settings>
</settings>
+1
View File
@@ -3,3 +3,4 @@
uint8_t dc_timer;
uint8_t dc_periodic_shutter;
uint8_t dc_shutter_timer;
uint8_t dc_utm_threshold;
+13
View File
@@ -18,6 +18,10 @@ extern uint8_t dc_periodic_shutter;
extern uint8_t dc_shutter_timer;
/* In s. Related counter */
extern uint8_t dc_utm_threshold;
/* In m. If non zero, automatic shots when greater than utm_north % 100 */
#define SHUTTER_DELAY 2 /* 4Hz -> 0.5s */
@@ -42,6 +46,7 @@ static inline uint8_t dc_zoom( void ) {
#define dc_Zoom(_) { dc_zoom(); }
#define dc_Periodic(s) { dc_periodic_shutter = s; dc_shutter_timer = s; }
#define dc_init() { /* initialized as leds */ dc_periodic_shutter = 0; } /* Output */
/* 4Hz */
@@ -66,4 +71,12 @@ static inline void dc_periodic( void ) {
}
}
static inline void dc_shot_on_utm_north_close_to_100m_grid( void ) {
if (dc_utm_threshold && !dc_timer) {
uint32_t dist_to_100m_grid = (gps_utm_north) / 100 % 100;
if (dist_to_100m_grid < dc_utm_threshold || 100 - dist_to_100m_grid < dc_utm_threshold)
dc_shutter();
}
}
#endif // DC_H