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
42 #include "pprzlink/messages.h"
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) {
159 static bool is_last_half =
false;
160 static float survey_radius;
209 if (survey_orientation ==
NS) {
212 if ((x0 + nav_survey_shift < nav_survey_west)
213 || (x0 + nav_survey_shift > nav_survey_east)) {
214 if (((x0 + (nav_survey_shift / 2)) < nav_survey_west)
215 || ((x0 + (nav_survey_shift / 2)) > nav_survey_east)) {
221 survey_radius = nav_survey_shift /2.;
223 is_last_half =
false;
227 survey_radius = nav_survey_shift /2.;
234 survey_radius = nav_survey_shift / 2.;
241 x0 = x0 + survey_radius;
255 survey_radius = -survey_radius;
261 if (my_y0 + nav_survey_shift < nav_survey_south
262 || my_y0 + nav_survey_shift > nav_survey_north) {
263 if (((my_y0 + (nav_survey_shift / 2)) < nav_survey_south)
264 || ((my_y0 + (nav_survey_shift / 2)) > nav_survey_north)) {
270 survey_radius = nav_survey_shift /2.;
272 is_last_half =
false;
276 survey_radius = nav_survey_shift /2.;
283 survey_radius = nav_survey_shift / 2.;
290 my_y0 = my_y0 + survey_radius;
304 survey_radius = -survey_radius;
313 if (survey_orientation ==
NS) {
319 double fract = modf (temp , &inteiro);
328 if (survey_orientation ==
WE) {
344 if (survey_orientation ==
WE) {
357 if (survey_orientation ==
WE) {
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
uint16_t rectangle_survey_sweep_num
#define LINE_STOP_FUNCTION
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).
bool nav_survey_rectangle_rotorcraft_run(uint8_t wp1, uint8_t wp2)
#define SurveyGoingNorth()
static bool nav_survey_rectangle_active
Automatic survey of a rectangle for rotorcraft.
void nav_survey_rectangle_rotorcraft_init(void)
bool nav_approaching_from(struct EnuCoor_i *wp, struct EnuCoor_i *from, int16_t approaching_time)
Proximity tests on approaching a wp.
#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
#define LINE_START_FUNCTION
#define SurveyGoingSouth()
void nav_survey_rectangle_rotorcraft_setup(uint8_t wp1, uint8_t wp2, float grid, survey_orientation_t so)
#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 void send_survey(struct transport_tx *trans, struct link_device *dev)
void nav_set_heading_deg(float deg)
Set nav_heading in degrees.
#define SurveyGoingEast()
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.