]> rtime.felk.cvut.cz Git - hubacji1/iamcar2.git/blob - README.md
Update readme with ninja build
[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`
29 - `libpsp` (depends on `libbcar`, `libpslot`)
30 - `librrts` (depends on `libbcar`)
31
32 # Tests
33 Files in `src/` folder named `testX.cc` where `X` is integer are tests. All
34 tests expects JSON fromatted *scenario* on standard input and outputs JSON
35 formatted *plan* on standard output. Both, *scenario* and *plan* can be plotted
36 with `plot_json_objects_scenario.py` script.
37
38 ## JSON formatted *scenario*
39 The following properties are expected:
40 - `init`: list of 3 numbers (`x`, `y`, `heading`).
41 - `obst`: list of polygon obstacles, where polygon obstacle is list of
42   coordinates, and coordinate is a list of 2 numbers (`x`, `y`).
43 - `slot`: list of parking slots, where parking slot is a list of 4 coordinates,
44   and coordinate is a list of 2 numbers (`x`, `y`).
45
46 ## JSON formatted *plan*
47 The following properties are expected to extend *scenario* properties:
48 - `goal`: list of 3 numbers (`x`, `y`, `heading`).
49 - `path`: list of poses, where pose is list of 3 numbers (`x`, `y`, `heading`).
50 - `time`: elapsed time.
51 - `cost`: path cost.
52
53 ## Test files
54 There is a list of test files and what they include:
55 - `test2.cc`: rapidly-exploring random tree star.
56 - `test1.cc`: parking slot planner.
57 - `test-template.cc`: template for tests.
58
59 # Contribute
60 Use [OneFlow][3] branching model and keep the [changelog][4].
61
62 Write [great git commit messages][5]:
63 1. Separate subject from body with a blank line.
64 2. Limit the subject line to 50 characters.
65 3. Capitalize the subject line.
66 4. Do not end the subject line with a period.
67 5. Use the imperative mood in the subject line.
68 6. Wrap the body at 72 characters.
69 7. Use the body to explain what and why vs. how.
70
71 When adding feature or hotfix, use [Test-driven development (TDD)][2]:
72 1. Add tests to `ut` folder, add methods declaration, basic structure.
73 2. Run tests (just `make` in `build` folder), check that tests *fail*.
74 3. Implement functionality.
75 4. Run tests, check that tests *pass*.
76 5. Refactor.
77
78 [2]: https://en.wikipedia.org/wiki/Test-driven_development
79 [3]: https://www.endoflineblog.com/oneflow-a-git-branching-model-and-workflow
80 [4]: ./CHANGELOG.md
81 [5]: https://chris.beams.io/posts/git-commit/
82
83 # Documentation
84 The documentation is generated by Doxygen, at least version `1.8.15` is needed.
85 Just run `doxygen` in the project root directory.