]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/blobdiff - README.md
Merge branch 'release/0.7.0'
[hubacji1/iamcar.git] / README.md
index aad8cf6b30985f82a83156234364ff42213c4764..69fa0b053327330def4263d4ed95e63a6369a0a9 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,17 +1,34 @@
 # I am car
-Autonomous car architecture
+Autonomous car architecture. For now, this project is base for RRT-based
+planners testing.
+
+This project is developed under [GNU GPLv3 license][]. For brief project
+history see [changelog][].
+
+[GNU GPLv3 license]: ./LICENSE
+[changelog]: ./CHANGELOG.md
 
 # Build
-[CMake] is used for project build.
+[CMake][] is used for the project build.
+
+## Default planner
+The default planner is `T2`.
+
+## `T3` planner
+Only `T3` planner is compatible with `USE_PTHREAD` macro in `base/main.cc`
+file. When `T3` is going to be used the `USE_PTHREAD` must be set and `RRTBase`
+destructor in `base/rrtbase.cc` must be commented. Also, the commit `fd2cd6b`
+must be reverted.
 
 ##  Prerequisities
-- cmake
-- libjsoncpp-dev
-- libomp-dev
-- libsdl2-dev
-- freeglut3-dev
+- `cmake`
+- `libjsoncpp-dev`
+- `libomp-dev`
+- `libsdl2-dev`
+- `freeglut3-dev`
 
 ## Commands
+For building the project run:
 ```bash
 mkdir build
 cd build
@@ -19,10 +36,15 @@ cmake ../
 make
 ```
 
+Or the build script may be used:
+```bash
+bash build.sh
+```
+
 ## Compile Macros
 Macros that affects output binary may be used with the cmake commands as
 follows:
