path: root/digital/avr/modules/path
diff options
authorNicolas Schodet2008-07-03 00:15:16 +0200
committerNicolas Schodet2008-07-03 00:15:16 +0200
commit794bc826741d0a69ec2790b5538a317c824dd2b8 (patch)
tree5db6bd52d1243260d17bebdf6c3128e8c6c5ab2f /digital/avr/modules/path
parent27b65b8927800d150d1e7c50856704a227bdeb3c (diff)
* digital/avr/modules/path:
- added usage doc.
Diffstat (limited to 'digital/avr/modules/path')
2 files changed, 67 insertions, 0 deletions
diff --git a/digital/avr/modules/path/Makefile b/digital/avr/modules/path/Makefile
new file mode 100644
index 00000000..efa2d8f0
--- /dev/null
+++ b/digital/avr/modules/path/Makefile
@@ -0,0 +1,5 @@
+BASE = ../..
+DOC = path.html
+EXTRACTDOC = path.h avrconfig.h
+include $(BASE)/make/Makefile.gen
diff --git a/digital/avr/modules/path/path.txt b/digital/avr/modules/path/path.txt
new file mode 100644
index 00000000..b9be6314
--- /dev/null
+++ b/digital/avr/modules/path/path.txt
@@ -0,0 +1,62 @@
+ Path finding module
+:Author: Nicolas Schodet
+This module will find a path for a mobile point between obstacles on a
+rectangular area.
+Obstacles are represented as circles in which the mobile can not enter. The
+mobile point does not have a size, therefore, obstacles must be larger by the
+real mobile radius, and the area on which the mobile evolves should be
+shrunken by this same radius.
+The module can also handle obstacles life time, to make them disappear after a
+defined time.
+First initialise the module with the area border (shrunken by the mobile
+radius) using ``path_init``.
+You can place obstacles using the ``path_obstacle`` function. Give it the
+obstacle index, its position and radius, and its life time. Use a life time
+of 0xffff for infinite duration. Call ``path_decay`` regularly to make
+obstacles disappear after the given delay.
+You can also set the source and destination position using the
+``path_endpoints`` function.
+Once you want to compute a path, call ``path_update``. It will use the
+currently set positions and obstacles to compute the path. Once the update is
+done, you can call ``path_get_next`` to get the first point of the found path.
+If no path was found, this function returns 0.
+This interface only gives you the first point of the path because it is
+assumed that the path will not be up to date any more once the mobile arrives
+at the first point. This will change in the future.
+when the path is updated, a user callback can be called by the path module to
+report the found path. It receives the list of points of the path and the
+list of obstacles. The callback is defined in the ``avrconfig.h`` file.
+The number of possible obstacles and the number of points per obstacle used in
+the algorithm are defined at compile time.
+How does it work?
+The base of the path finding algorithm is the Dijstra algorithm. This
+algorithm is able to find the shortest path between two nodes in a graph,
+taking into account arc weight.
+To be continued...
+.. include:: path.exd