18 #include "navigation.h"
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 0.063f
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) {
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) {
void waypoint_set_alt(uint8_t wp_id, float alt)
Set altitude of waypoint in meters (above reference)
bool nav_is_in_flight(void)
struct RotorcraftNavigation nav
float heading
heading setpoint (in radians)
API to get/set the generic vehicle states.
#define MAXIMUM_ALTITUDE_FOLLOWING
#define MINIMUM_ALTITUDE_FOLLOWING
#define STEREOCAM_FOLLOW_ME_USE_OPTITRACK
static void increase_nav_heading(float *heading, float increment)
static void changeRollYawPhase(int *phaseCounterArg, int *isRollPhaseArg, int *isYawPhaseArg)
void follow_me(uint8_t headingToFollow, uint8_t heightObject, uint8_t distanceToObject)
#define HEADING_CHANGE_PER_MEASUREMENT
Periodic telemetry system header (includes downlink utility and generated code).
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.