30#include "generated/airframe.h"
36#define ORANGE_AVOIDER_VERBOSE TRUE
38#define PRINT(string,...) fprintf(stderr, "[orange_avoider_guided->%s()] " string,__FUNCTION__ , ##__VA_ARGS__)
39#if ORANGE_AVOIDER_VERBOSE
40#define VERBOSE_PRINT PRINT
42#define VERBOSE_PRINT(...)
73#ifndef ORANGE_AVOIDER_VISUAL_DETECTION_ID
74#error This module requires two color filters, as such you have to define ORANGE_AVOIDER_VISUAL_DETECTION_ID to the orange filter
75#error Please define ORANGE_AVOIDER_VISUAL_DETECTION_ID to be COLOR_OBJECT_DETECTION1_ID or COLOR_OBJECT_DETECTION2_ID in your airframe
79 int16_t __attribute__((unused)) pixel_x,
int16_t __attribute__((unused)) pixel_y,
80 int16_t __attribute__((unused)) pixel_width,
int16_t __attribute__((unused)) pixel_height,
86#ifndef FLOOR_VISUAL_DETECTION_ID
87#error This module requires two color filters, as such you have to define FLOOR_VISUAL_DETECTION_ID to the orange filter
88#error Please define FLOOR_VISUAL_DETECTION_ID to be COLOR_OBJECT_DETECTION1_ID or COLOR_OBJECT_DETECTION2_ID in your airframe
93 int16_t __attribute__((unused)) pixel_width,
int16_t __attribute__((unused)) pixel_height,
157 if (
floor_count < floor_count_threshold || fabsf(floor_centroid_frac) > 0.12){
223 if (rand() % 2 == 0) {
Main include for ABI (AirBorneInterface).
struct abi_struct abi_event
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
struct FloatVect3 speed_sp
static void color_detection_cb(uint8_t sender_id, int16_t pixel_x, int16_t pixel_y, int16_t pixel_width, int16_t pixel_height, int32_t quality, int16_t extra)
static abi_event color_detection_ev
int16_t obstacle_free_confidence
const int16_t max_trajectory_confidence
#define ORANGE_AVOIDER_VISUAL_DETECTION_ID
@ SEARCH_FOR_SAFE_HEADING
static void color_detection_cb(uint8_t sender_id, int16_t pixel_x, int16_t pixel_y, int16_t pixel_width, int16_t pixel_height, int32_t quality, int16_t extra)
#define VERBOSE_PRINT(...)
uint8_t chooseRandomIncrementAvoidance(void)
static void floor_detection_cb(uint8_t sender_id, int16_t pixel_x, int16_t pixel_y, int16_t pixel_width, int16_t pixel_height, int32_t quality, int16_t extra)
void orange_avoider_guided_periodic(void)
float oag_floor_count_frac
float avoidance_heading_direction
static abi_event floor_detection_ev
void orange_avoider_guided_retreat(void)
float oag_color_count_frac
void orange_avoider_guided_init(void)
void guidance_h_set_heading(float heading)
Set heading setpoint.
struct HorizontalGuidance guidance_h
void guidance_h_set_body_vel(float vx, float vy)
Set body relative horizontal velocity setpoint.
void guidance_h_set_heading_rate(float rate)
Set heading rate setpoint.
Horizontal guidance for rotorcrafts.
#define GUIDANCE_H_MODE_GUIDED
API to get/set the generic vehicle states.
int int32_t
Typedef defining 32 bit int type.
short int16_t
Typedef defining 16 bit short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
navigation_state
Camera focal length, in pixels (i.e. distance between camera.