You are welcome to contribute to project Apollo. To contribute to apollo, you have to agree with the Apollo individual contributor license agreement.
You can follow the standard github approach to contribute code. There are issues with label "help wanted" that are best to get started. If you decided to work on an issue, you can leave a message in that issue to let other people know that you are working on it.
Before sending your pull request for review, make sure your changes follow the coding style, license and testing guidelines.
For each new file, please include a license at the top of the file.
-
C++ code License example adapter.h;
-
Python code License example diagnostics.py;
-
Bash code License example apollo_base.sh;
Please include unit tests for the contributed code to prove that your code works correctly,
and make sure that your code does not break existing tests. Test files are always ended with test.cc
, and the test target names in BUILD file are always ended with test
.
Here is an example test file adapter_test.cc.
You can use command bash apollo.sh test
to run all unit tests.
-
C/C++ coding style: Apollo adopted the Google C++ Style Guide. Make sure your code conforms to this style guide. You can use command
bash apollo.sh check
to check if your code has any style problem. -
Python coding style: Apollo adopted the Google Python Style Guide. You can use the yapf command
yapf -i --style='{based_on_style: google}' foo.py
to format a file foo.py. -
BUILD coding style : you can use command
bash apollo.sh buildify
to format your BUILD files before submit.
If your code is not straightforward for other contributors to understand, it is recommended to implement the code in a clear and efficient way, and provide sufficient documentation.
Apollo uses doxygen to help generate formatted API Document with command bash apollo.sh doc
.
Document your code following this guide How to document code.
The first line of commit message should be a one-line summary of the change. A paragraph can be added following the summary to clearly explain the details of the change. If your code fixed a issue, add the issue number. The following is a commit message example:
Replace algorithm A with algorithm B in apollo/modules/control.
Algorithm B is faster than A because it uses binary search. The runtime is reduced from O(N) to O(log(N)).
Fixes #1234