20 #include "generated/flight_plan.h"
22 #ifndef STEREOCAM_FOLLOW_ME_USE_OPTITRACK
23 #define STEREOCAM_FOLLOW_ME_USE_OPTITRACK FALSE
26 #define HEADING_CHANGE_PER_MEASUREMENT 260
27 #define CENTER_IMAGE_HOR 65
28 #define MAXIMUM_ALTITUDE_FOLLOWING 3.0
29 #define MINIMUM_ALTITUDE_FOLLOWING 1.0
37 static const int amountOfRollPhaseTime = 15;
38 static const int amountOfYawPhaseTime = 15;
42 if (*isRollPhaseArg) {
43 if (*phaseCounterArg > amountOfRollPhaseTime) {
49 if (*phaseCounterArg > amountOfYawPhaseTime) {
59 *heading = *heading + increment;
64 static int phaseCounter=0, isRollPhase=0, isYawPhase=0;
65 static float heightGain=0.3;
72 float heading_change = 0.0;
76 heading_change = 0.25;
81 heading_change = -0.25;
102 if (heightObject > 50) {
104 }
else if (heightObject < 20) {
118 #if STEREOCAM_FOLLOW_ME_USE_OPTITRACK
123 if (distanceToObject < 35) {
125 }
else if (distanceToObject < 60) {
Rotorcraft navigation functions.
#define MINIMUM_ALTITUDE_FOLLOWING
Periodic telemetry system header (includes downlink utility and generated code).
void waypoint_set_alt(uint8_t wp_id, float alt)
Set altitude of waypoint in meters (above reference)
static void changeRollYawPhase(int *phaseCounterArg, int *isRollPhaseArg, int *isYawPhaseArg)
#define HEADING_CHANGE_PER_MEASUREMENT
static void increase_nav_heading(int32_t *heading, int32_t increment)
bool nav_is_in_flight(void)
#define MAXIMUM_ALTITUDE_FOLLOWING
API to get/set the generic vehicle states.
void follow_me(uint8_t headingToFollow, uint8_t heightObject, uint8_t distanceToObject)
#define STEREOCAM_FOLLOW_ME_USE_OPTITRACK
int32_t nav_heading
with INT32_ANGLE_FRAC