Paparazzi UAS
v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
|
#include "modules/orange_avoider/orange_avoider.h"
#include "modules/computer_vision/colorfilter.h"
#include "firmwares/rotorcraft/navigation.h"
#include "generated/flight_plan.h"
#include "generated/airframe.h"
#include "state.h"
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
Go to the source code of this file.
Macros | |
#define | ORANGE_AVOIDER_VERBOSE TRUE |
#define | PRINT(string,...) fprintf(stderr, "[orange_avoider->%s()] " string,__FUNCTION__ , ##__VA_ARGS__) |
#define | VERBOSE_PRINT(...) |
#define | ORANGE_AVOIDER_LUM_MIN 41 |
#define | ORANGE_AVOIDER_LUM_MAX 183 |
#define | ORANGE_AVOIDER_CB_MIN 53 |
#define | ORANGE_AVOIDER_CB_MAX 121 |
#define | ORANGE_AVOIDER_CR_MIN 134 |
#define | ORANGE_AVOIDER_CR_MAX 249 |
Functions | |
void | orange_avoider_init () |
void | orange_avoider_periodic () |
uint8_t | increase_nav_heading (int32_t *heading, float incrementDegrees) |
static uint8_t | calculateForwards (struct EnuCoor_i *new_coor, float distanceMeters) |
uint8_t | moveWaypoint (uint8_t waypoint, struct EnuCoor_i *new_coor) |
uint8_t | moveWaypointForward (uint8_t waypoint, float distanceMeters) |
uint8_t | chooseRandomIncrementAvoidance () |
Variables | |
uint8_t | safeToGoForwards = false |
int | tresholdColorCount = 0.05 * 124800 |
float | incrementForAvoidance |
uint16_t | trajectoryConfidence = 1 |
float | maxDistance = 2.25 |
Definition in file orange_avoider.c.
#define ORANGE_AVOIDER_CB_MAX 121 |
Definition at line 47 of file orange_avoider.c.
Referenced by orange_avoider_init().
#define ORANGE_AVOIDER_CB_MIN 53 |
Definition at line 43 of file orange_avoider.c.
Referenced by orange_avoider_init().
#define ORANGE_AVOIDER_CR_MAX 249 |
Definition at line 55 of file orange_avoider.c.
Referenced by orange_avoider_init().
#define ORANGE_AVOIDER_CR_MIN 134 |
Definition at line 51 of file orange_avoider.c.
Referenced by orange_avoider_init().
#define ORANGE_AVOIDER_LUM_MAX 183 |
Definition at line 39 of file orange_avoider.c.
Referenced by orange_avoider_init().
#define ORANGE_AVOIDER_LUM_MIN 41 |
Definition at line 35 of file orange_avoider.c.
Referenced by orange_avoider_init().
#define ORANGE_AVOIDER_VERBOSE TRUE |
Definition at line 25 of file orange_avoider.c.
#define PRINT | ( | string, | |
... | |||
) | fprintf(stderr, "[orange_avoider->%s()] " string,__FUNCTION__ , ##__VA_ARGS__) |
Definition at line 27 of file orange_avoider.c.
#define VERBOSE_PRINT | ( | ... | ) |
Definition at line 31 of file orange_avoider.c.
Referenced by calculateForwards(), chooseRandomIncrementAvoidance(), increase_nav_heading(), moveWaypoint(), and orange_avoider_periodic().
Definition at line 128 of file orange_avoider.c.
References ANGLE_FLOAT_OF_BFP, POS_BFP_OF_REAL, POS_FLOAT_OF_BFP, Int32Eulers::psi, stateGetNedToBodyEulers_i(), stateGetPositionEnu_i(), VERBOSE_PRINT, EnuCoor_i::x, and EnuCoor_i::y.
Referenced by moveWaypointForward().
uint8_t chooseRandomIncrementAvoidance | ( | void | ) |
Definition at line 169 of file orange_avoider.c.
References incrementForAvoidance, and VERBOSE_PRINT.
Referenced by orange_avoider_init(), and orange_avoider_periodic().
Definition at line 114 of file orange_avoider.c.
References ANGLE_BFP_OF_REAL, ANGLE_FLOAT_OF_BFP, INT32_ANGLE_NORMALIZE, Int32Eulers::psi, stateGetNedToBodyEulers_i(), and VERBOSE_PRINT.
Referenced by orange_avoider_periodic().
Definition at line 147 of file orange_avoider.c.
References POS_FLOAT_OF_BFP, VERBOSE_PRINT, waypoint_set_xy_i(), EnuCoor_i::x, and EnuCoor_i::y.
Referenced by moveWaypointForward().
Definition at line 158 of file orange_avoider.c.
References calculateForwards(), and moveWaypoint().
Referenced by orange_avoider_periodic().
void orange_avoider_init | ( | void | ) |
Definition at line 68 of file orange_avoider.c.
References chooseRandomIncrementAvoidance(), color_cb_max, color_cb_min, color_cr_max, color_cr_min, color_lum_max, color_lum_min, ORANGE_AVOIDER_CB_MAX, ORANGE_AVOIDER_CB_MIN, ORANGE_AVOIDER_CR_MAX, ORANGE_AVOIDER_CR_MIN, ORANGE_AVOIDER_LUM_MAX, and ORANGE_AVOIDER_LUM_MIN.
void orange_avoider_periodic | ( | void | ) |
Definition at line 85 of file orange_avoider.c.
References chooseRandomIncrementAvoidance(), color_count, increase_nav_heading(), incrementForAvoidance, maxDistance, moveWaypointForward(), nav_heading, nav_set_heading_towards_waypoint(), safeToGoForwards, trajectoryConfidence, tresholdColorCount, VERBOSE_PRINT, and waypoint_set_here_2d().
float incrementForAvoidance |
Definition at line 61 of file orange_avoider.c.
Referenced by chooseRandomIncrementAvoidance(), and orange_avoider_periodic().
float maxDistance = 2.25 |
Definition at line 63 of file orange_avoider.c.
Referenced by orange_avoider_periodic().
Definition at line 59 of file orange_avoider.c.
Referenced by orange_avoider_periodic().
uint16_t trajectoryConfidence = 1 |
Definition at line 62 of file orange_avoider.c.
Referenced by orange_avoider_periodic().
int tresholdColorCount = 0.05 * 124800 |
Definition at line 60 of file orange_avoider.c.
Referenced by orange_avoider_periodic().