]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/blob - README.md
7b18b73081c565777f749899fe407f26f8225999
[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 - `ST`
41         - `st1` - Steer directly to goal.
42         - `st2` - Steer with maximum turning radius and direction in mind.
43         - `st3` - Reeds and Shepp steer procedure.
44         - `st4` - Very basic closed-loop simulator.
45
46 To disable *OpenMP*, add `-DCMAKE_DISABLE_FIND_PACKAGE_OpenMP=TRUE` to `cmake`
47 command or to `build.sh` script.
48
49 [CMake]: https://cmake.org/
50
51 # Run
52 The scenarios may be run and plot by the following example command from root:
53 ```
54 SC=lpar && cat $SC.json | ./build/go_car_go > traj.json &&
55 python plot.py $SC.json traj.json
56 ```
57
58 # Scenarios
59 The `go_car_go` program expects json formatted on std input. The output is json
60 formatted to std output.
61
62 - Street width min.: 2.75 (sometimes 2.5m).
63
64 ## Small cars (size 01)
65 - Norm: `ČSN 73 6056 s účinností od 1.8. 1988`.
66 - Perpendicular: 2.25 x 4.5m
67 - Parallel: 2.0 x 5,5m
68
69 ## Large cars (size 02)
70 - Perpendicular: 2.4 x 5.30m
71 - Parallel: 2.2 x 6.5m
72
73 ## Parallel parking example (large cars)
74 ```json
75 {
76         "init": [1.1, 6.5, 1.5707963267948966],
77         "goal": [-1.1, 14.37, 1.5707963267948966],
78         "obst": [
79                 {
80                         "segment": [
81                                 [0, 0],
82                                 [0, 13]
83                         ]
84                 },
85                 {
86                         "segment": [
87                                 [0, 13],
88                                 [-2.2, 13]
89                         ]
90                 },
91                 {
92                         "segment": [
93                                 [-2.2, 13],
94                                 [-2.2, 19.5]
95                         ]
96                 },
97                 {
98                         "segment": [
99                                 [-2.2, 19.5],
100                                 [0, 19.5]
101                         ]
102                 },
103                 {
104                         "segment": [
105                                 [0, 19.5],
106                                 [0, 26]
107                         ]
108                 },
109                 {
110                         "segment": [
111                                 [2.75, 0],
112                                 [2.75, 26]
113                         ]
114                 },
115                 {
116                         "segment": [
117                                 [0, 0],
118                                 [2.75, 0]
119                         ]
120                 },
121                 {
122                         "segment": [
123                                 [0, 26],
124                                 [2.75, 26]
125                         ]
126                 }
127         ]
128 }
129 ```
130
131 ## Perpendicular parking example
132 ```json
133 {
134         "init": [1.1, 6.5, 1.5707963267948966],
135         "goal": [-0.37, 14.2, 3.141592653589793],
136         "obst": [
137                 {
138                         "segment": [
139                                 [0, 0],
140                                 [0, 13]
141                         ]
142                 },
143                 {
144                         "segment": [
145                                 [0, 13],
146                                 [-5.3, 13]
147                         ]
148                 },
149                 {
150                         "segment": [
151                                 [-5.3, 13],
152                                 [-5.3, 15.4]
153                         ]
154                 },
155                 {
156                         "segment": [
157                                 [-5.3, 15.4],
158                                 [0, 15.4]
159                         ]
160                 },
161                 {
162                         "segment": [
163                                 [0, 15.4],
164                                 [0, 26]
165                         ]
166                 },
167                 {
168                         "segment": [
169                                 [5.5, 0],
170                                 [5.5, 26]
171                         ]
172                 },
173                 {
174                         "segment": [
175                                 [0, 0],
176                                 [5.5, 0]
177                         ]
178                 },
179                 {
180                         "segment": [
181                                 [0, 26],
182                                 [5.5, 26]
183                         ]
184                 }
185         ]
186 }
187 ```
188
189 # BATCH TEST
190         for i in {0..19}; do $( bash test.sh )&& mv log log_$i; done
191         L=l; WHAT=par; for i in {0..19}; do mv log_${i}/*${L}${WHAT}* ${WHAT}/${L}${WHAT}_${i}.json; done
192         L=r; WHAT=par; for i in {0..19}; do mv log_${i}/*${L}${WHAT}* ${WHAT}/${L}${WHAT}_${i}.json; done
193         L=l; WHAT=per; for i in {0..19}; do mv log_${i}/*${L}${WHAT}* ${WHAT}/${L}${WHAT}_${i}.json; done
194         L=r; WHAT=per; for i in {0..19}; do mv log_${i}/*${L}${WHAT}* ${WHAT}/${L}${WHAT}_${i}.json; done
195
196 # VISUAL TEST
197 ```
198 while ! timeout 2 ./bin/Kuwata2008st3co1 < lpar.json > traj.json; do
199         kill $!
200         mv traj.json t.json
201         python plot.py lpar.json t.json &
202 done
203 ```