pydrake.common.AddResourceSearchPath(search_path: unicode) → None

Adds a path in which resources are searched in a persistent variable. Paths are accumulated each time this function is called. It is searched after the path given by the environment variable but before the path that can be found with the sentinel .drake-resource-sentinel. This can be used to find data in installed distributions of drake (or in pydrake).

Raises:RuntimeError if the given path is not absolute.
pydrake.common.FindResourceOrThrow(resource_path: unicode) → unicode

Convenient wrapper for querying FindResource(resource_path) followed by FindResourceResult::get_absolute_path_or_throw().

pydrake.common.GetDrakePath() → unicode

Returns the fully-qualified path to the root of the drake source tree.

pydrake.common.GetResourceSearchPaths() → List[unicode]

Gets current root directory value from a persistent variable.

class pydrake.common.RandomDistribution

Drake supports explicit reasoning about a few carefully chosen random distributions.


kExponential : < Vector elements are independent and drawn from an

kUniform : < Vector elements are independent and uniformly distributed

kGaussian : < Vector elements are independent and drawn from a

__init__(self: pydrake.common._module_py.RandomDistribution, arg0: int) → None
kExponential = RandomDistribution.kExponential
kGaussian = RandomDistribution.kGaussian
kUniform = RandomDistribution.kUniform

(self – handle) -> str

class pydrake.common.RandomGenerator

Defines the implementation of the stdc++ concept UniformRandomBitGenerator to be used in Drake. This is provided as a work-around to enable the use of the generator in virtual methods (which cannot be templated on the generator type) of system classes.


This is an alias for mt19937, 32-bit Mersenne Twister by Matsumoto and Nishimura, 1998. See for more information.

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: pydrake.common._module_py.RandomGenerator) -> None

Default constructor. Seeds the engine with the default_seed.

  1. __init__(self: pydrake.common._module_py.RandomGenerator, arg0: int) -> None

Constructs the engine and initializes the state with a given value.

pydrake.common.set_assertion_failure_to_throw_exception() → None

Set Drake’s assertion failure mechanism to be exceptions

pydrake.common.temp_directory() → unicode

Returns a directory location suitable for temporary files.


The value of the environment variable TEST_TMPDIR if defined or otherwise ${TMPDIR:-/tmp}/robotlocomotion_drake_XXXXXX where each X is replaced by a character from the portable filename character set. Any trailing / will be stripped from the output.

  • RuntimeError If the path referred to by TEST_TMPDIR or
  • ${TMPDIR – -/tmp}/robotlocomotion_drake_XXXXXX cannot be created,
  • does not exist, or is not a directory.
pydrake.common.trigger_an_assertion_failure() → None

Trigger a Drake C++ assertion failure