summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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.