From 98a10d5c181d40f8ea3d600d712ed249417a963e Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Fri, 23 Apr 2010 00:33:53 +0200 Subject: digital/avr/modules/path: use vect_t in interface --- digital/avr/modules/path/path.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'digital/avr/modules/path/path.h') diff --git a/digital/avr/modules/path/path.h b/digital/avr/modules/path/path.h index 24fc3e42..24640b5c 100644 --- a/digital/avr/modules/path/path.h +++ b/digital/avr/modules/path/path.h @@ -24,6 +24,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * }}} */ +#include "modules/math/geometry/vect.h" /** Infinite validity for an obstacle. */ #define PATH_OBSTACLE_VALID_ALWAYS 0xffff @@ -32,7 +33,7 @@ struct path_obstacle_t { /** Center. */ - int16_t x, y; + vect_t c; /** Radius. */ uint16_t r; /** Factor. If not 0, obstacle is not blocking, but it add weight to path @@ -49,7 +50,7 @@ path_init (int16_t border_xmin, int16_t border_ymin, /** Setup end points (source and destination coordinates). */ void -path_endpoints (int16_t sx, int16_t sy, int16_t dx, int16_t dy); +path_endpoints (vect_t s, vect_t d); /** Try to escape from inside an obstacle. Bigger factor will shorten path * followed inside the obstacle. Valid until the next update. */ @@ -59,7 +60,7 @@ path_escape (uint8_t factor); /** Set up an obstacle at given position with the given radius, factor and * validity period. */ void -path_obstacle (uint8_t i, int16_t x, int16_t y, uint16_t r, uint8_t factor, +path_obstacle (uint8_t i, vect_t c, uint16_t r, uint8_t factor, uint16_t valid); /** Slowly make the obstacles disappear. */ @@ -72,13 +73,13 @@ path_update (void); /** Retrieve first path point coordinates. Return 0 on failure. */ uint8_t -path_get_next (uint16_t *x, uint16_t *y); +path_get_next (vect_t *p); #if AC_PATH_REPORT /** Report computed path. */ void -AC_PATH_REPORT_CALLBACK (uint16_t *points, uint8_t len, +AC_PATH_REPORT_CALLBACK (vect_t *points, uint8_t len, struct path_obstacle_t *obstacles, uint8_t obstacles_nb); -- cgit v1.2.3