Drake exposes its version to downstream C++ as preprocessor macros, so that code can adapt to the Drake version at compile time, e.g., to handle API changes across releases.
Python users should instead obtain the version at runtime via importlib.metadata.version("drake").
Macros | |
| #define | DRAKE_VERSION_STRING |
| Drake's full version string. | |
| #define | DRAKE_VERSION_AT_LEAST(major, minor, patch, yyyymmdd) |
| Evaluates to true iff this build of Drake is at least as new as the given release. | |
| #define DRAKE_VERSION_AT_LEAST | ( | major, | |
| minor, | |||
| patch, | |||
| yyyymmdd ) |
Evaluates to true iff this build of Drake is at least as new as the given release.
It handles stable releases, nightly/snapshot builds, and unstamped builds:
The yyyymmdd argument is the nightly date that corresponds to the stable (major, minor, patch) release. Intended for use in preprocessor conditionals:
| #define DRAKE_VERSION_STRING |
Drake's full version string.
For a versioned release this looks like "1.51.1"; for a nightly or snapshot build like "0.0.20260721.143022+gitabc"; for an unstamped build it is "unknown".