Ch. 14 - Drake
is the main software toolbox that we use for this text, which in fact originated in a large part due to the MIT Underactuated Robotics course. The website is the main source for information and documentation. The goal of this chapter is to provide any additional information that can help you get up and running with the examples and exercises provided in these notes.
Pydrake
is primarily a C++ library, with rigorous coding standards and a maturity level intended to support even professional applications in industry. In order to provide a gentler introduction, and to facilitate rapid prototyping, I've written these notes exclusively in python, using Drake's python bindings (pydrake). These bindings are less mature than the C++ backend; your feedback (and even contributions) are very welcome. It is still improving rapidly.
In particular, while the C++ API documentation is excellent, the autogenerated python docs are still a work in progress. I currently recommend using the C++ documentation to find what you need, then checking the Python documentation only if you need to understand how the class or method is spelled in pydrake.
There are also a number of tutorials in that can help you get started.
Online Jupyter Notebooks
I will provide nearly all examples and exercises in the form of a Jupyter Notebook so that we can leverage the fantastic and relatively recent availability of (free) cloud resources.
Running on Google Colab
Follow an "Open in Colab" link beside an example and run the cells in order. The first code cell installs the required packages. Save a copy in Google Drive if you want to keep your edits.
Many notebooks use Meshcat for interactive visualizations. After running
StartMeshcat(), click "Open Meshcat in a separate window" and
keep the notebook open while using the viewer. To embed the viewer beside
your current cell, run:
from manipulation.meshcat_utils import DisplayMeshcat
DisplayMeshcat(meshcat)Enabling licensed solvers
You can enable more powerful solvers for
MathematicalProgram if you have a license (most are free for
academics). Please see the MOSEK and Gurobi documentation
for instructions.
Running on your own machine
As you get more advanced, you will likely want to run (and extend) these examples on your own machine. On platforms/configurations that Drake supports (the latest two releases of Mac and Ubuntu using the system default python versions). The simplest installation is via pip; I would typically recommend using a virtual environment:
python3 -m venv venv
source venv/bin/activate
python -m pip install "manipulation[all]" jupyterlab
Then download notebooks from the book directory on GitHub
and run them with jupyter lab (or develop your own notebooks).
The website also has a number of alternative installation options,
including precompiled binaries and Docker instances. If you build from
source (awesome!), then make sure you also build the python bindings.
Finally, make sure you have the Drake installation in your
PYTHONPATH.
If you want to download all of the notebooks at once, you can git clone the course notes
repository. You'll likely want to start from the repository's root directory.
Then launch your notebook with:
jupyter notebookThe examples for each chapter that has them will be in a .ipynb file
right alongside the chapter's html file, and the notebook exercises are
all located in the exercises subdirectories.
Getting help
If you have trouble with , please follow the advice here. If you have trouble with the manipulation repo, you can check for known issues (and potentially file a new one) here.