31 #ifndef RECTANGLE_SURVEY_DEFAULT_SWEEP
32 #define RECTANGLE_SURVEY_DEFAULT_SWEEP 25
35 #ifdef RECTANGLE_SURVEY_USE_INTERLEAVE
36 #define USE_INTERLEAVE TRUE
38 #define USE_INTERLEAVE FALSE
45 #if PERIODIC_TELEMETRY
70 #define SurveyGoingNorth() ((survey_orientation == NS) && (survey_to.y > survey_from.y))
71 #define SurveyGoingSouth() ((survey_orientation == NS) && (survey_to.y < survey_from.y))
72 #define SurveyGoingEast() ((survey_orientation == WE) && (survey_to.x > survey_from.x))
73 #define SurveyGoingWest() ((survey_orientation == WE) && (survey_to.x < survey_from.x))
75 #include "generated/flight_plan.h"
77 #ifndef LINE_START_FUNCTION
78 #define LINE_START_FUNCTION {}
80 #ifndef LINE_STOP_FUNCTION
81 #define LINE_STOP_FUNCTION {}
87 pprz_msg_send_SURVEY(trans, dev, AC_ID,
88 &nav_survey_east, &nav_survey_north, &nav_survey_west, &nav_survey_south);
94 #if PERIODIC_TELEMETRY
106 survey_orientation = so;
108 if (survey_orientation ==
NS) {
139 nav_survey_shift = grid;
149 if (survey_orientation ==
NS) {
160 static bool_t is_last_half =
FALSE;
161 static float survey_radius;
210 if (survey_orientation ==
NS) {
213 if ((x0 + nav_survey_shift < nav_survey_west)
214 || (x0 + nav_survey_shift > nav_survey_east)) {
215 if (((x0 + (nav_survey_shift / 2)) < nav_survey_west)
216 || ((x0 + (nav_survey_shift / 2)) > nav_survey_east)) {
222 survey_radius = nav_survey_shift /2.;
224 is_last_half =
FALSE;
228 survey_radius = nav_survey_shift /2.;
235 survey_radius = nav_survey_shift / 2.;
242 x0 = x0 + survey_radius;
256 survey_radius = -survey_radius;
262 if (my_y0 + nav_survey_shift < nav_survey_south
263 || my_y0 + nav_survey_shift > nav_survey_north) {
264 if (((my_y0 + (nav_survey_shift / 2)) < nav_survey_south)
265 || ((my_y0 + (nav_survey_shift / 2)) > nav_survey_north)) {
271 survey_radius = nav_survey_shift /2.;
273 is_last_half =
FALSE;
277 survey_radius = nav_survey_shift /2.;
284 survey_radius = nav_survey_shift / 2.;
291 my_y0 = my_y0 + survey_radius;
305 survey_radius = -survey_radius;
314 if (survey_orientation ==
NS) {
320 double fract = modf (temp , &inteiro);
329 if (survey_orientation ==
WE) {
345 if (survey_orientation ==
WE) {
358 if (survey_orientation ==
WE) {
bool_t nav_survey_rectangle_rotorcraft_setup(uint8_t wp1, uint8_t wp2, float grid, survey_orientation_t so)
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
uint16_t rectangle_survey_sweep_num
bool_t nav_approaching_from(struct EnuCoor_i *wp, struct EnuCoor_i *from, int16_t approaching_time)
Proximity tests on approaching a wp.
bool_t nav_set_heading_deg(float deg)
Set nav_heading in degrees.
#define LINE_STOP_FUNCTION
Generic transmission transport header.
Rotorcraft navigation functions.
Periodic telemetry system header (includes downlink utility and generated code).
vector in East North Up coordinates Units: meters
void nav_route(struct EnuCoor_i *wp_start, struct EnuCoor_i *wp_end)
#define VECT3_COPY(_a, _b)
#define SurveyGoingWest()
struct EnuCoor_i navigation_target
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
#define SurveyGoingNorth()
Automatic survey of a rectangle for rotorcraft.
void nav_survey_rectangle_rotorcraft_init(void)
#define NavVerticalAltitudeMode(_alt, _pre_climb)
Set the vertical mode to altitude control with the specified altitude setpoint and climb pre-command...
static survey_orientation_t survey_orientation
#define DefaultPeriodic
Set default periodic telemetry.
#define HORIZONTAL_MODE_ROUTE
bool_t nav_survey_rectangle_rotorcraft_run(uint8_t wp1, uint8_t wp2)
#define LINE_START_FUNCTION
#define SurveyGoingSouth()
#define RECTANGLE_SURVEY_DEFAULT_SWEEP
static const struct usb_device_descriptor dev
void dc_send_command(uint8_t cmd)
Send Command To Camera.
static struct EnuCoor_f survey_from survey_to
vector in East North Up coordinates
API to get/set the generic vehicle states.
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
Common code for AP and FBW telemetry.
#define ENU_BFP_OF_REAL(_o, _i)
static struct point survey_from
static struct EnuCoor_i survey_from_i survey_to_i
float dc_distance_interval
AutoShoot photos on distance to last shot in meters.
static bool_t survey_uturn
static bool_t nav_survey_rectangle_active
static void send_survey(struct transport_tx *trans, struct link_device *dev)
#define SurveyGoingEast()
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.