]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/blob - README.md
Merge branch 'feature/GL'
[hubacji1/iamcar.git] / README.md
1 # I am car
2 Autonomous car architecture
3
4 # Build
5 [CMake] is used for project build.
6
7 ##  Prerequisities
8 - cmake
9 - libjsoncpp-dev
10 - libomp-dev
11 - libsdl2-dev
12 - freeglut3-dev
13
14 ## Commands
15 ```bash
16 mkdir build
17 cd build
18 cmake ../
19 make
20 ```
21
22 ## Compile Macros
23 Macros that affects output binary may be used with the cmake commands as
24 follows:
25 ```
26 cmake -DPLANNER=LaValle1998 ../
27 make
28 ```
29
30 The list of available macros with values:
31 - `PLANNER`
32         - `LaValle198` - RRT framework.
33         - `Kuwata2008` - RRT with changing cost and steering to goal.
34         - `Karaman2011` - RRT* framework.
35 - `TMAX` - Specify the upper time bound in seconds.
36 - `NN`
37         - `nn1` - Nearest neighbour basic DFS procedure.
38 - `NV`
39         - `nv1` - Near vertices basic DFS procedure.
40 - `SA`
41         - `sa1` - Basic sample procedure.
42 - `ST`
43         - `st1` - Steer directly to goal.
44         - `st2` - Steer with maximum turning radius and direction in mind.
45         - `st3` - Reeds and Shepp steer procedure.
46         - `st4` - Very basic closed-loop simulator.
47 - `CO`
48         - `co1` - Euclidean distance cost.
49         - `co2` - Reeds and Shepp distance.
50 - `CCO`
51         - `co3` - Cumulative cost based on Euclidean distance.
52         - `co4` - Cumulative cost based on Reeds and Shepp distance.
53
54 To disable *OpenMP*, add `-DCMAKE_DISABLE_FIND_PACKAGE_OpenMP=TRUE` to `cmake`
55 command or to `build.sh` script.
56
57 [CMake]: https://cmake.org/
58
59 # Run
60 The scenarios may be run and plot by the following example command from root:
61 ```
62 SC=lpar && cat $SC.json | ./build/go_car_go > traj.json &&
63 python plot.py $SC.json traj.json
64 ```
65
66 # Scenarios
67 The `go_car_go` program expects json formatted on std input. The output is json
68 formatted to std output.
69
70 - Street width min.: 2.75 (sometimes 2.5m).
71
72 ## Small cars (size 01)
73 - Norm: `ČSN 73 6056 s účinností od 1.8. 1988`.
74 - Perpendicular: 2.25 x 4.5m
75 - Parallel: 2.0 x 5,5m
76
77 ## Large cars (size 02)
78 - Perpendicular: 2.4 x 5.30m
79 - Parallel: 2.2 x 6.5m
80
81 ## Parallel parking example (large cars)
82 ```json
83 {
84         "init": [1.1, 6.5, 1.5707963267948966],
85         "goal": [-1.1, 14.37, 1.5707963267948966],
86         "obst": [
87                 {
88                         "segment": [
89                                 [0, 0],
90                                 [0, 13]
91                         ]
92                 },
93                 {
94                         "segment": [
95                                 [0, 13],
96                                 [-2.2, 13]
97                         ]
98                 },
99                 {
100                         "segment": [
101                                 [-2.2, 13],
102                                 [-2.2, 19.5]
103                         ]
104                 },
105                 {
106                         "segment": [
107                                 [-2.2, 19.5],
108                                 [0, 19.5]
109                         ]
110                 },
111                 {
112                         "segment": [
113                                 [0, 19.5],
114                                 [0, 26]
115                         ]
116                 },
117                 {
118                         "segment": [
119                                 [2.75, 0],
120                                 [2.75, 26]
121                         ]
122                 },
123                 {
124                         "segment": [
125                                 [0, 0],
126                                 [2.75, 0]
127                         ]
128                 },
129                 {
130                         "segment": [
131                                 [0, 26],
132                                 [2.75, 26]
133                         ]
134                 }
135         ]
136 }
137 ```
138
139 ## Perpendicular parking example
140 ```json
141 {
142         "init": [1.1, 6.5, 1.5707963267948966],
143         "goal": [-0.37, 14.2, 3.141592653589793],
144         "obst": [
145                 {
146                         "segment": [
147                                 [0, 0],
148                                 [0, 13]
149                         ]
150                 },
151                 {
152                         "segment": [
153                                 [0, 13],
154                                 [-5.3, 13]
155                         ]
156                 },
157                 {
158                         "segment": [
159                                 [-5.3, 13],
160                                 [-5.3, 15.4]
161                         ]
162                 },
163                 {
164                         "segment": [
165                                 [-5.3, 15.4],
166                                 [0, 15.4]
167                         ]
168                 },
169                 {
170                         "segment": [
171                                 [0, 15.4],
172                                 [0, 26]
173                         ]
174                 },
175                 {
176                         "segment": [
177                                 [5.5, 0],
178                                 [5.5, 26]
179                         ]
180                 },
181                 {
182                         "segment": [
183                                 [0, 0],
184                                 [5.5, 0]
185                         ]
186                 },
187                 {
188                         "segment": [
189                                 [0, 26],
190                                 [5.5, 26]
191                         ]
192                 }
193         ]
194 }
195 ```
196
197 # BATCH TEST
198         for i in {0..19}; do $( bash test.sh )&& mv log log_$i; done
199         L=l; WHAT=par; for i in {0..19}; do mv log_${i}/*${L}${WHAT}* ${WHAT}/${L}${WHAT}_${i}.json; done
200         L=r; WHAT=par; for i in {0..19}; do mv log_${i}/*${L}${WHAT}* ${WHAT}/${L}${WHAT}_${i}.json; done
201         L=l; WHAT=per; for i in {0..19}; do mv log_${i}/*${L}${WHAT}* ${WHAT}/${L}${WHAT}_${i}.json; done
202         L=r; WHAT=per; for i in {0..19}; do mv log_${i}/*${L}${WHAT}* ${WHAT}/${L}${WHAT}_${i}.json; done
203
204 # VISUAL TEST
205 ```
206 while ! timeout 2 ./bin/Kuwata2008st3co1 < lpar.json > traj.json; do
207         kill $!
208         mv traj.json t.json
209         python plot.py lpar.json t.json &
210 done
211 ```