From 70851833b53e53b0c1623cd9624b75587c931f1d Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Wed, 30 Apr 2008 18:49:30 +0200 Subject: * digital/io/src - update sharp more often ; - correctly compute radius, distance and validity in the move FSM for path module. --- digital/io/src/main.c | 2 +- digital/io/src/move_cb.c | 29 ++++++++++++++++++++++++----- 2 files changed, 25 insertions(+), 6 deletions(-) (limited to 'digital') diff --git a/digital/io/src/main.c b/digital/io/src/main.c index 1a6063ac..2e7dafcd 100644 --- a/digital/io/src/main.c +++ b/digital/io/src/main.c @@ -89,7 +89,7 @@ static uint8_t main_stats_asserv_, main_stats_asserv_cpt_; /** * Update frequency of sharps. */ -#define MAIN_SHARP_UPDATE_FREQ 20 +#define MAIN_SHARP_UPDATE_FREQ 5 /** * Sharps frequency counter. diff --git a/digital/io/src/move_cb.c b/digital/io/src/move_cb.c index 63a608e6..a92135ea 100644 --- a/digital/io/src/move_cb.c +++ b/digital/io/src/move_cb.c @@ -34,24 +34,43 @@ #include "main.h" /* main_post_event_for_top_fsm */ #include "modules/math/fixed/fixed.h" /* fixed_* */ +/** + * The real radius of the obstacle. + */ +#define MOVE_REAL_OBSTACLE_RADIUS 150 + +/** + * The sharp distance between the bot and the obstacle. + */ +#define MOVE_SHARP_DISTANCE 300 + +/** + * The distance between the axis of the bot and the front sharp. + */ +#define MOVE_AXIS_FRONT_SHARP 150 + /** * The standard distance of the obstacle. */ -#define MOVE_OBSTACLE_DISTANCE 300 +#define MOVE_OBSTACLE_DISTANCE \ + (MOVE_REAL_OBSTACLE_RADIUS + MOVE_SHARP_DISTANCE + MOVE_AXIS_FRONT_SHARP) /** - * The generic radius of the obstacle. + * The radius of the obstacle for the path module. + * It corresponds to the real radius of the obstacle plus the distance you + * want to add to avoid it. */ -#define MOVE_OBSTACLE_RADIUS 150 +#define MOVE_OBSTACLE_RADIUS (MOVE_REAL_OBSTACLE_RADIUS + 250) + /** * The generic validity time (in term of number of cyles). */ -#define MOVE_OBSTACLE_VALIDITY 2000 +#define MOVE_OBSTACLE_VALIDITY (5 * 225) /** * Cycles count to ignore sharp event in the main loop. */ -#define MOVE_MAIN_IGNORE_SHARP_EVENT 1250 +#define MOVE_MAIN_IGNORE_SHARP_EVENT (3 * 225) /** * Easier function to get the next intermediate positon from the path module. -- cgit v1.2.3