For Developers

Introduction

If you have improvements to Drake, send us your pull requests!

Our standard workflow is to fork Drake’s official Github repository into your own Github account and then push your changes into a branch on your fork. Once you believe your code is ready to be merged into Drake’s primary repository, open a pull request via the Github website. Your code will then undergo an interactive review process and Continuous Integration (CI) tests before it is merged into Drake’s primary repository.

Drake’s CI service runs on all pull requests each time they are submitted and updated. Pull requests cannot be merged into master unless all unit tests pass on all supported platform configurations.

Drake’s CI server also runs continuously on Drake’s primary master branch using an even more comprehensive set of unit tests. If problems are detected on this branch, the build cop will revert the PRs that most likely caused the problem. To increase the likelihood that your pull requests pass CI tests and are not reverted, you can run the unit tests locally. Instructions for how to do that are provided here. Note, however, that there are many computationally-demanding tests and running the entire test suite can take several hours depending on your machine.

We would like to hear about your success stories if you’ve used Drake in your own projects. Please consider contributing to our Drake Gallery by editing drake/doc/gallery.rst and submitting a pull request with the update!

Licensing

Important note: Drake is an open source project licensed under extremely flexible terms intended to encourage use by anyone, for any purpose. When you make a contribution to the Drake project, you are agreeing to do so under those same terms.

Supported Configurations

The following table shows the configurations and platforms that Drake officially supports. Supported configurations are tested in continuous integration. All other configurations are provided on a best-effort basis.

For CMake builds, the “Unix Makefiles” and “Ninja” CMake generators are supported.

For CMake builds, the supported version of MATLAB is R2015b.

For CMake builds, minimal configuration is defined as the minimal required externals from the superbuild. This is configured by turning off all externals using ccmake or cmake-gui except for WITH_EIGEN, WITH_GOOGLETEST, and WITH_GFLAGS, which should be set to ON.

Almost all of Drake and Drake’s externals are supported on Bazel. “Superbuild Deps” are not meaningful in the context of Bazel, since there is no configurable superbuild. MATLAB is not supported on Bazel, and there are no plans to add support.

Operating System Build Systems Compilers Superbuild Deps Build
Ubuntu 14.04 LTS (“Trusty”)
CMake 3.5.2
Bazel 0.5.2
GCC 4.9
Java 1.8
Minimal Debug
Release
Default Debug
Release
Default + MATLAB Release
Clang 3.9
Java 1.8
Default Debug
Release
Ubuntu 16.04 LTS (“Xenial”)
CMake 3.5.1
Bazel 0.5.2
GCC 5.4
Java 1.8
Default Debug
Release
Clang 3.9
Java 1.8
Default Debug
Release
OS X 10.11 (“El Capitan”)
CMake 3.5.2
Bazel 0.5.2
Apple Clang 7.0
Java 1.8
Minimal Debug
Release
Default Debug
Release

Code Review

Review Process

For complex changes, especially those that will span multiple PRs, please open a GitHub issue and solicit design feedback before you invest a lot of time in code.

Before your submit a pull request, please consult the Code Review Checklist, where a list of the most frequent problems are collected.

Be prepared to engage in active code review on your pull requests. The Drake code review process has two phases: feature review and platform review. You are responsible for finding reviewers, and for providing them the information they need to review your change effectively. If a reviewer asks you for more information, that is a sign you should add more documentation to your PR.

A PR generally should not include more than 750 added or changed lines (the green +### number as reported by github), and must not include more than 1500 lines, with the following exemptions:

  • Data files do not count towards the line limit.
  • Machine-generated changes do not count towards the line limit.
  • Files in Special Directories do not count towards the line limit.
  • This rule may be overridden by agreement of at least two platform reviewers (listed below).

The utility drake/tools/prstat will report the total added or changed lines, excluding files that are easily identified to meet the exemptions above.

We use https://reviewable.io for code reviews. You can sign in for free with your GitHub identity. Before your first code review, please take a look at Tips for Participating In Drake Code Reviews using reviewable.io.

Feature Review. After creating your pull request, assign it to someone else on your team for feature review. Choose the person most familiar with the context of your pull request. This reviewer is responsible for protecting your team by inspecting for bugs, for test coverage, and for alignment with the team’s goals. During this review, you and your reviewer should also strive to minimize the number of changes that will be necessary in platform review.

Platform Review. After your feature reviewer has signed off on your change, reassign it to a Drake owner for platform review. The owner will inspect for architectural compatibility, stability, performance, test coverage, and style.

The following GitHub users are Drake owners. If possible, seek platform review from an owner who has previously reviewed related changes. Shared context will make the review faster.

  • @EricCousineau-TRI (Toyota Research Institute)
  • @ggould-tri (Toyota Research Institute)
  • @jwnimmer-tri (Toyota Research Institute)
  • @psiorx (MIT)
  • @sammy-tri (Toyota Research Institute)
  • @SeanCurtis-TRI (Toyota Research Institute)
  • @sherm1 (Toyota Research Institute)
  • @soonho-tri (Toyota Research Institute)
  • @RussTedrake (MIT / Toyota Research Institute)

Merge. If you have write access to RobotLocomotion/drake, a green “Merge Pull Request” button will appear when your change is fully reviewed and passes CI. You may click it to merge your PR. If you do not have write access, or if you believe that status checks are failing for inconsequential reasons, ask your platform reviewer to perform the merge for you.

After Merge. If your PR breaks continuous integration, the Build Cop will contact you to work out a resolution.