Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
orange_avoider.c File Reference
#include "modules/orange_avoider/orange_avoider.h"
#include "modules/computer_vision/colorfilter.h"
#include "firmwares/rotorcraft/navigation.h"
#include "state.h"
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
+ Include dependency graph for orange_avoider.c:

Go to the source code of this file.

Functions

void orange_avoider_init ()
 
void orange_avoider_periodic ()
 
uint8_t increase_nav_heading (int32_t *heading, int32_t increment)
 Increases the NAV heading. More...
 
uint8_t moveWaypointForwards (uint8_t waypoint, float distanceMeters)
 
uint8_t chooseRandomIncrementAvoidance ()
 

Variables

uint8_t safeToGoForwards = false
 
int tresholdColorCount = 200
 
int32_t incrementForAvoidance
 

Detailed Description

Author
Roland Meertens Example on how to use the colours detected to avoid orange pole in the cyberzoo

Definition in file orange_avoider.c.

Function Documentation

uint8_t chooseRandomIncrementAvoidance ( void  )

Definition at line 78 of file orange_avoider.c.

References incrementForAvoidance.

Referenced by orange_avoider_init().

+ Here is the caller graph for this function:

uint8_t increase_nav_heading ( int32_t heading,
int32_t  increment 
)

Increases the NAV heading.

Assumes heading is an INT32_ANGLE. It is bound in this function.

Definition at line 51 of file orange_avoider.c.

uint8_t moveWaypointForwards ( uint8_t  waypoint,
float  distanceMeters 
)

Definition at line 58 of file orange_avoider.c.

References ANGLE_FLOAT_OF_BFP, nav_heading, POS_BFP_OF_REAL, stateGetPositionEnu_i(), waypoint_set_xy_i(), EnuCoor_i::x, EnuCoor_i::y, and EnuCoor_i::z.

+ Here is the call graph for this function:

void orange_avoider_init ( void  )

Definition at line 25 of file orange_avoider.c.

References chooseRandomIncrementAvoidance(), color_cb_max, color_cb_min, color_cr_max, color_cr_min, color_lum_max, and color_lum_min.

+ Here is the call graph for this function:

void orange_avoider_periodic ( void  )

Definition at line 38 of file orange_avoider.c.

References color_count, safeToGoForwards, and tresholdColorCount.

Variable Documentation

int32_t incrementForAvoidance

Definition at line 23 of file orange_avoider.c.

Referenced by chooseRandomIncrementAvoidance().

uint8_t safeToGoForwards = false

Definition at line 21 of file orange_avoider.c.

Referenced by orange_avoider_periodic().

int tresholdColorCount = 200

Definition at line 22 of file orange_avoider.c.

Referenced by orange_avoider_periodic().