16 #include "generated/flight_plan.h"
17 #include "generated/airframe.h"
25 #define ORANGE_AVOIDER_VERBOSE TRUE
27 #define PRINT(string,...) fprintf(stderr, "[orange_avoider->%s()] " string,__FUNCTION__ , ##__VA_ARGS__)
28 #if ORANGE_AVOIDER_VERBOSE
29 #define VERBOSE_PRINT PRINT
31 #define VERBOSE_PRINT(...)
34 #ifndef ORANGE_AVOIDER_LUM_MIN
35 #define ORANGE_AVOIDER_LUM_MIN 41
38 #ifndef ORANGE_AVOIDER_LUM_MAX
39 #define ORANGE_AVOIDER_LUM_MAX 183
42 #ifndef ORANGE_AVOIDER_CB_MIN
43 #define ORANGE_AVOIDER_CB_MIN 53
46 #ifndef ORANGE_AVOIDER_CB_MAX
47 #define ORANGE_AVOIDER_CB_MAX 121
50 #ifndef ORANGE_AVOIDER_CR_MIN
51 #define ORANGE_AVOIDER_CR_MIN 134
54 #ifndef ORANGE_AVOIDER_CR_MAX
55 #define ORANGE_AVOIDER_CR_MAX 249
120 *heading = newHeading;
138 VERBOSE_PRINT(
"Calculated %f m forward position. x: %f y: %f based on pos(%f, %f) and heading(%f)\n", distanceMeters,
int32_t psi
in rad with INT32_ANGLE_FRAC
#define ORANGE_AVOIDER_CB_MIN
void orange_avoider_init()
#define ORANGE_AVOIDER_LUM_MAX
uint8_t increase_nav_heading(int32_t *heading, float incrementDegrees)
#define POS_BFP_OF_REAL(_af)
#define ORANGE_AVOIDER_CB_MAX
uint8_t moveWaypointForward(uint8_t waypoint, float distanceMeters)
uint8_t chooseRandomIncrementAvoidance()
#define ANGLE_FLOAT_OF_BFP(_ai)
static uint8_t calculateForwards(struct EnuCoor_i *new_coor, float distanceMeters)
void waypoint_set_xy_i(uint8_t wp_id, int32_t x, int32_t y)
Set only local XY coordinates of waypoint without update altitude.
int32_t nav_heading
with INT32_ANGLE_FRAC
#define VERBOSE_PRINT(...)
#define INT32_ANGLE_NORMALIZE(_a)
#define ORANGE_AVOIDER_CR_MIN
float incrementForAvoidance
#define ANGLE_BFP_OF_REAL(_af)
Rotorcraft navigation functions.
vector in East North Up coordinates
API to get/set the generic vehicle states.
uint8_t moveWaypoint(uint8_t waypoint, struct EnuCoor_i *new_coor)
void orange_avoider_periodic()
#define ORANGE_AVOIDER_LUM_MIN
#define ORANGE_AVOIDER_CR_MAX
void waypoint_set_here_2d(uint8_t wp_id)
set waypoint to current horizontal location without modifying altitude
void nav_set_heading_towards_waypoint(uint8_t wp)
Set heading in the direction of a waypoint.
#define POS_FLOAT_OF_BFP(_ai)
static struct EnuCoor_i * stateGetPositionEnu_i(void)
Get position in local ENU coordinates (int).
static struct Int32Eulers * stateGetNedToBodyEulers_i(void)
Get vehicle body attitude euler angles (int).
uint16_t trajectoryConfidence