Adding Model Artifacts in Pull Requests
Model artifacts have the potential to be very large, and we should avoid committing large files directly to Git.
If your model’s files are small enough (<100KB in a given directory), then you may add them directly to Git in a PR to master.
Otherwise, you should add the large files to RobotLocomotion/models.
Before you decide to submit models, please ensure that you have tests that will need them. Do not submit a PR that adds models but has zero intent to use them, as Drake is not a model repository.
See below for the suggested workflow.
Develop Changes Locally
- Clone
RobotLocomotion/modelslocally. - Create a Git branch in your local checkouts of both
modelsanddrake. - Update
drake/tools/workspace/drake_models/repository.bzlto point to yourmodelscheckout usinggithub_archive(..., local_repository_override = <path>). - Incorporate the new
modelsfiles into a DrakeBUILD.bazelfile where they are needed by addingdata = ["@drake_models//:some_subdir"]to the demo program or benchmark that uses them.- Do not ask the build system to “install” any files from
drake_models; they are already available via remote fetching. In particular, don’t add anyinstall()rule for them, nor add them to anyfilegroup()that is already being installed.
- Do not ask the build system to “install” any files from
- Ensure your tests pass under
bazel test.
Submit Changes in a Pull Request
- Push your changes to your fork of
RobotLocomotion/models. Make a PR. - Update
drake/tools/workspace/drake_models/repository.bzlto use the commit you pushed. - Submit a PR to Drake, and add a self-blocking discussion thread, such as
"Working temporary SHA1 until the models PR <LINK> is merged.", where<LINK>references yourmodelsPR. - Get review on your Drake PR first. Once it is generally approved, then
request review for your
modelsPR. - Once both PRs are approved:
- Merge your
modelsPR. - Update
drake/tools/workspace/drake_models/repository.bzlto the latest merge commit onmasterforRobotLocomotion/models. - Merge your
drakePR.
- Merge your