]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/blob - README.md
Merge branch 'feature/refactor-test'
[hubacji1/iamcar2.git] / README.md
1 # I am car, too
2 *I am car, too* puts together multiple libraries and run some automated parking
3 tests.
4
5 # License
6 The project is published under [MIT License][1].
7
8 [1]: ./LICENSE
9
10 # Build
11 To build the project run the following commands:
12 ```
13 mkdir build
14 cd build
15 cmake ../
16 make
17 ```
18
19 To build with ninja:
20 ```
21 mkdir build
22 cd build
23 cmake -DCMAKE_BUILD_TYPE=Release -G Ninja ../
24 ninja -v
25 ```
26
27 ## Required libraries
28 - libjsoncpp-dev (`apt install libjsoncpp-dev`)
29 - [libpsp](http://rtime.felk.cvut.cz/gitweb/hubacji1/psp.git)
30   - [libbcar](http://rtime.felk.cvut.cz/gitweb/hubacji1/bcar.git)
31   - libpslot (part of libbcar repository)
32 - [librrts](http://rtime.felk.cvut.cz/gitweb/hubacji1/rrts.git)
33   - libbcar (see above)
34
35 # Tests
36 Files in `src/` folder named `testX.cc` where `X` is integer are tests. All
37 tests expects JSON fromatted *scenario* on standard input and outputs JSON
38 formatted *plan* on standard output. Both, *scenario* and *plan* can be plotted
39 with `plot_json_objects_scenario.py` script.
40
41 ## JSON formatted *scenario*
42 The following properties are expected:
43 - `init`: list of 3 numbers (`x`, `y`, `heading`).
44 - `obst`: list of polygon obstacles, where polygon obstacle is list of
45   coordinates, and coordinate is a list of 2 numbers (`x`, `y`).
46 - `slot`: list of parking slots, where parking slot is a list of 4 coordinates,
47   and coordinate is a list of 2 numbers (`x`, `y`).
48
49 ## JSON formatted *plan*
50 The following properties are expected to extend *scenario* properties:
51 - `goal`: list of 3 numbers (`x`, `y`, `heading`).
52 - `goals`: list of possible goals `[(x, y, h), ...]`.
53 - `path`: list of poses, where pose is list of 3 numbers (`x`, `y`, `heading`).
54
55 ## JSON formatted *stats*
56 The following are expected in the output along with *plan*:
57 - `time`: elapsed time.
58 - `iterations`: number of iterations of algorithm.
59 - `cost`: path cost.
60 - `cusps-in-path`: the number of nodes with direction change in path.
61 - `connecteds-in-path`: the number of nodes almost same (connected) in path.
62 - `nodes`: overall number of nodes.
63
64 ## Test files
65 There is a list of test files `src/testN.cc`, where `N` stands for:
66
67 1.  *PSPlanner*: parking slot planner.
68 2.  *RRTS*: rapidly-exploring random tree star.
69 3.  *RRTExt2*: RRT\* w/[cute c2][] library for collision detection.
70 4.  *RRTCE1*: cute, RS-heur.
71 5.  *RRTCE2*: cute, RS-Euclid.
72 6.  *RRTCE3*: cute, RS-RS.
73 7.  *RRTS*: pure RRT\* run in 1 second interval multiple times.
74 8.  *RRTCE5*: cute, grid, RS-Euclid.
75 9.  *RRTCE7*: cute, grid, RS-Euclid, Dijkstra.
76 10. [behavior tree][] w/*RRTCE7*: cute, grid, RS-Euclid, Dijkstra.
77 11. *RRTCE4*: cute, grid, RS-heur.
78 12. *RRTCE6*: cute, grid, RS-RS.
79 13. *RRTCE8*: cute, grid, RS-RS, dijkstra (`ce8`).
80 14. *RRTCE9*: cute, grid, RS-heur, dijkstra (`ce9`).
81 15. *RRTCE10*: cute, Dijkstra, 2D k-d tree, RS-RS.
82 16. *RRTCE11*: cute, Dijkstra, 2D k-d tree, RS-Euclid.
83 17. *RRTCE12*: cute, Dijkstra, 2D k-d tree, RS-heur.
84 18. *RRTCE13*: cute, Dijkstra, 3D k-d tree, RS-RS.
85 19. *RRTCE14*: cute, Dijkstra, 3D k-d tree, RS-heur.
86 20. *RRTCE15*: cute, Dijkstra, 3D grid, RS-RS.
87 21. *RRTCE16*: cute, Dijkstra, 3D grid, RS-heur.
88 22. *RRTCE13*: psp, cute, Dijkstra, RS-RS, 3D tree.
89 23. *RRTCE14*: psp, cute, Dijkstra, RS-H, 3D tree.
90 24. *RRTCE15*: psp, cute, Dijkstra, RS-RS, 3D grid.
91 25. *RRTCE16*: psp, cute, Dijkstra, RS-H, 3D grid.
92 26. *RRTCE11*: psp, cute, Dijkstra, RS-E, 2D tree
93 27. *RRTCE7*: psp, cute, Dijkstra, RS-E, 2D grid
94
95 28. *RRTCE3*: psp, cute, RS-RS
96 29. *RRTCE2*: psp, cute, RS-E
97 30. *RRTCE1*: psp, cute, RS-H
98 31. *RRTCE17*: psp, cute, RS-B
99
100 32. *RRTCE18*: psp, cute, 2D grid, RS-RS
101 33. *RRTCE19*: psp, cute, 2D grid, RS-E
102 34. *RRTCE20*: psp, cute, 2D grid, RS-H
103 35. *RRTCE21*: psp, cute, 2D grid, RS-B
104
105 36. *RRTCE22*: psp, cute, 2D tree, RS-RS
106 37. *RRTCE23*: psp, cute, 2D tree, RS-E
107 38. *RRTCE24*: psp, cute, 2D tree, RS-H
108 39. *RRTCE25*: psp, cute, 2D tree, RS-B
109
110 40. *RRTCE26*: psp, cute, 3D grid, RS-RS
111 41. *RRTCE27*: psp, cute, 3D grid, RS-E
112 42. *RRTCE28*: psp, cute, 3D grid, RS-H
113 43. *RRTCE29*: psp, cute, 3D grid, RS-B
114
115 44. *RRTCE30*: psp, cute, 3D tree, RS-RS
116 45. *RRTCE31*: psp, cute, 3D tree, RS-E
117 46. *RRTCE32*: psp, cute, 3D tree, RS-H
118 47. *RRTCE33*: psp, cute, 3D tree, RS-B
119
120 Template for tests is in file `src/test-template.cc`.
121
122 [cute c2]: https://github.com/RandyGaul/cute_headers/blob/master/cute_c2.h
123 [behavior tree]: https://github.com/arvidsson/BrainTree
124
125 # Contribute
126 Use [OneFlow][3] branching model and keep the [changelog][4].
127
128 Write [great git commit messages][5]:
129 1. Separate subject from body with a blank line.
130 2. Limit the subject line to 50 characters.
131 3. Capitalize the subject line.
132 4. Do not end the subject line with a period.
133 5. Use the imperative mood in the subject line.
134 6. Wrap the body at 72 characters.
135 7. Use the body to explain what and why vs. how.
136
137 When adding feature or hotfix, use [Test-driven development (TDD)][2]:
138 1. Add tests to `ut` folder, add methods declaration, basic structure.
139 2. Run tests (just `make` in `build` folder), check that tests *fail*.
140 3. Implement functionality.
141 4. Run tests, check that tests *pass*.
142 5. Refactor.
143
144 [2]: https://en.wikipedia.org/wiki/Test-driven_development
145 [3]: https://www.endoflineblog.com/oneflow-a-git-branching-model-and-workflow
146 [4]: ./CHANGELOG.md
147 [5]: https://chris.beams.io/posts/git-commit/
148
149 # Documentation
150 The documentation is generated by Doxygen, at least version `1.8.15` is needed.
151 Just run `doxygen` in the project root directory.