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

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