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