-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from fsfeup-driverless/dev
Release 0
- Loading branch information
Showing
174 changed files
with
9,104 additions
and
6,030 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
*.html linguist-vendored | ||
*.css linguist-vendored | ||
*.js linguist-vendored | ||
*.tex linguist-vendored |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Static Analysis | ||
|
||
on: | ||
push: | ||
branches: [ "main", "dev" ] | ||
pull_request: | ||
branches: [ "main", "dev" ] | ||
|
||
jobs: | ||
cppcheck: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install cppcheck | ||
run: sudo apt install cppcheck | ||
|
||
- name: Run cppcheck | ||
run: cppcheck --enable=all --error-exitcode=1 src/ -i test/ | ||
|
||
cpplint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install cpplint | ||
run: pip install cpplint | ||
|
||
- name: Run cpplint | ||
run: cpplint --recursive ./src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
**/.vscode/* | ||
**/.idea/* | ||
**/.DS_Store | ||
**/.DS_Store | ||
**/build/* | ||
**/install/* | ||
**/log/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Change Log | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
## Sprint 2 | ||
|
||
### Localization and Mapping | ||
- Localization and Mapping publisher node | ||
- Cone, ConeArray and Pose messages | ||
|
||
## Sprint 1 | ||
|
||
### Control | ||
|
||
- The pre-existing PID algorithm was integrated into a ROS Node | ||
- A path-planning mock publisher was created so that the control node could receive test messages | ||
- A custom interfaces package was built to support any custom messages in the project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This script requires a Doxyfile to be in the current directory, as well as pdflatex to be installed with its dependencies. | ||
# Refer to https://gist.github.com/rain1024/98dd5e2c6c8c28f9ea9d to install pdflatex | ||
sudo rm -rf ./doxygen | ||
doxygen | ||
cd doxygen/latex | ||
make | ||
cd .. | ||
mv latex/refman.pdf ./documentation.pdf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
# Documenting Work | ||
|
||
In order to pass down the knowledge aquired to the next generations of driverless engineers and to make the code developed easier to understand, it is fundamental that both the code, system design and architecture and decisions are all documented. | ||
|
||
- For code documentation, we will be using **Doxygen**. | ||
- To document the current structure of the system, the **documentation section** of this repository will be used. | ||
- To further document design decisions of the system and the whole theoretical analysis behind our decisions, **overleaf** latex documents will be used. | ||
|
||
## Doxygen Setup | ||
|
||
In order to help future developers start contributing to this project, code should be easy to read and staightforward. However, this is easier said than done. For this reason, it is helpful to use a documentation tool to document the code developed. Doxygen is the de-fact tool for documentation in C++. To use it you should: | ||
- [Install doxygen](https://www.doxygen.nl/download.html) in your machine (virtual machine in this case) | ||
- Download | ||
- Follow the compilation and installation instructions in the manual | ||
- Create doxygen file in the project home directory | ||
- Run ```doxygen -g``` on the command line | ||
- Edit the file to your liking | ||
- Check the INPUT variable, for this is the one that defines what files will be read to generate the documentation | ||
- Comment the code with doxygen comments | ||
- Use [this vscode extension](https://marketplace.visualstudio.com/items?itemName=cschlosser.doxdocgen) for automatic doxygen documentation generation | ||
- Run ```doxygen``` on the root directory to generate documentation | ||
|
||
There is an example doxyfile [here](../assets/environment_setup_tutorial/Doxyfile.example). This doxyfile is configured to generate only latex documentation (as oposed to latex + html). | ||
|
||
The [example project](../assets/environment_setup_tutorial/training/) also contains a Doxyfile (it is the same as the one mentioned above) and a [script](../assets/environment_setup_tutorial/training/document.sh) that generates a pdf file + the latex output from doxygen. This script required the installation of [pdflatex](https://gist.github.com/rain1024/98dd5e2c6c8c28f9ea9d). The example project also contains commented code. | ||
|
||
## Doxygen Python | ||
|
||
After following the [Doxygen Setup guide](#doxygen-setup), you need to make a few changes to the default *Doxyfile* so that the Doxygen command correctly parses python code: | ||
|
||
- Enable `JAVADOC_AUTOBRIEF`, changing its value from `NO` to `YES`. This allows Doxygen to utilize Javadoc style briefs which look something like this: | ||
|
||
```py | ||
## | ||
# Brief summary description of the particular element. | ||
# | ||
# Detailed description of the particular element | ||
# that includes much more information. | ||
``` | ||
|
||
- To optimize the generated documentation for Java and Python based source code, change the `OPTIMIZE_OUTPUT_JAVA` to `YES`. | ||
|
||
- Tell Doxygen to generally extract all elements found in the source code, `EXTRACT_ALL` to `Yes`. | ||
|
||
- Note, the `EXTRACT_PRIVATE` and `EXTRACT_STATIC` settings can also be set to `YES` if you want to include private class members and static file members in the generated documentation as well. | ||
|
||
- Activate `HIDE_SCOPE_NAMES` to `YES`, hiding the scope name that is typically prepended to element names contained within that scope. | ||
|
||
- To sort the elements in alphabetical order instead of when they are declared, set `SORT_BRIEF_DOCS` to `YES`. | ||
|
||
These are just some enhancements to the extraction and readability of the generated documentation. In reality, only `OPTIMIZE_OUTPUT_JAVA` and `INPUT` are required. | ||
|
||
Supposing you have already changed the `INPUT` to find the Python source code, you are all set to start generating Python documentation with Doxygen. | ||
|
||
### Comment blocks in Python | ||
|
||
For Python there is a standard way of documenting the code using so called documentation strings `"""`. However when using these strings none of doxygen's special commands are supported and the text is shown as verbatim text. | ||
|
||
To have the doxygen's special commands and have the text as regular documentation instead of `"""` use `"""!` or set `PYTHON_DOCSTRING` to `NO` in the configuration file. | ||
|
||
```py | ||
"""! | ||
@package docstring | ||
Documentation for this module. | ||
More details. | ||
""" | ||
|
||
def func(): | ||
"""! | ||
Documentation for a function. | ||
More details. | ||
""" | ||
pass | ||
|
||
class PyClass: | ||
"""! | ||
Documentation for a class. | ||
More details. | ||
""" | ||
|
||
def __init__(self): | ||
"""! | ||
The constructor. | ||
@param self Param documentation | ||
""" | ||
self._memVar = 0 | ||
|
||
def PyMethod(self): | ||
"""! | ||
Documentation for a method. | ||
@return The return value | ||
""" | ||
pass | ||
``` |
Oops, something went wrong.