-```
+```bash
 cmake -DPLANNER=LaValle1998 ../
 make
 ```
@@ -32,168 +54,66 @@ The list of available macros with values:
         - `LaValle198` - RRT framework.
         - `Kuwata2008` - RRT with changing cost and steering to goal.
         - `Karaman2011` - RRT* framework.
+        - `T1` - testing planner.
+        - `T2` - testing planner based on RRT*.
+        - `T3` - testing planner, update `T2` to bidirectional.
+        - `Klamm2015` - RRT*-Connect planner.
 - `TMAX` - Specify the upper time bound in seconds.
-- `ST`
-        - `st1` - Steer directly to goal.
-        - `st2` - Steer with maximum turning radius and direction in mind.
-        - `st3` - Reeds and Shepp steer procedure.
-        - `st4` - Very basic closed-loop simulator.
+- `USE_GL` - Specify if GL is going to be used to plot the algorithm.
+- `USE_SLOTPLANNER` - Specify if slot planner is going to be used.
+
+Implemented Steering procedures:
+- `st1` - Steer directly to goal, no constraints.
+- `st2` - Steer with maximum turning radius and direction in mind.
+- `st3` - Reeds and Shepp steer procedure.
+- `st4` - Very basic closed-loop simulator.
+- `st5` - Dubins paths.
 
 To disable *OpenMP*, add `-DCMAKE_DISABLE_FIND_PACKAGE_OpenMP=TRUE` to `cmake`
 command or to `build.sh` script.
 
+To add address sanitizer, please update the `CMakeLists.txt` file with:
+- `add_compile_options(-Wall -g -Wno-unknown-pragmas -fsanitize=address)`
+- `target_link_libraries(go_car_go asan)`
+
 [CMake]: https://cmake.org/
 
 # Run
-The scenarios may be run and plot by the following example command from root:
+The scenarios may be run by:
+```bash
+./build/go_car_go < lpar.json > traj.json
 ```
-SC=lpar && cat $SC.json | ./build/go_car_go > traj.json &&
-python plot.py $SC.json traj.json
+
+or by:
+```bash
+./bin/T2 < lpar.json > traj.json
+```
+
+and plot with:
+```bash
+python3 plot.py lpar.json traj.json
 ```
 
 # Scenarios
 The `go_car_go` program expects json formatted on std input. The output is json
-formatted to std output.
+formatted to std output. Statistics are written to error output.
 
+## Slots technical info
 - Street width min.: 2.75 (sometimes 2.5m).
 
-## Small cars (size 01)
+### Small cars (size 01)
 - Norm: `ČSN 73 6056 s účinností od 1.8. 1988`.
 - Perpendicular: 2.25 x 4.5m
 - Parallel: 2.0 x 5,5m
 
-## Large cars (size 02)
+### Large cars (size 02)
 - Perpendicular: 2.4 x 5.30m
 - Parallel: 2.2 x 6.5m
 
-## Parallel parking example (large cars)
-```json
-{
-        "init": [1.1, 6.5, 1.5707963267948966],
-        "goal": [-1.1, 14.37, 1.5707963267948966],
-        "obst": [
-                {
-                        "segment": [
-                                [0, 0],
-                                [0, 13]
-                        ]
-                },
-                {
-                        "segment": [
-                                [0, 13],
-                                [-2.2, 13]
-                        ]
-                },
-                {
-                        "segment": [
-                                [-2.2, 13],
-                                [-2.2, 19.5]
-                        ]
-                },
-                {
-                        "segment": [
-                                [-2.2, 19.5],
-                                [0, 19.5]
-                        ]
-                },
-                {
-                        "segment": [
-                                [0, 19.5],
-                                [0, 26]
-                        ]
-                },
-                {
-                        "segment": [
-                                [2.75, 0],
-                                [2.75, 26]
-                        ]
-                },
-                {
-                        "segment": [
-                                [0, 0],
-                                [2.75, 0]
-                        ]
-                },
-                {
-                        "segment": [
-                                [0, 26],
-                                [2.75, 26]
-                        ]
-                }
-        ]
-}
-```
+## Examples
+- [Parallel parking example](./lpar.json)
+- [Perpendicular parking example](./lper.json)
 
-## Perpendicular parking example
-```json
-{
-        "init": [1.1, 6.5, 1.5707963267948966],
-        "goal": [-0.37, 14.2, 3.141592653589793],
-        "obst": [
-                {
-                        "segment": [
-                                [0, 0],
-                                [0, 13]
-                        ]
-                },
-                {
-                        "segment": [
-                                [0, 13],
-                                [-5.3, 13]
-                        ]
-                },
-                {
-                        "segment": [
-                                [-5.3, 13],
-                                [-5.3, 15.4]
-                        ]
-                },
-                {
-                        "segment": [
-                                [-5.3, 15.4],
-                                [0, 15.4]
-                        ]
-                },
-                {
-                        "segment": [
-                                [0, 15.4],
-                                [0, 26]
-                        ]
-                },
-                {
-                        "segment": [
-                                [5.5, 0],
-                                [5.5, 26]
-                        ]
-                },
-                {
-                        "segment": [
-                                [0, 0],
-                                [5.5, 0]
-                        ]
-                },
-                {
-                        "segment": [
-                                [0, 26],
-                                [5.5, 26]
-                        ]
-                }
-        ]
-}
-```
-
-# BATCH TEST
-        for i in {0..19}; do $( bash test.sh )&& mv log log_$i; done
-        L=l; WHAT=par; for i in {0..19}; do mv log_${i}/*${L}${WHAT}* ${WHAT}/${L}${WHAT}_${i}.json; done
-        L=r; WHAT=par; for i in {0..19}; do mv log_${i}/*${L}${WHAT}* ${WHAT}/${L}${WHAT}_${i}.json; done
-        L=l; WHAT=per; for i in {0..19}; do mv log_${i}/*${L}${WHAT}* ${WHAT}/${L}${WHAT}_${i}.json; done
-        L=r; WHAT=per; for i in {0..19}; do mv log_${i}/*${L}${WHAT}* ${WHAT}/${L}${WHAT}_${i}.json; done
-
-# VISUAL TEST
-```
-while ! timeout 2 ./bin/Kuwata2008st3co1 < lpar.json > traj.json; do
-        kill $!
-        mv traj.json t.json
-        python plot.py lpar.json t.json &
-done
-```
+# Tests
+It is possible to run automated tests for multiple planners on one scenario.
+For this purpose there is `test.sh` script.