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