---
title: Drake v0.31.0
date: 2021-06-23
released: 2021-06-23
---

# Announcements

* This release brings minor but notable improvements to performance,
documentation, and error reporting.
* New features include SDFormat loading improvements and point cloud
visualization.

# Breaking changes since v0.30.0

* Any direct subclasses of `SolverInterface` need to implement the new
`ExplainUnsatisfiedProgramAttributes` ([#15028][_#15028])
* Systems now check their Contexts ([#15030][_#15030], [#15102][_#15102],
[#15098][_#15098], [#15181][_#15181], [#15129][_#15129])
    * This change alters the semantics of classes such as Context that are
    closely tied to individual System objects. In the unlikely event that you
    have implemented methods that create, destroy, or repurpose such objects,
    you will need to follow the
    [system compatibility interface concept](https://drake.mit.edu/doxygen_cxx/group__system__compatibility.html).
Although this is formally a breaking change without deprecation, we do not expect that it will affect any downstream users in practice.
* SDFormat 1.8 ([#15099][_#15099], [#15208][_#15208]):
    * Models nested via the `<include>` tag are no longer flattened,
which means each included model will have its own model instance.
    * `drake::multibody::Parser::AddAllModelsFromFile` now returns all added models including nested models Note: This does not use a custom parser for URDFs via libsdformat's Interface API, and thus may incur unexpected behavior when including URDF files from SDFormat pending the full resolution of [#14295](https://github.com/RobotLocomotion/drake/issues/14295).

# Changes since v0.30.0

## Dynamical Systems

<!-- <relnotes for systems go here> -->

New features

* Added compatibility checks between `System`s and their `Context` (and constituent elements) ([#15030][_#15030], [#15102][_#15102], [#15098][_#15098], [#15181][_#15181], [#15129][_#15129])
* Add `DiagramBuilder::IsConnectedOrExported` ([#15096][_#15096])
* Add preliminary `AutoDiffXd` support to `RandomSource` ([#15092][_#15092])
* Add `LinearTransformDensity` ([#15116][_#15116], [#15189][_#15189])
* Add `SystemScalarConverter::Remove()` ([#15159][_#15159], [#15211][_#15211])

Fixes

* Remove inner loop heap allocations ([#15067][_#15067], [#15081][_#15081], [#15101][_#15101], [#15118][_#15118])
* Rephrase LeafSystem cache entry to avoid type hasher warning ([#15085][_#15085])

## Mathematical Program

<!-- <relnotes for solvers go here> -->

New features

* Add virtual `SolverInterface::ExplainUnsatisfiedProgramAttributes` for more detailed error messages ([#15028][_#15028])
* Add `is_convex` flag for constructing QuadraticCost ([#15043][_#15043])
* Enable Solver error messages to indicate which cost is non-convex ([#15059][_#15059])
* Rename `AddL2NormCost` to `Add2NormSquaredCost` ([#15134][_#15134])

Fixes

* Improve documentation of `available()` vs `enabled()` ([#15114][_#15114], [#15152][_#15152])
* Ensure that `GetAllConstraints()` includes exponential cone constraints; before, they were excluded ([#15180][_#15180])

## Multibody Dynamics

<!-- <relnotes for geometry,multibody go here> -->

New features

* Make `PackageMap` copy/move/assignable, allow registering duplicate `(package, path)` pairs, admit composition via `PackageMap::AddMap`, add `PackageMap::GetPackageNames` to enumerate registered package names ([#15064][_#15064])
* Make documentation and implementation of `CalcCenterOfMassPositionInWorld()` and `CalcCenterOfMassTranslationalVelocityInWorld()` consistent with `CalcTotalMass()` ([#15054][_#15054])
* Add support for parsing acceleration limits for some joints in URDF and SDFormat ([#15122][_#15122])
* Add support for SDFormat 1.8 model composition ([#15099][_#15099], [#15208][_#15208])
* Implement `DoCalcImplicitTimeDerivativesResidual` for `MultibodyPlant` ([#15048][_#15048])

Fixes

* Improve error messages on `MultibodyPlant` element lookups ([#15083][_#15083])

## Tutorials and examples

<!-- <relnotes for examples,tutorials go here> -->

New features

* Add tutorial showing derivatives of basic MultibodyPlant computations w.r.t.
mass ([#15103][_#15103])
* Optionally publish point clouds in `manipulation_station` simulation ([#14991][_#14991])

Fixes

* In `quadratic_program` tutorial, mention `is_convex` flag ([#15077][_#15077])
* Remove uses of `SolverType` in examples ([#15214][_#15214])
* Fix the Jaco example to work on real hardware (not just sim) ([#15203][_#15203])

## Miscellaneous features and fixes

<!-- <relnotes for common,math,lcm,lcmtypes,manipulation,perception go here> -->

* Add `AbstractValue::Make<T>()` overload for default construction ([#15209][_#15209])
* Add `Vector6d<T>` to `eigen_types` ([#15192][_#15192])
* Add `ostream<<` operator for `RollPitchYaw` and `RigidTransform` ([#14910][_#14910])
* Add template specializations for several `Eigen::numext` functions ([#15065][_#15065])
* Add AVX support for inverse-rotation matrix times rotation matrix ([#15073][_#15073])
* Add AVX functions for transform composition ([#15119][_#15119])
* Add PointCloudToLcm system ([#14990][_#14990])

## pydrake bindings

<!-- <relnotes for bindings go here> -->

New features

* None

Fixes

* In pydrake.all, prefer pydrake.math over pydrake.symbolic ([#15052][_#15052])

Newly bound

* pydrake.solvers.mathematicalprogram.AddLinearMatrixInequalityConstraint ([#15146][_#15146]
* pydrake.solvers.mathematicalprogram.LinearMatrixInequalityConstraint ([#15146][_#15146]
* pydrake.solvers.mathematicalprogram.MathematicalProgram.AddExponentialConeConstraint ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.AddLinearCost(a, vars) ([#15127][_#15127])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.AddPositiveDiagonallyDominantMatrixConstraint ([#15150][_#15150])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.AddScaledDiagonallyDominantMatrixConstraint ([#15150][_#15150])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.Clone ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.FindIndeterminateIndex ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.NewEvenDegreeNonnegativePolynomial ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.`__copy__` ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.`__deepcopy__` ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.decision_variable(i) ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.linear_complementarity_constraints ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.linear_matrix_inequality_constraints.exponential_cone_constraints ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.lorentz_cone_constraints ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.num_indeterminates ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.positive_semidefinite_constraints, ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.rotated_lorentz_cone_constraints ([#15167][_#15167])
* pydrake.solvers.mathematicalprogram.SolverInterface.enabled ([#15107][_#15107])
* pydrake.symbolic.Monomial * float, float * pydrake.symbolic.Monomial ([#15138][_#15138])
* pydrake.symbolic.Monomial.`__init__`() ([#15136][_#15136])
* pydrake.symbolic.TaylorExpand ([#15185][_#15185])
* pydrake.symbolic.dreal.DrealSolver ([#15215][_#15215])
* pydrake.systems.primitives.LinearTransformDensity ([#15166][_#15166])

## Build system

<!-- <relnotes for cmake,doc,setup,third_party,tools go here> -->

* When using `setup_drake_colab`, the `build=` argument is now required
([#14482][_#14482])
* Add more documentation about using releases ([#14482][_#14482])
* Remove compiled Python files when building VTK binaries ([#15171][_#15171])
* Document Drake's dependence on AVX2 and FMA instructions ([#15165][_#15165])
* Allow `robotlocomotion/director` brew tap to change default branch name to main ([#15202][_#15202])
* Stop installing `geometry` headers that depended on non-installed third-party header files (`fcl`) ([#15070][_#15070])

## Build dependencies

<!-- Manually relocate any "Upgrade foo_external to latest" lines to here. -->

* Upgrade recommended Bazel version to 4.1 ([#15086][_#15086])
* Upgrade `dreal` to latest release 4.21.06.2 ([#15212][_#15212])
* Upgrade `ghc_filesystem` to latest release 1.5.6 ([#15109][_#15109])
* Upgrade `googlebenchmark` to latest release 1.5.4 ([#15110][_#15110])
* Upgrade `intel_realsense_ros` to latest release 2.3.0 ([#15113][_#15113])
* Upgrade `ros_xacro` to latest release 1.13.11 ([#15111][_#15111])
* Upgrade `tinyobjloader` to latest commit ([#15112][_#15112])

## Newly-deprecated APIs

* Any LeafSystem port declaration overloads that do not specify a name
(`drake::systems::LeafSystem::Declare*Port`,
`pydrake.systems.LeafSystem.Declare*Port`) ([#15179][_#15179],
[#15182][_#15182])
* drake::math::ComputeBasisFromAxis ([#15154][_#15154])
* drake::solvers::MathematicalProgram::AddL2NormCost ([#15134][_#15134])
* drake::systems::LeafSystem::DeclareCacheEntry ([#15197][_#15197])
    * This is not decorated as deprecated in C++, but will become protected on
    or after 2021-10-01.
* pydrake.math.ComputeBasisFromAxis ([#15154][_#15154])
* pydrake.solvers.mathematicalprogram.MathematicalProgram.AddL2NormCost ([#15134][_#15134])

## Removal of deprecated items

* pydrake.common.ToleranceType.absolute ([#15108][_#15108])
* pydrake.common.ToleranceType.relative ([#15108][_#15108])

# Notes


This release provides [pre-compiled binaries](https://github.com/RobotLocomotion/drake/releases/tag/v0.31.0) named
``drake-20210623-{bionic|focal|mac}.tar.gz``. See [Stable Releases](/from_binary.html#stable-releases) for instructions on how to use them.

Drake binary releases incorporate a pre-compiled version of [SNOPT](https://ccom.ucsd.edu/~optimizers/solvers/snopt/) as part of the
[Mathematical Program toolbox](https://drake.mit.edu/doxygen_cxx/group__solvers.html). Thanks to
Philip E. Gill and Elizabeth Wong for their kind support.

<!-- <begin issue links> -->
[_#14482]: https://github.com/RobotLocomotion/drake/pull/14482
[_#14910]: https://github.com/RobotLocomotion/drake/pull/14910
[_#14990]: https://github.com/RobotLocomotion/drake/pull/14990
[_#14991]: https://github.com/RobotLocomotion/drake/pull/14991
[_#15028]: https://github.com/RobotLocomotion/drake/pull/15028
[_#15030]: https://github.com/RobotLocomotion/drake/pull/15030
[_#15043]: https://github.com/RobotLocomotion/drake/pull/15043
[_#15048]: https://github.com/RobotLocomotion/drake/pull/15048
[_#15052]: https://github.com/RobotLocomotion/drake/pull/15052
[_#15054]: https://github.com/RobotLocomotion/drake/pull/15054
[_#15059]: https://github.com/RobotLocomotion/drake/pull/15059
[_#15064]: https://github.com/RobotLocomotion/drake/pull/15064
[_#15065]: https://github.com/RobotLocomotion/drake/pull/15065
[_#15067]: https://github.com/RobotLocomotion/drake/pull/15067
[_#15070]: https://github.com/RobotLocomotion/drake/pull/15070
[_#15073]: https://github.com/RobotLocomotion/drake/pull/15073
[_#15077]: https://github.com/RobotLocomotion/drake/pull/15077
[_#15081]: https://github.com/RobotLocomotion/drake/pull/15081
[_#15083]: https://github.com/RobotLocomotion/drake/pull/15083
[_#15085]: https://github.com/RobotLocomotion/drake/pull/15085
[_#15086]: https://github.com/RobotLocomotion/drake/pull/15086
[_#15092]: https://github.com/RobotLocomotion/drake/pull/15092
[_#15096]: https://github.com/RobotLocomotion/drake/pull/15096
[_#15098]: https://github.com/RobotLocomotion/drake/pull/15098
[_#15099]: https://github.com/RobotLocomotion/drake/pull/15099
[_#15101]: https://github.com/RobotLocomotion/drake/pull/15101
[_#15102]: https://github.com/RobotLocomotion/drake/pull/15102
[_#15103]: https://github.com/RobotLocomotion/drake/pull/15103
[_#15107]: https://github.com/RobotLocomotion/drake/pull/15107
[_#15108]: https://github.com/RobotLocomotion/drake/pull/15108
[_#15109]: https://github.com/RobotLocomotion/drake/pull/15109
[_#15110]: https://github.com/RobotLocomotion/drake/pull/15110
[_#15111]: https://github.com/RobotLocomotion/drake/pull/15111
[_#15112]: https://github.com/RobotLocomotion/drake/pull/15112
[_#15113]: https://github.com/RobotLocomotion/drake/pull/15113
[_#15114]: https://github.com/RobotLocomotion/drake/pull/15114
[_#15116]: https://github.com/RobotLocomotion/drake/pull/15116
[_#15118]: https://github.com/RobotLocomotion/drake/pull/15118
[_#15119]: https://github.com/RobotLocomotion/drake/pull/15119
[_#15122]: https://github.com/RobotLocomotion/drake/pull/15122
[_#15127]: https://github.com/RobotLocomotion/drake/pull/15127
[_#15129]: https://github.com/RobotLocomotion/drake/pull/15129
[_#15134]: https://github.com/RobotLocomotion/drake/pull/15134
[_#15136]: https://github.com/RobotLocomotion/drake/pull/15136
[_#15138]: https://github.com/RobotLocomotion/drake/pull/15138
[_#15146]: https://github.com/RobotLocomotion/drake/pull/15146
[_#15150]: https://github.com/RobotLocomotion/drake/pull/15150
[_#15152]: https://github.com/RobotLocomotion/drake/pull/15152
[_#15154]: https://github.com/RobotLocomotion/drake/pull/15154
[_#15159]: https://github.com/RobotLocomotion/drake/pull/15159
[_#15165]: https://github.com/RobotLocomotion/drake/pull/15165
[_#15166]: https://github.com/RobotLocomotion/drake/pull/15166
[_#15167]: https://github.com/RobotLocomotion/drake/pull/15167
[_#15171]: https://github.com/RobotLocomotion/drake/pull/15171
[_#15179]: https://github.com/RobotLocomotion/drake/pull/15179
[_#15180]: https://github.com/RobotLocomotion/drake/pull/15180
[_#15181]: https://github.com/RobotLocomotion/drake/pull/15181
[_#15182]: https://github.com/RobotLocomotion/drake/pull/15182
[_#15185]: https://github.com/RobotLocomotion/drake/pull/15185
[_#15189]: https://github.com/RobotLocomotion/drake/pull/15189
[_#15192]: https://github.com/RobotLocomotion/drake/pull/15192
[_#15197]: https://github.com/RobotLocomotion/drake/pull/15197
[_#15202]: https://github.com/RobotLocomotion/drake/pull/15202
[_#15203]: https://github.com/RobotLocomotion/drake/pull/15203
[_#15208]: https://github.com/RobotLocomotion/drake/pull/15208
[_#15209]: https://github.com/RobotLocomotion/drake/pull/15209
[_#15211]: https://github.com/RobotLocomotion/drake/pull/15211
[_#15212]: https://github.com/RobotLocomotion/drake/pull/15212
[_#15214]: https://github.com/RobotLocomotion/drake/pull/15214
[_#15215]: https://github.com/RobotLocomotion/drake/pull/15215
<!-- <end issue links> -->

<!--
  Current oldest_commit 3e86d88df36f1a7d34cb5663e5f404eb43ce4e42 (exclusive).
  Current newest_commit 248db432faa66d19e0bb24c2fe539ec5bf58ea7f (inclusive).
-->
