aversive_10-03-12/modules/devices/robot/obstacle_avoidance/obstacle_avoidance.h File Reference

Go to the source code of this file.

Data Structures

struct  _ext_point
struct  _point
struct  _line
struct  _poly
struct  obstacle_avoidance

Defines

#define MAX_POLY   3
#define MAX_PTS   10
#define MAX_RAYS   100
#define MAX_CHKPOINTS   5
#define PLAYGROUND_X_MIN   0
#define PLAYGROUND_X_MAX   300
#define PLAYGROUND_Y_MIN   0
#define PLAYGROUND_Y_MAX   210

Typedefs

typedef struct _ext_point oa_ext_point_t
typedef struct _point oa_point_t
typedef struct _line oa_line_t
typedef struct _poly oa_poly_t

Functions

void oa_init (void)
void oa_start_end_points (int32_t st_x, int32_t st_y, int32_t en_x, int32_t en_y)
oa_poly_toa_new_poly (uint8_t size)
void oa_poly_set_point (oa_poly_t *pol, int32_t x, int32_t y, uint8_t i)
int8_t oa_process (void)
oa_point_toa_get_path (void)
uint8_t is_point_in_poly (oa_poly_t *pol, int16_t x, int16_t y)


Define Documentation

#define MAX_CHKPOINTS   5

Definition at line 59 of file obstacle_avoidance.h.

Referenced by get_path().

#define MAX_POLY   3

Definition at line 56 of file obstacle_avoidance.h.

Referenced by dijkstra(), and oa_new_poly().

#define MAX_PTS   10

Definition at line 57 of file obstacle_avoidance.h.

Referenced by oa_new_poly().

#define MAX_RAYS   100

Definition at line 58 of file obstacle_avoidance.h.

#define PLAYGROUND_X_MAX   300

Definition at line 62 of file obstacle_avoidance.h.

#define PLAYGROUND_X_MIN   0

Definition at line 61 of file obstacle_avoidance.h.

#define PLAYGROUND_Y_MAX   210

Definition at line 65 of file obstacle_avoidance.h.

#define PLAYGROUND_Y_MIN   0

Definition at line 64 of file obstacle_avoidance.h.


Typedef Documentation

typedef struct _ext_point oa_ext_point_t

typedef struct _line oa_line_t

typedef struct _point oa_point_t

typedef struct _poly oa_poly_t


Function Documentation

uint8_t is_point_in_poly ( oa_poly_t pol,
int16_t  x,
int16_t  y 
)

return

Definition at line 361 of file obstacle_avoidance.c.

References _ext_point::x, and _ext_point::y.

oa_point_t* oa_get_path ( void   ) 

get the result after a call to oa_process()

Definition at line 112 of file obstacle_avoidance.c.

References obstacle_avoidance::res, and obstacle_avoidance::u.

void oa_init ( void   ) 

Init the oa structure

Init the oa structure. Note: In the algorithm, the first polygon is a dummy one, and is used to represent the START and END points (so it has 2 vertices)

Definition at line 42 of file obstacle_avoidance.c.

References _poly::l, oa_start_end_points(), obstacle_avoidance::points, obstacle_avoidance::polys, and _poly::pts.

oa_poly_t* oa_new_poly ( uint8_t  size  ) 

void oa_poly_set_point ( oa_poly_t pol,
int32_t  x,
int32_t  y,
uint8_t  i 
)

set a point of the polygon.

Add a point to the polygon.

Definition at line 101 of file obstacle_avoidance.c.

References DEBUG, E_OA, _poly::pts, _ext_point::valid, _ext_point::weight, _ext_point::x, and _ext_point::y.

int8_t oa_process ( void   ) 

void oa_start_end_points ( int32_t  st_x,
int32_t  st_y,
int32_t  en_x,
int32_t  en_y 
)

Set the start and destination point.

Set the start and destination point. Return 0 on sucess

Definition at line 56 of file obstacle_avoidance.c.

References obstacle_avoidance::cur_poly_idx, obstacle_avoidance::cur_pt_idx, obstacle_avoidance::points, _ext_point::valid, _ext_point::weight, _ext_point::x, and _ext_point::y.

Referenced by oa_init().


Generated on Fri Mar 12 06:32:06 2010 for AVR by  doxygen 1.5.6