summaryrefslogtreecommitdiff
path: root/digital/io
diff options
context:
space:
mode:
authorJérémy Dufour2008-04-30 18:49:30 +0200
committerJérémy Dufour2008-04-30 18:49:30 +0200
commit70851833b53e53b0c1623cd9624b75587c931f1d (patch)
tree276cf0e0fa9d9f93901fd7b2da2aa83a540982f2 /digital/io
parent79e761a3933514f2088320a5ebed796fa2623bc5 (diff)
* digital/io/src
- update sharp more often ; - correctly compute radius, distance and validity in the move FSM for path module.
Diffstat (limited to 'digital/io')
-rw-r--r--digital/io/src/main.c2
-rw-r--r--digital/io/src/move_cb.c29
2 files changed, 25 insertions, 6 deletions
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
@@ -35,23 +35,42 @@
#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.