Matrix occupancy quadtree
[Internals]
Data Structures | |
struct | _stg_matrix |
struct | itl_t |
struct | stg_cell |
struct | stg_line_t |
Typedefs | |
typedef struct stg_cell | stg_cell_t |
typedef int(* | stg_itl_test_func_t )(stg_model_t *finder, stg_model_t *found) |
typedef struct _stg_matrix | stg_matrix_t |
Enumerations | |
enum | itl_mode_t { PointToPoint = 0, PointToBearingRange } |
Functions | |
itl_t * | itl_create (double x, double y, double a, double b, stg_matrix_t *matrix, itl_mode_t pmode) |
void | itl_destroy (itl_t *itl) |
stg_model_t * | itl_first_matching (itl_t *itl, stg_itl_test_func_t func, stg_model_t *finder) |
void | itl_raytrace (itl_t *itl) |
double | itl_wall_distance (itl_t *itl, stg_itl_test_func_t func, stg_model_t *finder, stg_model_t *otherrobot) |
stg_cell_t * | stg_cell_locate (stg_cell_t *cell, double x, double y) |
void | stg_cell_render (stg_cell_t *cell) |
void | stg_cell_render_tree (stg_cell_t *cell) |
void | stg_cell_unrender (stg_cell_t *cell) |
void | stg_cell_unrender_tree (stg_cell_t *cell) |
void | stg_matrix_cell_append (stg_matrix_t *matrix, double x, double y, void *object) |
void * | stg_matrix_cell_get (stg_matrix_t *matrix, int r, double x, double y) |
void | stg_matrix_cell_remove (stg_matrix_t *matrix, double x, double y, void *object) |
void | stg_matrix_clear (stg_matrix_t *matrix) |
stg_matrix_t * | stg_matrix_create (double ppm, double width, double height) |
void | stg_matrix_destroy (stg_matrix_t *matrix) |
void | stg_matrix_line (stg_matrix_t *matrix, double x1, double y1, double x2, double y2, void *object) |
void | stg_matrix_lines (stg_matrix_t *matrix, stg_line_t *lines, int num_lines, void *object) |
void | stg_matrix_polygons (stg_matrix_t *matrix, double x, double y, double a, stg_polygon_t *polys, int num_polys, void *object) |
void | stg_matrix_polylines (stg_matrix_t *matrix, double x, double y, double a, stg_polyline_t *polylines, int num_polylines, void *object) |
void | stg_matrix_rectangle (stg_matrix_t *matrix, double px, double py, double pth, double dx, double dy, void *object) |
void | stg_matrix_remove_obect (stg_matrix_t *matrix, void *object) |
void | stg_matrix_remove_object (stg_matrix_t *matrix, void *object) |
Detailed Description
Occupancy quadtree underlying Stage's sensing and collision models.Typedef Documentation
typedef struct stg_cell stg_cell_t |
A node in the occupancy quadtree
typedef int(* stg_itl_test_func_t)(stg_model_t *finder, stg_model_t *found) |
typedef struct _stg_matrix stg_matrix_t |
Occupancy quadtree structure
Enumeration Type Documentation
enum itl_mode_t |
Function Documentation
itl_t* itl_create | ( | double | x, | |
double | y, | |||
double | a, | |||
double | b, | |||
stg_matrix_t * | matrix, | |||
itl_mode_t | pmode | |||
) |
References itl_t::a, itl_t::cosa, itl_t::incr, itl_t::index, itl_t::matrix, itl_t::max_range, itl_t::models, NORMALIZE, PointToBearingRange, PointToPoint, itl_t::range, itl_t::sina, itl_t::tana, itl_t::x, and itl_t::y.
Referenced by audio_checkvisible(), blobfinder_update(), calc_distance(), gripper_break_beam(), gripper_paddle_contact(), laser_update(), model_fiducial_check_neighbor(), ranger_update(), stg_model_test_collision(), and wifi_render_cfg().
void itl_destroy | ( | itl_t * | itl | ) |
stg_model_t* itl_first_matching | ( | itl_t * | itl, | |
stg_itl_test_func_t | func, | |||
stg_model_t * | finder | |||
) |
References itl_t::a, stg_cell::data, GT, GTE, itl_t::index, LT, M_PI, itl_t::matrix, itl_t::max_range, itl_t::models, itl_t::range, _stg_matrix::root, stg_cell::size, stg_cell_locate(), stg_rtk_fig_arrow_ex(), stg_rtk_fig_color_rgb32(), stg_rtk_fig_rectangle(), itl_t::tana, stg_cell::x, itl_t::x, stg_cell::xmax, stg_cell::xmin, stg_cell::y, itl_t::y, stg_cell::ymax, and stg_cell::ymin.
Referenced by audio_checkvisible(), blobfinder_update(), gripper_break_beam(), gripper_paddle_contact(), laser_update(), model_fiducial_check_neighbor(), ranger_update(), stg_model_test_collision(), and wifi_render_cfg().
void itl_raytrace | ( | itl_t * | itl | ) |
double itl_wall_distance | ( | itl_t * | itl, | |
stg_itl_test_func_t | func, | |||
stg_model_t * | finder, | |||
stg_model_t * | otherrobot | |||
) |
References itl_t::a, stg_cell::data, GT, GTE, itl_t::index, LT, M_PI, itl_t::matrix, itl_t::max_range, itl_t::models, itl_t::range, _stg_matrix::root, stg_cell::size, stg_cell_locate(), stg_model_is_related(), stg_rtk_fig_arrow_ex(), stg_rtk_fig_color_rgb32(), stg_rtk_fig_rectangle(), itl_t::tana, stg_cell::x, itl_t::x, stg_cell::xmax, stg_cell::xmin, stg_cell::y, itl_t::y, stg_cell::ymax, and stg_cell::ymin.
Referenced by calc_distance(), and wifi_render_cfg().
stg_cell_t* stg_cell_locate | ( | stg_cell_t * | cell, | |
double | x, | |||
double | y | |||
) |
in the cell-tree which contains cell, return the smallest cell that contains the point x,y. cell need not be the root of the tree
References stg_cell::children, GTE, LT, stg_cell::parent, stg_cell::x, stg_cell::xmax, stg_cell::xmin, stg_cell::y, stg_cell::ymax, and stg_cell::ymin.
Referenced by itl_first_matching(), itl_wall_distance(), and stg_matrix_lines().
void stg_cell_render | ( | stg_cell_t * | cell | ) |
References _stg_rtk_fig_t::canvas, stg_cell::fig, stg_cell::size, STG_LAYER_MATRIX_TREE, stg_rtk_fig_color_rgb32(), stg_rtk_fig_create(), stg_rtk_fig_rectangle(), stg_cell::x, and stg_cell::y.
Referenced by stg_matrix_lines().
void stg_cell_render_tree | ( | stg_cell_t * | cell | ) |
void stg_cell_unrender | ( | stg_cell_t * | cell | ) |
void stg_cell_unrender_tree | ( | stg_cell_t * | cell | ) |
References stg_cell::children, stg_cell_unrender(), and stg_cell_unrender_tree().
Referenced by gui_action_matrixdelta(), and stg_cell_unrender_tree().
void stg_matrix_cell_append | ( | stg_matrix_t * | matrix, | |
double | x, | |||
double | y, | |||
void * | object | |||
) |
append the pointer [object] to the list of pointers in the [matrix] cell at location [x,y]
void* stg_matrix_cell_get | ( | stg_matrix_t * | matrix, | |
int | r, | |||
double | x, | |||
double | y | |||
) |
Get the pointer from the cell at x,y (in meters).
void stg_matrix_cell_remove | ( | stg_matrix_t * | matrix, | |
double | x, | |||
double | y, | |||
void * | object | |||
) |
if [object] appears in the cell's list, remove it
void stg_matrix_clear | ( | stg_matrix_t * | matrix | ) |
removes all pointers from every cell in the matrix
stg_matrix_t* stg_matrix_create | ( | double | ppm, | |
double | width, | |||
double | height | |||
) |
Create a new matrix structure
References _stg_matrix::height, _stg_matrix::ppm, _stg_matrix::ptable, _stg_matrix::root, stg_cell_create(), and _stg_matrix::width.
Referenced by stg_world_create().
void stg_matrix_destroy | ( | stg_matrix_t * | matrix | ) |
Frees all memory allocated by the matrix; first the cells, then the cell array.
References _stg_matrix::ptable.
Referenced by stg_world_destroy().
void stg_matrix_line | ( | stg_matrix_t * | matrix, | |
double | x1, | |||
double | y1, | |||
double | x2, | |||
double | y2, | |||
void * | object | |||
) |
Render [object] as a line in the matrix.
void stg_matrix_lines | ( | stg_matrix_t * | matrix, | |
stg_line_t * | lines, | |||
int | num_lines, | |||
void * | object | |||
) |
Call stg_matrix_line for each of [num_lines] lines
References _render_matrix_deltas, stg_cell::children, stg_cell::data, EQ, stg_cell::fig, GT, GTE, LT, M_PI, _stg_matrix::ppm, _stg_matrix::ptable, _stg_matrix::root, stg_cell::size, stg_cell_create(), stg_cell_locate(), stg_cell_render(), stg_cell::x, stg_line_t::x1, stg_line_t::x2, stg_cell::xmax, stg_cell::xmin, stg_cell::y, stg_line_t::y1, stg_line_t::y2, stg_cell::ymax, and stg_cell::ymin.
Referenced by stg_matrix_polygons(), stg_matrix_polylines(), and stg_matrix_rectangle().
void stg_matrix_polygons | ( | stg_matrix_t * | matrix, | |
double | x, | |||
double | y, | |||
double | a, | |||
stg_polygon_t * | polys, | |||
int | num_polys, | |||
void * | object | |||
) |
render an array of polygons into the matrix
References stg_polygon_t::points, stg_matrix_lines(), stg_point_t::x, stg_line_t::x1, stg_line_t::x2, stg_point_t::y, stg_line_t::y1, and stg_line_t::y2.
Referenced by stg_model_map().
void stg_matrix_polylines | ( | stg_matrix_t * | matrix, | |
double | x, | |||
double | y, | |||
double | a, | |||
stg_polyline_t * | polylines, | |||
int | num_polylines, | |||
void * | object | |||
) |
render an array of polylines into the matrix
References stg_polyline_t::points, stg_polyline_t::points_count, stg_matrix_lines(), stg_point_t::x, stg_line_t::x1, stg_line_t::x2, stg_point_t::y, stg_line_t::y1, and stg_line_t::y2.
Referenced by stg_model_map().
void stg_matrix_rectangle | ( | stg_matrix_t * | matrix, | |
double | px, | |||
double | py, | |||
double | pth, | |||
double | dx, | |||
double | dy, | |||
void * | object | |||
) |
Append to the [object] pointer to the cells on the edge of a rectangle, described in meters about a center point.
References stg_matrix_lines(), stg_line_t::x1, stg_line_t::x2, stg_line_t::y1, and stg_line_t::y2.
Referenced by stg_model_map().
void stg_matrix_remove_obect | ( | stg_matrix_t * | matrix, | |
void * | object | |||
) |
remove [object] from all cells it occupies in the matrix
void stg_matrix_remove_object | ( | stg_matrix_t * | matrix, | |
void * | object | |||
) |
remove all reference to an object from the matrix
References _stg_matrix::ptable, and stg_cell_remove_object().
Referenced by stg_model_map().
Generated on Wed Jun 3 23:12:29 2009 for Stage by
