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
54 #ifndef RECTANGLE_SURVEY_HEADING_NS
55 #define RECTANGLE_SURVEY_HEADING_NS 0.f
58 #ifndef RECTANGLE_SURVEY_HEADING_WE
59 #define RECTANGLE_SURVEY_HEADING_WE 90.f
78 #define SurveyGoingNorth() ((survey_orientation == NS) && (survey_to.y > survey_from.y))
79 #define SurveyGoingSouth() ((survey_orientation == NS) && (survey_to.y < survey_from.y))
80 #define SurveyGoingEast() ((survey_orientation == WE) && (survey_to.x > survey_from.x))
81 #define SurveyGoingWest() ((survey_orientation == WE) && (survey_to.x < survey_from.x))
83 #include "generated/flight_plan.h"
85 #ifndef LINE_START_FUNCTION
86 #define LINE_START_FUNCTION {}
88 #ifndef LINE_STOP_FUNCTION
89 #define LINE_STOP_FUNCTION {}
95 pprz_msg_send_SURVEY(trans,
dev, AC_ID,
103 #if PERIODIC_TELEMETRY
172 #ifdef NAV_SURVEY_RECTANGLE_DYNAMIC
176 static bool is_last_half =
false;
177 static float survey_radius;
235 is_last_half =
false;
253 x0 = x0 + survey_radius;
267 survey_radius = -survey_radius;
284 is_last_half =
false;
302 my_y0 = my_y0 + survey_radius;
316 survey_radius = -survey_radius;
331 double fract = modf (temp , &inteiro);
342 turn_from.
y =
waypoints[0].enu_f.
y - survey_radius;
345 turn_from.
x =
waypoints[0].enu_f.
x - survey_radius;
void dc_send_command(uint8_t cmd)
Send Command To Camera.
struct point waypoints[NB_WAYPOINT]
size == nb_waypoint, waypoint 0 is a dummy waypoint
float dc_distance_interval
AutoShoot photos on distance to last shot in meters.
Common code for AP and FBW telemetry.
#define VECT3_COPY(_a, _b)
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
#define NavVerticalAltitudeMode(_alt, _pre_climb)
Set the vertical mode to altitude control with the specified altitude setpoint and climb pre-command.
static struct point survey_from
void nav_survey_rectangle_rotorcraft_setup(uint8_t wp1, uint8_t wp2, float grid, survey_orientation_t so)
#define RECTANGLE_SURVEY_DEFAULT_SWEEP
uint16_t rectangle_survey_sweep_num
#define LINE_STOP_FUNCTION
static void send_survey(struct transport_tx *trans, struct link_device *dev)
static survey_orientation_t survey_orientation
#define RECTANGLE_SURVEY_HEADING_WE
static struct EnuCoor_f survey_from survey_to
void nav_survey_rectangle_rotorcraft_init(void)
#define SurveyGoingNorth()
static bool nav_survey_rectangle_active
bool nav_survey_rectangle_rotorcraft_run(uint8_t wp1, uint8_t wp2)
#define LINE_START_FUNCTION
#define SurveyGoingEast()
#define SurveyGoingWest()
static bool nav_survey_send
#define SurveyGoingSouth()
#define RECTANGLE_SURVEY_HEADING_NS
Automatic survey of a rectangle for rotorcraft.
vector in East North Up coordinates Units: meters
struct RotorcraftNavigation nav
void nav_set_heading_deg(float deg)
Set nav_heading in degrees.
Rotorcraft navigation functions.
#define NAV_HORIZONTAL_MODE_ROUTE
navigation_approaching nav_approaching
navigation_route nav_route
struct EnuCoor_f target
final target position (in meters)
API to get/set the generic vehicle states.
static const struct usb_device_descriptor dev
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.