Skip to content

Contributing to SegMap

rdube edited this page Jul 26, 2018 · 1 revision

Coding style

  • We use the Google-C++ code style (https://google.github.io/styleguide/cppguide.html).
  • To install the Google-C++ style sheet in Eclipse, download the eclipse-cpp-google-style.xml file from the http://code.google.com/p/google-styleguide/ repository. In Eclipse, under Window/Preferences select C/C++/Code Style/Formatter. Import the settings file by selecting Import.
  • For naming the methods we use camelCase and not CamelCase.
  • Each line of text in the code should be at most 100 characters long.

Commenting style

  • Every comment MUST start with a capital letter and end with a dot.

Function arguments

  • We adopt the space after & or * when passing argument eg. copyElement(const Element& element) or modifyElement(Element* element)

Header include guide

We use the following rules for including headers.

In .cpp files, put:

  1. The corresponding header
  2. A block of system includes
  3. A block of includes from non-system packages (3rd party, ros, Eigen, etc)
  4. A block of includes from this package

Separate the blocks by a vertical space and alphabetize within each block. For example, for a file foo.cpp in my_package:

#include "my_package/foo.h" 

#include <memory>
#include <pthread.h>
#include <string>

#include <Eigen/Core>
#include <glog/logging.h>

#include "my_package/bar.h"
#include "my_package/baz.h"

Header file includes should follow the same structure.

Git workflow

  • Follow the pull-request and review work-flow (never push directly to master).
  • Prefer pull-requests which are focused on a particular feature/fix.

Hints for efficient development

Extra coding information