Drake
drake Namespace Reference

Namespaces

 assert
 
 automotive
 
 benchmarks
 
 bouncing_ball
 
 common
 
 detail
 
 examples
 
 geometry
 
 internal
 
 lcm
 
 logging
 
 maliput
 
 manipulation
 
 math
 
 multibody
 
 nice_type_name_test
 
 parsers
 
 perception
 
 pydrake
 
 solvers
 
 symbolic
 
 systems
 
 test
 
 tools
 
 trajectories
 
 util
 

Classes

class  copyable_unique_ptr
 A smart pointer with deep copy semantics. More...
 
struct  DelegatingHasher
 An adapter that forwards the HashAlgorithm::operator(data, length) function concept into a runtime-provided std::function of the same signature. More...
 
struct  dummy_value
 Provides a "dummy" value for a ScalarType – a value that is unlikely to be mistaken for a purposefully-computed value, useful for initializing a value before the true result is available. More...
 
struct  dummy_value< Eigen::AutoDiffScalar< DerType > >
 Specializes common/dummy_value.h. More...
 
struct  dummy_value< int >
 
struct  dummy_value< symbolic::Expression >
 Specializes common/dummy_value.h. More...
 
class  EigenPtr
 This wrapper class provides a way to write non-template functions taking raw pointers to Eigen objects as parameters while limiting the number of copies, similar to Eigen::Ref. More...
 
struct  EigenSizeMinPreferDynamic
 EigenSizeMinPreferDynamic<a, b>::value gives the min between compile-time sizes a and b. More...
 
struct  EigenSizeMinPreferFixed
 EigenSizeMinPreferFixed is a variant of EigenSizeMinPreferDynamic. More...
 
class  FindResourceResult
 Models the outcome of drake::FindResource. More...
 
struct  is_eigen_nonvector_expression_double_pair
 
struct  is_eigen_nonvector_of
 
struct  is_eigen_scalar_same
 
struct  is_eigen_type
 
struct  is_eigen_vector
 
struct  is_eigen_vector_expression_double_pair
 
struct  is_eigen_vector_of
 
struct  is_numeric
 This traits type is deprecated, and will be removed. More...
 
struct  is_numeric< symbolic::Expression >
 Specializes is_numeric to be false for symbolic::Expression type. More...
 
struct  MultiplyEigenSizes
 MultiplyEigenSizes<a, b> gives a * b if both of a and b are fixed sizes. More...
 
class  never_destroyed
 Wraps an underlying type T such that its storage is a direct member field of this object (i.e., without any indirection into the heap), but unlike most member fields T's destructor is never invoked. More...
 
class  NiceTypeName
 Obtains canonicalized, platform-independent, human-readable names for arbitrarily-complicated C++ types. More...
 
class  reset_after_move
 Type wrapper that performs value-initialization on the wrapped type, and guarantees that when moving from this type that the donor object is reset to its value-initialized value. More...
 
class  reset_on_copy
 Type wrapper that performs value-initialization on copy construction or assignment. More...
 
struct  scalar_predicate
 A traits struct that describes the return type of predicates over a scalar type (named T). More...
 
struct  SortedPair
 This class is similar to the std::pair class. More...
 
struct  template_single_tag
 Provides a tag for single-parameter templates. More...
 
struct  type_at
 Extracts the Ith type from a sequence of types. More...
 
struct  type_check_different_from
 Provides a check which returns whether T is different than U. More...
 
struct  type_pack
 Provides a tag to pass a parameter packs for ease of inference. More...
 
struct  type_tag
 Provides a tag to pass a type for ease of inference. More...
 
struct  type_visit_with_default
 Visit a type by constructing its default value. More...
 
struct  type_visit_with_tag
 Visits a type by construct a template tag's default value. More...
 
class  TypeSafeIndex
 A type-safe non-negative index class. More...
 
struct  uhash
 A hashing functor, somewhat like std::hash. More...
 

Typedefs

template<typename T >
using type_pack_extract = typename detail::type_pack_extract_impl< T >::type
 Extracts the inner template arguments (typename only) for a typename which is a template instantiation. More...
 
template<typename T >
using type_check_always_true = std::true_type
 Provides a check which will return true for any type. More...
 
template<typename T >
using negation = std::integral_constant< bool,!T::value >
 Provides backport of C++17 std::negation. More...
 
template<typename T >
using boolean = typename scalar_predicate< T >::type
 An alias for a boolean-like value, conditioned on the scalar type T. More...
 
using T = boolean< T >
 
template<typename T >
using optional = stx::optional< T >
 
using AutoDiffXd = Eigen::AutoDiffScalar< Eigen::VectorXd >
 An autodiff variable with a dynamic number of partials. More...
 
template<int num_vars>
using AutoDiffd = Eigen::AutoDiffScalar< Eigen::Matrix< double, num_vars, 1 > >
 An autodiff variable with num_vars partials. More...
 
template<int num_vars, int rows>
using AutoDiffVecd = Eigen::Matrix< AutoDiffd< num_vars >, rows, 1 >
 A vector of rows autodiff variables, each with num_vars partials. More...
 
typedef AutoDiffVecd< Eigen::Dynamic, Eigen::Dynamic > AutoDiffVecXd
 A dynamic-sized vector of autodiff variables, each with a dynamic-sized vector of partials. More...
 
template<typename Key , typename T >
using eigen_aligned_std_map = std::map< Key, T, std::less< Key >, Eigen::aligned_allocator< std::pair< Key const, T >>>
 A std::map that uses Eigen::aligned_allocator so that the contained types may be fixed-size Eigen values. More...
 
template<typename Key , typename T >
using eigen_aligned_std_unordered_map = std::unordered_map< Key, T, std::hash< Key >, std::equal_to< Key >, Eigen::aligned_allocator< std::pair< Key const, T >>>
 A std::unordered_map that uses Eigen::aligned_allocator so that the contained types may be fixed-size Eigen values. More...
 
template<typename T >
using eigen_aligned_std_vector = std::vector< T, Eigen::aligned_allocator< T >>
 A std::vector that uses Eigen::aligned_allocator so that the contained types may be fixed-size Eigen values. More...
 
template<typename Scalar >
using Vector1 = Eigen::Matrix< Scalar, 1, 1 >
 A column vector of size 1 (that is, a scalar), templated on scalar type. More...
 
using Vector1d = Eigen::Matrix< double, 1, 1 >
 A column vector of size 1 of doubles. More...
 
template<typename Scalar >
using Vector2 = Eigen::Matrix< Scalar, 2, 1 >
 A column vector of size 2, templated on scalar type. More...
 
template<typename Scalar >
using Vector3 = Eigen::Matrix< Scalar, 3, 1 >
 A column vector of size 3, templated on scalar type. More...
 
template<typename Scalar >
using Vector4 = Eigen::Matrix< Scalar, 4, 1 >
 A column vector of size 4, templated on scalar type. More...
 
template<typename Scalar >
using Vector6 = Eigen::Matrix< Scalar, 6, 1 >
 A column vector of size 6. More...
 
template<typename Scalar >
using VectorX = Eigen::Matrix< Scalar, Eigen::Dynamic, 1 >
 A column vector of any size, templated on scalar type. More...
 
template<typename Scalar >
using VectorUpTo6 = Eigen::Matrix< Scalar, Eigen::Dynamic, 1, 0, 6, 1 >
 A vector of dynamic size templated on scalar type, up to a maximum of 6 elements. More...
 
template<typename Scalar >
using RowVector2 = Eigen::Matrix< Scalar, 1, 2 >
 A row vector of size 2, templated on scalar type. More...
 
template<typename Scalar >
using RowVector3 = Eigen::Matrix< Scalar, 1, 3 >
 A row vector of size 3, templated on scalar type. More...
 
template<typename Scalar >
using RowVector4 = Eigen::Matrix< Scalar, 1, 4 >
 A row vector of size 4, templated on scalar type. More...
 
template<typename Scalar >
using RowVector6 = Eigen::Matrix< Scalar, 1, 6 >
 A row vector of size 6. More...
 
template<typename Scalar >
using RowVectorX = Eigen::Matrix< Scalar, 1, Eigen::Dynamic >
 A row vector of any size, templated on scalar type. More...
 
template<typename Scalar >
using Matrix2 = Eigen::Matrix< Scalar, 2, 2 >
 A matrix of 2 rows and 2 columns, templated on scalar type. More...
 
template<typename Scalar >
using Matrix3 = Eigen::Matrix< Scalar, 3, 3 >
 A matrix of 3 rows and 3 columns, templated on scalar type. More...
 
template<typename Scalar >
using Matrix4 = Eigen::Matrix< Scalar, 4, 4 >
 A matrix of 4 rows and 4 columns, templated on scalar type. More...
 
template<typename Scalar >
using Matrix6 = Eigen::Matrix< Scalar, 6, 6 >
 A matrix of 6 rows and 6 columns, templated on scalar type. More...
 
template<typename Scalar >
using Matrix2X = Eigen::Matrix< Scalar, 2, Eigen::Dynamic >
 A matrix of 2 rows, dynamic columns, templated on scalar type. More...
 
template<typename Scalar >
using Matrix3X = Eigen::Matrix< Scalar, 3, Eigen::Dynamic >
 A matrix of 3 rows, dynamic columns, templated on scalar type. More...
 
template<typename Scalar >
using Matrix4X = Eigen::Matrix< Scalar, 4, Eigen::Dynamic >
 A matrix of 4 rows, dynamic columns, templated on scalar type. More...
 
template<typename Scalar >
using Matrix6X = Eigen::Matrix< Scalar, 6, Eigen::Dynamic >
 A matrix of 6 rows, dynamic columns, templated on scalar type. More...
 
template<typename Scalar >
using MatrixX = Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic >
 A matrix of dynamic size, templated on scalar type. More...
 
template<typename Scalar >
using MatrixUpTo6 = Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic, 0, 6, 6 >
 A matrix of dynamic size templated on scalar type, up to a maximum of 6 rows and 6 columns. More...
 
template<typename Scalar >
using Quaternion = Eigen::Quaternion< Scalar >
 A quaternion templated on scalar type. More...
 
template<typename Scalar >
using AngleAxis = Eigen::AngleAxis< Scalar >
 An AngleAxis templated on scalar type. More...
 
template<typename Scalar >
using Isometry3 = Eigen::Transform< Scalar, 3, Eigen::Isometry >
 An Isometry templated on scalar type. More...
 
template<typename Scalar >
using Translation3 = Eigen::Translation< Scalar, 3 >
 A translation in 3D templated on scalar type. More...
 
template<typename Scalar >
using TwistVector = Eigen::Matrix< Scalar, kTwistSize, 1 >
 A column vector consisting of one twist. More...
 
template<typename Scalar >
using TwistMatrix = Eigen::Matrix< Scalar, kTwistSize, Eigen::Dynamic >
 A matrix with one twist per column, and dynamically many columns. More...
 
template<typename Scalar >
using SquareTwistMatrix = Eigen::Matrix< Scalar, kTwistSize, kTwistSize >
 A six-by-six matrix. More...
 
template<typename Scalar >
using WrenchVector = Eigen::Matrix< Scalar, 6, 1 >
 A column vector consisting of one wrench (spatial force) = [r X f; f], where f is a force (translational force) applied at a point P and r is the position vector from a point O (called the "moment center") to point P. More...
 
template<typename Scalar >
using SpatialForce = Eigen::Matrix< Scalar, 6, 1 >
 A column vector consisting of a concatenated rotational and translational force. More...
 
using Result = FindResourceResult
 
using DefaultHasher = detail::FNV1aHasher
 The default HashAlgorithm concept implementation across Drake. More...
 
using DefaultHash = drake::uhash< DefaultHasher >
 The default hashing functor, akin to std::hash. More...
 
template<typename T >
using is_cloneable = is_cloneable_detail::is_cloneable_helper< T, void >
 

Enumerations

enum  RandomDistribution { kUniform = 0, kGaussian = 1, kExponential = 2 }
 Drake supports explicit reasoning about a few carefully chosen random distributions. More...
 
enum  MatrixCompareType { absolute, relative }
 

Functions

template<template< typename... > class Tpl, typename... Ts>
Tpl< Ts... > type_bind (type_pack< Ts... >)
 Returns an expression (only to be used in decltype) for inferring and binding a parameter pack to a template. More...
 
template<class VisitWith = type_visit_with_default, template< typename > class Predicate = type_check_always_true, typename Visitor = void, typename... Ts>
void type_visit (Visitor &&visitor, type_pack< Ts... >={}, template_single_tag< Predicate >={})
 Visits each type in a type pack. More...
 
template<typename T >
constexpr size_t type_hash ()
 Provides short-hand for hashing a type. More...
 
template<typename DerType >
double ExtractDoubleOrThrow (const Eigen::AutoDiffScalar< DerType > &scalar)
 Returns the autodiff scalar's value() as a double. More...
 
template<typename DerType1 , typename DerType2 >
Eigen::AutoDiffScalar< typename Eigen::internal::remove_all< DerType1 >::type::PlainObject > if_then_else (bool f_cond, const Eigen::AutoDiffScalar< DerType1 > &x, const Eigen::AutoDiffScalar< DerType2 > &y)
 Provides if-then-else expression for Eigen::AutoDiffScalar type. More...
 
template<typename DerType , typename... Rest>
Eigen::AutoDiffScalar< typename Eigen::internal::remove_all< DerType >::type::PlainObject > cond (bool f_cond, const Eigen::AutoDiffScalar< DerType > &e_then, Rest...rest)
 Provides special case of cond expression for Eigen::AutoDiffScalar type. More...
 
void autodiffxd_make_coherent (const AutoDiffXd &donor, AutoDiffXd *recipient)
 Makes the derviatives of the recipient coherent with respect to those of the donor variable (see drake/common/autodiffxd.h). More...
 
void autodiffxd_make_coherent (const double &, double *)
 
void autodiffxd_make_coherent (const symbolic::Expression &, symbolic::Expression *)
 
double if_then_else (bool f_cond, double v_then, double v_else)
 Provides if-then-else expression for double. More...
 
template<typename Derived >
Derived::Scalar all (const Eigen::DenseBase< Derived > &m)
 Checks truth for all elements in matrix m. More...
 
template<typename Derived >
boolean< typename Derived::Scalar > all_of (const Eigen::MatrixBase< Derived > &m, const std::function< boolean< typename Derived::Scalar >(const typename Derived::Scalar &)> &pred)
 Checks if unary predicate pred holds for all elements in the matrix m. More...
 
template<typename Derived >
Derived::Scalar any (const Eigen::DenseBase< Derived > &m)
 Checks truth for at least one element in matrix m. More...
 
template<typename Derived >
boolean< typename Derived::Scalar > any_of (const Eigen::MatrixBase< Derived > &m, const std::function< boolean< typename Derived::Scalar >(const typename Derived::Scalar &)> &pred)
 Checks if unary predicate pred holds for at least one element in the matrix m. More...
 
template<typename Derived >
Derived::Scalar none (const Eigen::MatrixBase< Derived > &m)
 Checks that no elements of m are true. An empty matrix returns true. More...
 
template<typename Derived >
boolean< typename Derived::Scalar > none_of (const Eigen::MatrixBase< Derived > &m, const std::function< boolean< typename Derived::Scalar >(const typename Derived::Scalar &)> &pred)
 Checks if unary predicate pred holds for no elements in the matrix m. More...
 
template<typename T >
bool ExtractBoolOrThrow (const Bool< T > &b)
 Extracts a bool value from b or throws an exception if the extraction fails (i.e. More...
 
template<typename T >
std::enable_if_t<!std::is_same< typename Bool< T >::value_type, bool >::value, Bool< T > > operator&& (const Bool< T > &b1, const Bool< T > &b2)
 Provides logical AND operator (&&) between Bool<T> and Bool<T> when Bool<T>::value_type is not bool. More...
 
template<typename T >
std::enable_if_t<!std::is_same< typename Bool< T >::value_type, bool >::value, Bool< T > > operator&& (const typename Bool< T >::value_type &v1, const Bool< T > &b2)
 Provides logical AND operator (&&) between Bool<T>::value_type and Bool<T> when Bool<T>::value_type is not bool. More...
 
template<typename T >
std::enable_if_t<!std::is_same< typename Bool< T >::value_type, bool >::value, Bool< T > > operator&& (const Bool< T > &b1, const typename Bool< T >::value_type &v2)
 Provides logical AND operator (&&) between Bool<T> and Bool<T>::value_type when Bool<T>::value_type is not bool. More...
 
template<typename T >
std::enable_if_t<!std::is_same< typename Bool< T >::value_type, bool >::value, Bool< T > > operator|| (const Bool< T > &b1, const Bool< T > &b2)
 Provides logical OR operator (||) between Bool<T> and Bool<T> when Bool<T>::value_type is not bool. More...
 
template<typename T >
std::enable_if_t<!std::is_same< typename Bool< T >::value_type, bool >::value, Bool< T > > operator|| (const typename Bool< T >::value_type &v1, const Bool< T > &b2)
 Provides logical OR operator (||) between Bool<T>::value_type and Bool<T> when Bool<T>::value_type is not bool. More...
 
template<typename T >
std::enable_if_t<!std::is_same< typename Bool< T >::value_type, bool >::value, Bool< T > > operator|| (const Bool< T > &b1, const typename Bool< T >::value_type &v2)
 Provides logical OR operator (||) between Bool<T> and Bool<T>::value_type when Bool<T>::value_type is not bool. More...
 
template<typename T >
std::enable_if_t<!std::is_same< typename Bool< T >::value_type, bool >::value, Bool< T > > operator! (const Bool< T > &b)
 Provides logical NOT operator (!) when Bool<T>::value_type is not bool. More...
 
template<typename T >
T if_then_else (const Bool< T > &b, const T &v_then, const T &v_else)
 Allows users to use if_then_else with a conditional of Bool<T> type in addition to Bool<T>::value_type. More...
 
template<typename T , typename... Rest>
T cond (const Bool< T > &b, const T &e_then, Rest...rest)
 Allows users to use cond with conditionals of Bool<T> type in addition to Bool<T>::value_type. More...
 
optional< std::string > MaybeGetDrakePath ()
 (Advanced) Returns the fully-qualified path to the first folder containing Drake resources as located by FindResource, or nullopt if none is found. More...
 
std::string GetDrakePath ()
 Returns the fully-qualified path to the root of the drake source tree. More...
 
template<typename T >
double ExtractDoubleOrThrow (const T &)
 Converts a ScalarType value to a double, failing at runtime (not compile time) if the type cannot be converted to a double. More...
 
double ExtractDoubleOrThrow (double scalar)
 Returns scalar as a double. Never throws. More...
 
optional< string > LoadedLibraryPath (const std::string &library_name)
 This function returns the absolute path of the library with the name library_name if that library was loaded in the current running process. More...
 
std::vector< string > GetResourceSearchPaths ()
 Gets current root directory value from a persistent variable. More...
 
void AddResourceSearchPath (std::string root_directory)
 Adds a path in which resources are searched in a persistent variable. More...
 
Result FindResource (std::string resource_path)
 Attempts to locate a Drake resource named by the given resource_path. More...
 
std::string FindResourceOrThrow (std::string resource_path)
 Convenient wrapper for querying FindResource(resource_path) followed by FindResourceResult::get_absolute_path_or_throw(). More...
 
template<class HashAlgorithm , class T >
std::enable_if_t< std::is_integral< T >::valuehash_append (HashAlgorithm &hasher, const T &item) noexcept
 Provides hash_append generic hashing for integral constants. More...
 
template<class HashAlgorithm , class T >
std::enable_if_t< std::is_enum< T >::valuehash_append (HashAlgorithm &hasher, const T &item) noexcept
 Provides hash_append generic hashing for enumerations. More...
 
template<class HashAlgorithm , class T >
std::enable_if_t< std::is_floating_point< T >::valuehash_append (HashAlgorithm &hasher, const T &item) noexcept
 Provides hash_append generic hashing for floating point values. More...
 
template<class HashAlgorithm , class Traits , class Allocator >
void hash_append (HashAlgorithm &hasher, const std::basic_string< char, Traits, Allocator > &item) noexcept
 Provides hash_append generic hashing for std::string. More...
 
template<class HashAlgorithm , class T1 , class T2 >
void hash_append (HashAlgorithm &hasher, const std::pair< T1, T2 > &item) noexcept
 Provides hash_append generic hashing for std::pair. More...
 
template<class HashAlgorithm , class T >
void hash_append (HashAlgorithm &hasher, const drake::optional< T > &item) noexcept
 Provides hash_append generic hashing for drake::optional. More...
 
template<class HashAlgorithm , class Iter >
void hash_append_range (HashAlgorithm &hasher, Iter begin, Iter end) noexcept
 Provides hash_append generic hashing for a range, as given by two iterators. More...
 
template<class HashAlgorithm , class T1 , class T2 , class Compare , class Allocator >
void hash_append (HashAlgorithm &hasher, const std::map< T1, T2, Compare, Allocator > &item) noexcept
 Provides hash_append generic hashing for std::map. More...
 
template<class HashAlgorithm , class Key , class Compare , class Allocator >
void hash_append (HashAlgorithm &hasher, const std::set< Key, Compare, Allocator > &item) noexcept
 Provides hash_append generic hashing for std::set. More...
 
template<typename DerivedA , typename DerivedB >
bool is_approx_equal_abstol (const Eigen::MatrixBase< DerivedA > &m1, const Eigen::MatrixBase< DerivedB > &m2, double tolerance)
 Returns true if and only if the two matrices are equal to within a certain absolute elementwise tolerance. More...
 
template<typename DerivedA , typename DerivedB >
bool IsApproxEqualAbsTolWithPermutedColumns (const Eigen::MatrixBase< DerivedA > &m1, const Eigen::MatrixBase< DerivedB > &m2, double tolerance)
 Returns true if and only if a simple greedy search reveals a permutation of the columns of m2 to make the matrix equal to m1 to within a certain absolute elementwise tolerance. More...
 
template<class T , class U >
std::unique_ptr< Tstatic_pointer_cast (std::unique_ptr< U > &&other) noexcept
 Casts the object owned by the std::unique_ptr other from type U to T; no runtime type checking is performed. More...
 
template<class T , class U >
std::unique_ptr< Tdynamic_pointer_cast (std::unique_ptr< U > &&other) noexcept
 Casts the object owned by the std::unique_ptr other from type U to T; if the cast fails, returns nullptr. More...
 
template<class T , class U >
std::unique_ptr< Tdynamic_pointer_cast_or_throw (std::unique_ptr< U > &&other)
 Casts the object owned by the std::unique_ptr other from type U to T; if other is nullptr or the cast fails, throws a std::logic_error. More...
 
std::unique_ptr< google::protobuf::io::FileInputStream > MakeFileInputStreamOrThrow (const std::string &path)
 Returns a self-closing FileInputStream for the file at the given path, or else throws std::runtime_error. More...
 
template<class T >
bool operator== (const SortedPair< T > &x, const SortedPair< T > &y)
 Two pairs of the same type are equal iff their members are equal after sorting. More...
 
template<class T >
bool operator< (const SortedPair< T > &x, const SortedPair< T > &y)
 Compares two pairs using lexicographic ordering. More...
 
template<class T >
bool operator!= (const SortedPair< T > &x, const SortedPair< T > &y)
 Determine whether two SortedPair objects are not equal using operator==. More...
 
template<class T >
bool operator> (const SortedPair< T > &x, const SortedPair< T > &y)
 Determines whether x > y using operator<. More...
 
template<class T >
bool operator<= (const SortedPair< T > &x, const SortedPair< T > &y)
 Determines whether x <= y using operator<. More...
 
template<class T >
bool operator>= (const SortedPair< T > &x, const SortedPair< T > &y)
 Determines whether x >= y using operator<. More...
 
template<class T >
constexpr SortedPair< typename std::decay< T >::typeMakeSortedPair (T &&x, T &&y)
 A convenience wrapper for creating a sorted pair from two objects. More...
 
template<typename T >
bool SortedVectorsHaveIntersection (const std::vector< T > &a, const std::vector< T > &b)
 Checks for the existence of a non-empty intersection between two sorted std::vector's. More...
 
double ExtractDoubleOrThrow (const symbolic::Expression &e)
 Returns the symbolic expression's value() as a double. More...
 
template<typename... Rest>
symbolic::Expression cond (const symbolic::Formula &f_cond, double v_then, Rest...rest)
 Provides specialization of cond function defined in drake/common/cond.h file. More...
 
template<>
bool ExtractBoolOrThrow (const Bool< symbolic::Expression > &b)
 Specialization of ExtractBoolOrThrow for Bool<symbolic::Expression> which includes symbolic::Formula. More...
 
std::string temp_directory ()
 Returns a directory location suitable for temporary files. More...
 
 TEST_F (DeprecatedBoolTestDouble, Constructor)
 
 TEST_F (DeprecatedBoolTestDouble, TrueFalse)
 
 TEST_F (DeprecatedBoolTestDouble, CopyConstructor)
 
 TEST_F (DeprecatedBoolTestDouble, MoveConstructor)
 
 TEST_F (DeprecatedBoolTestDouble, CopyAssign)
 
 TEST_F (DeprecatedBoolTestDouble, MoveAssign)
 
 TEST_F (DeprecatedBoolTestDouble, TypeCheck)
 
 TEST_F (DeprecatedBoolTestDouble, Value)
 
 TEST_F (DeprecatedBoolTestDouble, IfThenElse)
 
 TEST_F (DeprecatedBoolTestDouble, Cond)
 
 TEST_F (DeprecatedBoolTestDouble, LogicalOperators)
 
 TEST_F (DeprecatedBoolTestAutoDiffXd, TypeCheck)
 
 TEST_F (DeprecatedBoolTestAutoDiffXd, TrueFalse)
 
 TEST_F (DeprecatedBoolTestAutoDiffXd, ExtractBoolOrThrow)
 
 TEST_F (DeprecatedBoolTestAutoDiffXd, Value)
 
 TEST_F (DeprecatedBoolTestAutoDiffXd, IfThenElse)
 
 TEST_F (DeprecatedBoolTestAutoDiffXd, Cond)
 
 TEST_F (DeprecatedBoolTestAutoDiffXd, LogicalOperators)
 
 TEST_F (DeprecatedBoolTestSymbolic, TypeCheck)
 
 TEST_F (DeprecatedBoolTestSymbolic, TrueFalse)
 
 TEST_F (DeprecatedBoolTestSymbolic, ConstructFromBool)
 
 TEST_F (DeprecatedBoolTestSymbolic, ExtractBoolOrThrowNoException)
 
 TEST_F (DeprecatedBoolTestSymbolic, ExtractBoolOrThrowException)
 
 TEST_F (DeprecatedBoolTestSymbolic, ExtractBoolOrThrowConsistency)
 
 TEST_F (DeprecatedBoolTestSymbolic, Value)
 
 TEST_F (DeprecatedBoolTestSymbolic, IfThenElse)
 
 TEST_F (DeprecatedBoolTestSymbolic, Cond)
 
 TEST_F (DeprecatedBoolTestSymbolic, LogicalOperators)
 
 TEST_F (BoolTestDouble, TypeCheck)
 
 TEST_F (BoolTestDouble, All)
 
 TEST_F (BoolTestDouble, AllOf)
 
 TEST_F (BoolTestDouble, Any)
 
 TEST_F (BoolTestDouble, AnyOf)
 
 TEST_F (BoolTestDouble, None)
 
 TEST_F (BoolTestDouble, NoneOf)
 
 TEST_F (BoolTestAutoDiffXd, TypeCheck)
 
 TEST_F (BoolTestAutoDiffXd, AllOf)
 
 TEST_F (BoolTestAutoDiffXd, AnyOf)
 
 TEST_F (BoolTestAutoDiffXd, NoneOf)
 
 TEST_F (BoolTestSymbolic, TypeCheck)
 
 TEST_F (BoolTestSymbolic, All)
 
 TEST_F (BoolTestSymbolic, AllOf)
 
 TEST_F (BoolTestSymbolic, Any)
 
 TEST_F (BoolTestSymbolic, AnyOf)
 
 TEST_F (BoolTestSymbolic, None)
 
 TEST_F (BoolTestSymbolic, NoneOf)
 
::testing::AssertionResult ExpectRotMat (const Eigen::Matrix3d &R, double tolerance)
 Expects that a rotation matrix belongs to SO(3): R ∈ SO(3) => Rᵀ R = I (orthonormal) det(R) = 1 (right-hand rule) More...
 
::testing::AssertionResult CompareTransforms (const Eigen::Isometry3d &X_expected, const Eigen::Isometry3d &X_actual, double tolerance)
 Compares two SE(3) Transforms. More...
 
template<typename DerivedA , typename DerivedB >
::testing::AssertionResult CompareMatrices (const Eigen::MatrixBase< DerivedA > &m1, const Eigen::MatrixBase< DerivedB > &m2, double tolerance=0.0, MatrixCompareType compare_type=MatrixCompareType::absolute)
 Compares two matrices to determine whether they are equal to within a certain threshold. More...
 
template<typename ToType , typename FromType >
::testing::AssertionResult is_dynamic_castable (const FromType *ptr)
 Checks if ptr, a pointer to FromType class, can be safely converted to a pointer to ToType class. More...
 
template<typename ToType , typename FromType >
::testing::AssertionResult is_dynamic_castable (std::shared_ptr< FromType > ptr)
 Checks if ptr, a shared pointer to FromType class, can be safely converted to a shared pointer to ToType class. More...
 
template<typename ToType , typename FromType >
::testing::AssertionResult is_dynamic_castable (const std::unique_ptr< FromType > &ptr)
 Checks if ptr, a shared pointer to FromType class, can be safely converted to a shared pointer to ToType class. More...
 
logging::loggerlog ()
 Retrieve an instance of a logger to use for logging; for example: drake::log()->info("potato!") More...
 
template<typename Tag , typename U >
std::enable_if< std::is_integral< U >::value &&std::is_unsigned< U >::value, bool >::type operator== (const U &value, const TypeSafeIndex< Tag > &tag)
 
template<typename Tag , typename U >
std::enable_if< std::is_integral< U >::value &&std::is_unsigned< U >::value, bool >::type operator!= (const U &value, const TypeSafeIndex< Tag > &tag)
 
template<typename Tag , typename U >
std::enable_if< std::is_integral< U >::value &&std::is_unsigned< U >::value, bool >::type operator< (const U &value, const TypeSafeIndex< Tag > &tag)
 
template<typename Tag , typename U >
std::enable_if< std::is_integral< U >::value &&std::is_unsigned< U >::value, bool >::type operator<= (const U &value, const TypeSafeIndex< Tag > &tag)
 
template<typename Tag , typename U >
std::enable_if< std::is_integral< U >::value &&std::is_unsigned< U >::value, bool >::type operator> (const U &value, const TypeSafeIndex< Tag > &tag)
 
template<typename Tag , typename U >
std::enable_if< std::is_integral< U >::value &&std::is_unsigned< U >::value, bool >::type operator>= (const U &value, const TypeSafeIndex< Tag > &tag)
 
template<typename... Args>
void unused (const Args &...)
 Documents the argument(s) as unused, placating GCC's -Wunused-parameter warning. More...
 
void ComputeRegionOfAttraction ()
 
cond

Constructs conditional expression (similar to Lisp's cond).

  cond(cond_1, expr_1,
       cond_2, expr_2,
          ...,   ...,
       cond_n, expr_n,
       expr_{n+1})

The value returned by the above cond expression is expr_1 if cond_1 is true; else if cond_2 is true then expr_2; ... ; else if cond_n is true then expr_n. If none of the conditions are true, it returns expr_{n+1}.

Note
This functions assumes that ScalarType provides operator< and the type of f_cond is the type of the return type of operator<(ScalarType, ScalarType). For example, symbolic::Expression can be used as a ScalarType because it provides symbolic::Formula operator<(symbolic::Expression, symbolic::Expression).
template<typename ScalarType >
ScalarType cond (const ScalarType &e)
 
template<typename ScalarType , typename... Rest>
ScalarType cond (const decltype(ScalarType()< ScalarType())&f_cond, const ScalarType &e_then, Rest...rest)
 

Variables

constexpr int kQuaternionSize = 4
 
constexpr int kSpaceDimension = 3
 
constexpr int kRpySize = 3
 
constexpr int kTwistSize = 6
 https://en.wikipedia.org/wiki/Screw_theory#Twist More...
 
constexpr int kHomogeneousTransformSize = 16
 http://www.euclideanspace.com/maths/geometry/affine/matrix4x4/ More...
 
const int kRotmatSize = kSpaceDimension * kSpaceDimension
 
constexpr auto nullopt = stx::nullopt
 
const char *const kDrakeResourceRootEnvironmentVariableName
 The name of the environment variable that provides the first place where FindResource attempts to look. More...
 

Typedef Documentation

using AngleAxis = Eigen::AngleAxis<Scalar>

An AngleAxis templated on scalar type.

using AutoDiffd = Eigen::AutoDiffScalar<Eigen::Matrix<double, num_vars, 1> >

An autodiff variable with num_vars partials.

using AutoDiffVecd = Eigen::Matrix<AutoDiffd<num_vars>, rows, 1>

A vector of rows autodiff variables, each with num_vars partials.

typedef AutoDiffVecd<Eigen::Dynamic, Eigen::Dynamic> AutoDiffVecXd

A dynamic-sized vector of autodiff variables, each with a dynamic-sized vector of partials.

using AutoDiffXd = Eigen::AutoDiffScalar<Eigen::VectorXd>

An autodiff variable with a dynamic number of partials.

using boolean = typename scalar_predicate<T>::type

An alias for a boolean-like value, conditioned on the scalar type T.

In many cases this will be a synonym for bool, e.g., when T = double. When T = symbolic::Expression, this is a synonym for symbolic::Formula. This is a convenience abbreviation for scalar_predicate<T>::type.

The default hashing functor, akin to std::hash.

The default HashAlgorithm concept implementation across Drake.

This is guaranteed to have a result_type of size_t to be compatible with std::hash.

using eigen_aligned_std_map = std::map<Key, T, std::less<Key>, Eigen::aligned_allocator<std::pair<Key const, T>>>

A std::map that uses Eigen::aligned_allocator so that the contained types may be fixed-size Eigen values.

using eigen_aligned_std_unordered_map = std::unordered_map<Key, T, std::hash<Key>, std::equal_to<Key>, Eigen::aligned_allocator<std::pair<Key const, T>>>

A std::unordered_map that uses Eigen::aligned_allocator so that the contained types may be fixed-size Eigen values.

using eigen_aligned_std_vector = std::vector<T, Eigen::aligned_allocator<T>>

A std::vector that uses Eigen::aligned_allocator so that the contained types may be fixed-size Eigen values.

using is_cloneable = is_cloneable_detail::is_cloneable_helper<T, void>

Provides method for determining at run time if a class is "cloneable".

Usage

This gets used like type_traits functions (e.g., is_copy_constructible, is_same, etc.) To determine if a class is cloneable simply invoke:

If Foo is cloneable, it will evaluate to true. It can also be used in compile-time tests (e.g., SFINAE and static_asserts):

static_assert(is_cloneable<Foo>::value, "This method requires its classes to "
"be cloneable.");

Definition of "cloneability"

To be cloneable, the class Foo must have a public method of the form:

unique_ptr<Foo> Foo::Clone() const;

Note that "friend" access for the is_cloneable-using class is not sufficient. The Foo::Clone() method must actually be public.

The pointer contained in the returned unique_ptr must point to a heap-allocated deep copy of the concrete object. This test can confirm the proper signature, but cannot confirm the heap-allocated deep copy. A Clone() method that doesn't return such a copy of the concrete object should be considered a malformed function.

Warning
It is important to note, that a Clone() method that returns a unique_ptr to a super class is not sufficient to be cloneable. In other words the presence of:
unique_ptr<Base> Derived::Clone() const;
will not make the Derived class cloneable.
Template Parameters
TThe class to test for cloneability.
using Isometry3 = Eigen::Transform<Scalar, 3, Eigen::Isometry>

An Isometry templated on scalar type.

using Matrix2 = Eigen::Matrix<Scalar, 2, 2>

A matrix of 2 rows and 2 columns, templated on scalar type.

using Matrix2X = Eigen::Matrix<Scalar, 2, Eigen::Dynamic>

A matrix of 2 rows, dynamic columns, templated on scalar type.

using Matrix3 = Eigen::Matrix<Scalar, 3, 3>

A matrix of 3 rows and 3 columns, templated on scalar type.

using Matrix3X = Eigen::Matrix<Scalar, 3, Eigen::Dynamic>

A matrix of 3 rows, dynamic columns, templated on scalar type.

using Matrix4 = Eigen::Matrix<Scalar, 4, 4>

A matrix of 4 rows and 4 columns, templated on scalar type.

using Matrix4X = Eigen::Matrix<Scalar, 4, Eigen::Dynamic>

A matrix of 4 rows, dynamic columns, templated on scalar type.

using Matrix6 = Eigen::Matrix<Scalar, 6, 6>

A matrix of 6 rows and 6 columns, templated on scalar type.

using Matrix6X = Eigen::Matrix<Scalar, 6, Eigen::Dynamic>

A matrix of 6 rows, dynamic columns, templated on scalar type.

using MatrixUpTo6 = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, 0, 6, 6>

A matrix of dynamic size templated on scalar type, up to a maximum of 6 rows and 6 columns.

Rectangular matrices, with different number of rows and columns, are allowed.

using MatrixX = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>

A matrix of dynamic size, templated on scalar type.

using negation = std::integral_constant<bool, !T::value>

Provides backport of C++17 std::negation.

using optional = stx::optional<T>
using Quaternion = Eigen::Quaternion<Scalar>

A quaternion templated on scalar type.

using RowVector2 = Eigen::Matrix<Scalar, 1, 2>

A row vector of size 2, templated on scalar type.

using RowVector3 = Eigen::Matrix<Scalar, 1, 3>

A row vector of size 3, templated on scalar type.

using RowVector4 = Eigen::Matrix<Scalar, 1, 4>

A row vector of size 4, templated on scalar type.

using RowVector6 = Eigen::Matrix<Scalar, 1, 6>

A row vector of size 6.

using RowVectorX = Eigen::Matrix<Scalar, 1, Eigen::Dynamic>

A row vector of any size, templated on scalar type.

using SpatialForce = Eigen::Matrix<Scalar, 6, 1>

A column vector consisting of a concatenated rotational and translational force.

The wrench is a special case of a SpatialForce. For a general SpatialForce the rotational force can be a pure torque or the accumulation of moments and need not necessarily be a function of the force term.

using SquareTwistMatrix = Eigen::Matrix<Scalar, kTwistSize, kTwistSize>

A six-by-six matrix.

using T = boolean<T>
using Translation3 = Eigen::Translation<Scalar, 3>

A translation in 3D templated on scalar type.

using TwistMatrix = Eigen::Matrix<Scalar, kTwistSize, Eigen::Dynamic>

A matrix with one twist per column, and dynamically many columns.

using TwistVector = Eigen::Matrix<Scalar, kTwistSize, 1>

A column vector consisting of one twist.

using type_check_always_true = std::true_type

Provides a check which will return true for any type.

Extracts the inner template arguments (typename only) for a typename which is a template instantiation.

using Vector1 = Eigen::Matrix<Scalar, 1, 1>

A column vector of size 1 (that is, a scalar), templated on scalar type.

using Vector1d = Eigen::Matrix<double, 1, 1>

A column vector of size 1 of doubles.

using Vector2 = Eigen::Matrix<Scalar, 2, 1>

A column vector of size 2, templated on scalar type.

using Vector3 = Eigen::Matrix<Scalar, 3, 1>

A column vector of size 3, templated on scalar type.

using Vector4 = Eigen::Matrix<Scalar, 4, 1>

A column vector of size 4, templated on scalar type.

using Vector6 = Eigen::Matrix<Scalar, 6, 1>

A column vector of size 6.

using VectorUpTo6 = Eigen::Matrix<Scalar, Eigen::Dynamic, 1, 0, 6, 1>

A vector of dynamic size templated on scalar type, up to a maximum of 6 elements.

using VectorX = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>

A column vector of any size, templated on scalar type.

using WrenchVector = Eigen::Matrix<Scalar, 6, 1>

A column vector consisting of one wrench (spatial force) = [r X f; f], where f is a force (translational force) applied at a point P and r is the position vector from a point O (called the "moment center") to point P.

Enumeration Type Documentation

enum MatrixCompareType
strong
Enumerator
absolute 
relative 
enum RandomDistribution
strong

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

Enumerator
kUniform 

Vector elements are independent and uniformly distributed ∈ [0,1].

kGaussian 

Vector elements are independent and drawn from a mean-zero, unit-variance normal distribution.

kExponential 

Vector elements are independent and drawn from an exponential distribution with λ=1.

Function Documentation

void AddResourceSearchPath ( std::string  root_directory)

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). The given path must be absolute or else throws runtime_error.

Here is the caller graph for this function:

Derived::Scalar drake::all ( const Eigen::DenseBase< Derived > &  m)

Checks truth for all elements in matrix m.

This is identical to Eigen::DenseBase::all(), except this function allows for lazy evaluation, so works even when scalar_predicate<>::is_bool does not hold. An empty matrix returns true.

Here is the caller graph for this function:

boolean<typename Derived::Scalar> drake::all_of ( const Eigen::MatrixBase< Derived > &  m,
const std::function< boolean< typename Derived::Scalar >(const typename Derived::Scalar &)> &  pred 
)

Checks if unary predicate pred holds for all elements in the matrix m.

An empty matrix returns true.

Here is the call graph for this function:

Here is the caller graph for this function:

Derived::Scalar drake::any ( const Eigen::DenseBase< Derived > &  m)

Checks truth for at least one element in matrix m.

This is identical to Eigen::DenseBase::any(), except this function allows for lazy evaluation, so works even when scalar_predicate<>::is_bool does not hold. An empty matrix returns false.

Here is the caller graph for this function:

boolean<typename Derived::Scalar> drake::any_of ( const Eigen::MatrixBase< Derived > &  m,
const std::function< boolean< typename Derived::Scalar >(const typename Derived::Scalar &)> &  pred 
)

Checks if unary predicate pred holds for at least one element in the matrix m.

An empty matrix returns false.

Here is the call graph for this function:

Here is the caller graph for this function:

void drake::autodiffxd_make_coherent ( const AutoDiffXd donor,
AutoDiffXd recipient 
)
inline

Makes the derviatives of the recipient coherent with respect to those of the donor variable (see drake/common/autodiffxd.h).

If the recipient's derivatives are already populated with a vector of the same size as that of the donor, variables pass through unchanged. An exception is thrown when there are nonempty vectors of different sizes.

Here is the caller graph for this function:

void drake::autodiffxd_make_coherent ( const double ,
double  
)
inline
void drake::autodiffxd_make_coherent ( const symbolic::Expression ,
symbolic::Expression  
)
inline
::testing::AssertionResult drake::CompareMatrices ( const Eigen::MatrixBase< DerivedA > &  m1,
const Eigen::MatrixBase< DerivedB > &  m2,
double  tolerance = 0.0,
MatrixCompareType  compare_type = MatrixCompareType::absolute 
)

Compares two matrices to determine whether they are equal to within a certain threshold.

Parameters
m1The first matrix to compare.
m2The second matrix to compare.
toleranceThe tolerance for determining equivalence.
compare_typeWhether the tolereance is absolute or relative.
explanationA pointer to a string variable for saving an explanation of why m1 and m2 are unequal. This parameter is optional and defaults to nullptr. If this is nullptr and m1 and m2 are not equal, an explanation is logged as an error message.
Returns
true if the two matrices are equal based on the specified tolerance.

Here is the call graph for this function:

Here is the caller graph for this function:

testing::AssertionResult CompareTransforms ( const Eigen::Isometry3d &  X_expected,
const Eigen::Isometry3d &  X_actual,
double  tolerance 
)

Compares two SE(3) Transforms.

Parameters
X_expectedExpected SE(3) transform.
X_actualActual SE(3) transform.
toleranceThe tolerance for determining equivalence for the rotation matrix cases (using ExpectRotMat) and comparing both transforms as matrices.

Here is the call graph for this function:

void drake::ComputeRegionOfAttraction ( )

Here is the call graph for this function:

Here is the caller graph for this function:

ScalarType drake::cond ( const ScalarType &  e)
ScalarType drake::cond ( const decltype(ScalarType()< ScalarType())&  f_cond,
const ScalarType &  e_then,
Rest...  rest 
)

Here is the call graph for this function:

Eigen::AutoDiffScalar< typename Eigen::internal::remove_all<DerType>::type::PlainObject> drake::cond ( bool  f_cond,
const Eigen::AutoDiffScalar< DerType > &  e_then,
Rest...  rest 
)

Provides special case of cond expression for Eigen::AutoDiffScalar type.

Here is the call graph for this function:

Here is the caller graph for this function:

T drake::cond ( const Bool< T > &  b,
const T e_then,
Rest...  rest 
)

Allows users to use cond with conditionals of Bool<T> type in addition to Bool<T>::value_type.

Here is the call graph for this function:

symbolic::Expression drake::cond ( const symbolic::Formula f_cond,
double  v_then,
Rest...  rest 
)

Provides specialization of cond function defined in drake/common/cond.h file.

This specialization is required to handle double to symbolic::Expression conversion so that we can write one such as cond(x > 0.0, 1.0, -1.0).

Here is the call graph for this function:

std::unique_ptr<T> drake::dynamic_pointer_cast ( std::unique_ptr< U > &&  other)
noexcept

Casts the object owned by the std::unique_ptr other from type U to T; if the cast fails, returns nullptr.

Casting is performed using dynamic_cast on the managed value (i.e., the result of other.get()). On success, other's managed value is transferred to the result and other is empty; on failure, other will retain its original managed value and the result is empty. As with dynamic_cast, casting nullptr to anything always succeeds, so a nullptr result could indicate either that the argument was nullptr or that the cast failed.

This method is analogous to the built-in std::dynamic_pointer_cast that operates on a std::shared_ptr.

Note that this function only supports default deleters.

Here is the caller graph for this function:

std::unique_ptr<T> drake::dynamic_pointer_cast_or_throw ( std::unique_ptr< U > &&  other)

Casts the object owned by the std::unique_ptr other from type U to T; if other is nullptr or the cast fails, throws a std::logic_error.

Casting is performed using dynamic_cast on the managed value (i.e., the result of other.get()). On success, other's managed value is transferred to the result and other is empty; on failure, other will retain its original managed value.

Exceptions
std::logic_errorif the cast fails.

Note that this function only supports default deleters.

Here is the call graph for this function:

testing::AssertionResult ExpectRotMat ( const Eigen::Matrix3d &  R,
double  tolerance 
)

Expects that a rotation matrix belongs to SO(3): R ∈ SO(3) => Rᵀ R = I (orthonormal) det(R) = 1 (right-hand rule)

Parameters
RRotation matrix.
toleranceThe tolerance for determining equivalence for the orthonormal and right-hand rule cases.

Here is the call graph for this function:

Here is the caller graph for this function:

bool drake::ExtractBoolOrThrow ( const Bool< T > &  b)

Extracts a bool value from b or throws an exception if the extraction fails (i.e.

due to free variables in a symbolic::Formula).

Here is the caller graph for this function:

bool drake::ExtractBoolOrThrow ( const Bool< symbolic::Expression > &  b)
inline

Specialization of ExtractBoolOrThrow for Bool<symbolic::Expression> which includes symbolic::Formula.

It calls Evaluate with an empty environment and throws if there are free variables in the expression.

double drake::ExtractDoubleOrThrow ( const T )

Converts a ScalarType value to a double, failing at runtime (not compile time) if the type cannot be converted to a double.

This function is useful for writing ScalarType-generic code that (1) can reasonably discard any supplemental scalar data, e.g., the derivatives of an AutoDiffScalar, and (2) is reasonable to fail at runtime if the extraction fails.

The default implementation throws an exception. ScalarTypes that can hold a numeric value must overload this method to provide an appropriate extraction. An overload for double is already provided.

See autodiff_overloads.h to use this with Eigen's AutoDiffScalar. See symbolic_expression.h to use this with symbolic::Expression.

double drake::ExtractDoubleOrThrow ( double  scalar)
inline

Returns scalar as a double. Never throws.

double drake::ExtractDoubleOrThrow ( const Eigen::AutoDiffScalar< DerType > &  scalar)

Returns the autodiff scalar's value() as a double.

Never throws. Overloads ExtractDoubleOrThrow from common/extract_double.h.

Here is the caller graph for this function:

double ExtractDoubleOrThrow ( const symbolic::Expression e)

Returns the symbolic expression's value() as a double.

Exceptions
Ifit is not possible to evaluate the symbolic expression with an empty environment.

Here is the call graph for this function:

FindResourceResult FindResource ( std::string  resource_path)

Attempts to locate a Drake resource named by the given resource_path.

The resource_path refers to the relative path within the Drake source repository, prepended with drake/. For example, to find the source file examples/pendulum/Pendulum.urdf, the resource_path would be drake/examples/pendulum/Pendulum.urdf. Paths that do not start with drake/ will return a failed result.

The search scans for the resource in the following places and in the following order: 1) in the DRAKE_RESOURCE_ROOT environment variable 2) in the directories specified by AddResourceSearchPath() and 3) in the drake source workspace. If all of these are unavailable, or do not have the resource, then it will return a failed result.

Here is the call graph for this function:

Here is the caller graph for this function:

std::string FindResourceOrThrow ( std::string  resource_path)

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

Here is the call graph for this function:

Here is the caller graph for this function:

std::string GetDrakePath ( )

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

Here is the caller graph for this function:

std::vector< std::string > GetResourceSearchPaths ( )

Gets current root directory value from a persistent variable.

Here is the caller graph for this function:

std::enable_if_t<std::is_integral<T>::value> drake::hash_append ( HashAlgorithm &  hasher,
const T item 
)
noexcept

Provides hash_append generic hashing for integral constants.

Here is the caller graph for this function:

std::enable_if_t<std::is_enum<T>::value> drake::hash_append ( HashAlgorithm &  hasher,
const T item 
)
noexcept

Provides hash_append generic hashing for enumerations.

std::enable_if_t<std::is_floating_point<T>::value> drake::hash_append ( HashAlgorithm &  hasher,
const T item 
)
noexcept

Provides hash_append generic hashing for floating point values.

Here is the call graph for this function:

void drake::hash_append ( HashAlgorithm &  hasher,
const std::basic_string< char, Traits, Allocator > &  item 
)
noexcept

Provides hash_append generic hashing for std::string.

(Technically, any string based on CharT = char.)

Here is the call graph for this function:

void drake::hash_append ( HashAlgorithm &  hasher,
const std::pair< T1, T2 > &  item 
)
noexcept

Provides hash_append generic hashing for std::pair.

Here is the call graph for this function:

void drake::hash_append ( HashAlgorithm &  hasher,
const drake::optional< T > &  item 
)
noexcept

Provides hash_append generic hashing for drake::optional.

Note that std::hash<std::optional<T>> provides the peculiar invariant that the hash of an optional bearing a value v shall evaluate to the same hash as that of the value v itself. Hash operations implemented with this hash_append do not provide that invariant.

Here is the call graph for this function:

void drake::hash_append ( HashAlgorithm &  hasher,
const std::map< T1, T2, Compare, Allocator > &  item 
)
noexcept

Provides hash_append generic hashing for std::map.

Note that there is no hash_append overload for std::unordered_map, and such an overload must never appear. See n3980.html::unordered for details.

Here is the call graph for this function:

void drake::hash_append ( HashAlgorithm &  hasher,
const std::set< Key, Compare, Allocator > &  item 
)
noexcept

Provides hash_append generic hashing for std::set.

Note that there is no hash_append overload for std::unordered_set, and such an overload must never appear. See n3980.html::unordered for details.

Here is the call graph for this function:

void drake::hash_append_range ( HashAlgorithm &  hasher,
Iter  begin,
Iter  end 
)
noexcept

Provides hash_append generic hashing for a range, as given by two iterators.

Here is the call graph for this function:

Here is the caller graph for this function:

double drake::if_then_else ( bool  f_cond,
double  v_then,
double  v_else 
)
inline

Provides if-then-else expression for double.

The value returned by the if-then-else expression is v_then if f_cond is true. Otherwise, it returns v_else. The semantics is similar but not exactly the same as C++'s conditional expression constructed by its ternary operator, ?:. In if_then_else(f_cond, v_then, v_else), both of v_then and v_else are evaluated regardless of the evaluation of f_cond. In contrast, only one of v_then or v_else is evaluated in C++'s conditional expression f_cond ? v_then : v_else.

Eigen::AutoDiffScalar< typename Eigen::internal::remove_all<DerType1>::type::PlainObject> drake::if_then_else ( bool  f_cond,
const Eigen::AutoDiffScalar< DerType1 > &  x,
const Eigen::AutoDiffScalar< DerType2 > &  y 
)
inline

Provides if-then-else expression for Eigen::AutoDiffScalar type.

To support Eigen's generic expressions, we use casting to the plain object after applying Eigen::internal::remove_all. It is based on the Eigen's implementation of min/max function for AutoDiffScalar type (https://bitbucket.org/eigen/eigen/src/10a1de58614569c9250df88bdfc6402024687bc6/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h?at=default&fileviewer=file-view-default#AutoDiffScalar.h-546).

Here is the caller graph for this function:

T drake::if_then_else ( const Bool< T > &  b,
const T v_then,
const T v_else 
)

Allows users to use if_then_else with a conditional of Bool<T> type in addition to Bool<T>::value_type.

Note that we need to have #include "drake/common/autodiff.h" atop this file because, in case of T = AutoDiffXd, this template function calls another template function defined in common/autodiff.h. See https://clang.llvm.org/compatibility.html#dep_lookup for more information.

Here is the call graph for this function:

bool drake::is_approx_equal_abstol ( const Eigen::MatrixBase< DerivedA > &  m1,
const Eigen::MatrixBase< DerivedB > &  m2,
double  tolerance 
)

Returns true if and only if the two matrices are equal to within a certain absolute elementwise tolerance.

Special values (infinities, NaN, etc.) do not compare as equal elements.

Here is the caller graph for this function:

::testing::AssertionResult drake::is_dynamic_castable ( const FromType *  ptr)

Checks if ptr, a pointer to FromType class, can be safely converted to a pointer to ToType class.

Our motivation is to provide a good diagnostic for what ptr actually was when the test fails.

Here is an illustrative code snippet. We assume that Prius and Camry are derived classes of Car.

const Car* prius = new Prius{};
// The following assertion fails without diagnostic info.
EXPECT_TRUE(dynamic_cast<Camry>(ptr) != nullptr)
// The following assertion returns `::testing::AssertionFailure()` with
// diagnostic info attached.
EXPECT_TRUE(is_dynamic_castable<Camry>(prius));
// Output:
// Value of: is_dynamic_castable<Camry>(prius)
// Actual: false (is_dynamic_castable<Camry>(Car* ptr) failed
// because ptr is of dynamic type Prius.)
// Expected: true

Here is the call graph for this function:

Here is the caller graph for this function:

::testing::AssertionResult drake::is_dynamic_castable ( std::shared_ptr< FromType >  ptr)

Checks if ptr, a shared pointer to FromType class, can be safely converted to a shared pointer to ToType class.

Our motivation is to provide a good diagnostic for what ptr actually was when the test fails.

::testing::AssertionResult drake::is_dynamic_castable ( const std::unique_ptr< FromType > &  ptr)

Checks if ptr, a shared pointer to FromType class, can be safely converted to a shared pointer to ToType class.

Our motivation is to provide a good diagnostic for what ptr actually was when the test fails.

bool drake::IsApproxEqualAbsTolWithPermutedColumns ( const Eigen::MatrixBase< DerivedA > &  m1,
const Eigen::MatrixBase< DerivedB > &  m2,
double  tolerance 
)

Returns true if and only if a simple greedy search reveals a permutation of the columns of m2 to make the matrix equal to m1 to within a certain absolute elementwise tolerance.

E.g., there exists a P such that

   forall i,j,  |m1 - m2*P|_{i,j} <= tolerance
   where P is a permutation matrix:
      P(i,j)={0,1}, sum_i P(i,j)=1, sum_j P(i,j)=1.

Note: Returns false for matrices of different sizes. Note: The current implementation is O(n^2) in the number of columns. Note: In marginal cases (with similar but not identical columns) this algorithm can fail to find a permutation P even if it exists because it accepts the first column match (m1(i),m2(j)) and removes m2(j) from the pool. It is possible that other columns of m2 would also match m1(i) but that m2(j) is the only match possible for a later column of m1.

Here is the call graph for this function:

optional< std::string > LoadedLibraryPath ( const std::string &  library_name)

This function returns the absolute path of the library with the name library_name if that library was loaded in the current running process.

Otherwise it returns an empty optional.

Here is the caller graph for this function:

logging::logger * log ( )

Retrieve an instance of a logger to use for logging; for example: drake::log()->info("potato!")

Here is the caller graph for this function:

std::unique_ptr< google::protobuf::io::FileInputStream > MakeFileInputStreamOrThrow ( const std::string &  path)

Returns a self-closing FileInputStream for the file at the given path, or else throws std::runtime_error.

Here is the caller graph for this function:

constexpr SortedPair<typename std::decay<T>::type> drake::MakeSortedPair ( T &&  x,
T &&  y 
)
inline

A convenience wrapper for creating a sorted pair from two objects.

Parameters
xThe first_ object.
yThe second_ object.
Returns
A newly-constructed SortedPair object.
optional< std::string > MaybeGetDrakePath ( )

(Advanced) Returns the fully-qualified path to the first folder containing Drake resources as located by FindResource, or nullopt if none is found.

For example ${result}/examples/pendulum/Pendulum.urdf would be the path to the Pendulum example's URDF resource.

Most users should prefer FindResource() or FindResourceOrThrow() to locate Drake resources for a specific resource filename. This method only exists for legacy compatibility reasons, and might eventually be removed.

Here is the caller graph for this function:

Derived::Scalar drake::none ( const Eigen::MatrixBase< Derived > &  m)

Checks that no elements of m are true. An empty matrix returns true.

Here is the call graph for this function:

Here is the caller graph for this function:

boolean<typename Derived::Scalar> drake::none_of ( const Eigen::MatrixBase< Derived > &  m,
const std::function< boolean< typename Derived::Scalar >(const typename Derived::Scalar &)> &  pred 
)

Checks if unary predicate pred holds for no elements in the matrix m.

An empty matrix returns true.

Here is the call graph for this function:

Here is the caller graph for this function:

std::enable_if_t<!std::is_same<typename Bool<T>::value_type, bool>::value, Bool<T> > drake::operator! ( const Bool< T > &  b)

Provides logical NOT operator (!) when Bool<T>::value_type is not bool.

bool drake::operator!= ( const SortedPair< T > &  x,
const SortedPair< T > &  y 
)
inline

Determine whether two SortedPair objects are not equal using operator==.

std::enable_if< std::is_integral<U>::value && std::is_unsigned<U>::value, bool>::type drake::operator!= ( const U &  value,
const TypeSafeIndex< Tag > &  tag 
)
std::enable_if_t<!std::is_same<typename Bool<T>::value_type, bool>::value, Bool<T> > drake::operator&& ( const Bool< T > &  b1,
const Bool< T > &  b2 
)

Provides logical AND operator (&&) between Bool<T> and Bool<T> when Bool<T>::value_type is not bool.

Note
This conditioning is necessary because of the implicit bool conversion. For instance, if we provide operator&& for all Bool<T>, then Bool<double> && bool becomes ambiguous because there are two possible operator&&s – one for C++ bool and another for drake::Bool<double>.
std::enable_if_t<!std::is_same<typename Bool<T>::value_type, bool>::value, Bool<T> > drake::operator&& ( const typename Bool< T >::value_type &  v1,
const Bool< T > &  b2 
)

Provides logical AND operator (&&) between Bool<T>::value_type and Bool<T> when Bool<T>::value_type is not bool.

std::enable_if_t<!std::is_same<typename Bool<T>::value_type, bool>::value, Bool<T> > drake::operator&& ( const Bool< T > &  b1,
const typename Bool< T >::value_type &  v2 
)

Provides logical AND operator (&&) between Bool<T> and Bool<T>::value_type when Bool<T>::value_type is not bool.

bool drake::operator< ( const SortedPair< T > &  x,
const SortedPair< T > &  y 
)
inline

Compares two pairs using lexicographic ordering.

std::enable_if< std::is_integral<U>::value && std::is_unsigned<U>::value, bool>::type drake::operator< ( const U &  value,
const TypeSafeIndex< Tag > &  tag 
)
bool drake::operator<= ( const SortedPair< T > &  x,
const SortedPair< T > &  y 
)
inline

Determines whether x <= y using operator<.

std::enable_if< std::is_integral<U>::value && std::is_unsigned<U>::value, bool>::type drake::operator<= ( const U &  value,
const TypeSafeIndex< Tag > &  tag 
)
bool drake::operator== ( const SortedPair< T > &  x,
const SortedPair< T > &  y 
)
inline

Two pairs of the same type are equal iff their members are equal after sorting.

Here is the caller graph for this function:

std::enable_if< std::is_integral<U>::value && std::is_unsigned<U>::value, bool>::type drake::operator== ( const U &  value,
const TypeSafeIndex< Tag > &  tag 
)
bool drake::operator> ( const SortedPair< T > &  x,
const SortedPair< T > &  y 
)
inline

Determines whether x > y using operator<.

std::enable_if< std::is_integral<U>::value && std::is_unsigned<U>::value, bool>::type drake::operator> ( const U &  value,
const TypeSafeIndex< Tag > &  tag 
)
bool drake::operator>= ( const SortedPair< T > &  x,
const SortedPair< T > &  y 
)
inline

Determines whether x >= y using operator<.

std::enable_if< std::is_integral<U>::value && std::is_unsigned<U>::value, bool>::type drake::operator>= ( const U &  value,
const TypeSafeIndex< Tag > &  tag 
)
std::enable_if_t<!std::is_same<typename Bool<T>::value_type, bool>::value, Bool<T> > drake::operator|| ( const Bool< T > &  b1,
const Bool< T > &  b2 
)

Provides logical OR operator (||) between Bool<T> and Bool<T> when Bool<T>::value_type is not bool.

std::enable_if_t<!std::is_same<typename Bool<T>::value_type, bool>::value, Bool<T> > drake::operator|| ( const typename Bool< T >::value_type &  v1,
const Bool< T > &  b2 
)

Provides logical OR operator (||) between Bool<T>::value_type and Bool<T> when Bool<T>::value_type is not bool.

std::enable_if_t<!std::is_same<typename Bool<T>::value_type, bool>::value, Bool<T> > drake::operator|| ( const Bool< T > &  b1,
const typename Bool< T >::value_type &  v2 
)

Provides logical OR operator (||) between Bool<T> and Bool<T>::value_type when Bool<T>::value_type is not bool.

bool drake::SortedVectorsHaveIntersection ( const std::vector< T > &  a,
const std::vector< T > &  b 
)

Checks for the existence of a non-empty intersection between two sorted std::vector's.

Parameters
[in]aFirst vector.
[in]bSecond vector.
Template Parameters
TThe type of the elements in the input vectors a and b. This is expected to be an integral type or a pointer type.
Returns
true if there is a non-empty intersection between vectors; false otherwise.

Elements are compared using operator< and the vectors must be sorted with respect to the same operator.

This algorithm only works on std::vector's to take advantage of their fast and random access.

Entries can be repeated as long as they are sorted. For vector a of size Na and vector b of size Nb the complexity is at most Order(Na + Nb). The algorithm executes in constant time for vectors with disjoint entries. An example of the worst case scenario is given below:

 a = (10, 20, 30)
 b = (15, 25, 35)

In this case the algorithm needs to scan both vectors from start to end.

Here is the caller graph for this function:

std::unique_ptr<T> drake::static_pointer_cast ( std::unique_ptr< U > &&  other)
noexcept

Casts the object owned by the std::unique_ptr other from type U to T; no runtime type checking is performed.

This method is analogous to the built-in std::static_pointer_cast that operates on a std::shared_ptr.

Note that this function only supports default deleters.

Here is the caller graph for this function:

std::string temp_directory ( )

Returns a directory location suitable for temporary files.

Returns
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.
Exceptions
std::runtime_errorIf the path referred to by TEST_TMPDIR or ${TMPDIR:-/tmp}/robotlocomotion_drake_XXXXXX cannot be created, does not exist, or is not a directory.

Here is the caller graph for this function:

drake::TEST_F ( DeprecatedBoolTestDouble  ,
Constructor   
)
drake::TEST_F ( BoolTestDouble  ,
TypeCheck   
)
drake::TEST_F ( DeprecatedBoolTestDouble  ,
TrueFalse   
)
drake::TEST_F ( DeprecatedBoolTestDouble  ,
CopyConstructor   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestDouble  ,
All   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestDouble  ,
MoveConstructor   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestDouble  ,
AllOf   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestDouble  ,
CopyAssign   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestDouble  ,
Any   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestDouble  ,
MoveAssign   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestDouble  ,
AnyOf   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestDouble  ,
TypeCheck   
)
drake::TEST_F ( BoolTestDouble  ,
None   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestDouble  ,
Value   
)
drake::TEST_F ( DeprecatedBoolTestDouble  ,
IfThenElse   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestDouble  ,
NoneOf   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestDouble  ,
Cond   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestDouble  ,
LogicalOperators   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestAutoDiffXd  ,
TypeCheck   
)
drake::TEST_F ( BoolTestAutoDiffXd  ,
AllOf   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestAutoDiffXd  ,
TypeCheck   
)
drake::TEST_F ( DeprecatedBoolTestAutoDiffXd  ,
TrueFalse   
)
drake::TEST_F ( BoolTestAutoDiffXd  ,
AnyOf   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestAutoDiffXd  ,
ExtractBoolOrThrow   
)
drake::TEST_F ( DeprecatedBoolTestAutoDiffXd  ,
Value   
)
drake::TEST_F ( DeprecatedBoolTestAutoDiffXd  ,
IfThenElse   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestAutoDiffXd  ,
NoneOf   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestAutoDiffXd  ,
Cond   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestAutoDiffXd  ,
LogicalOperators   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestSymbolic  ,
TypeCheck   
)
drake::TEST_F ( DeprecatedBoolTestSymbolic  ,
TypeCheck   
)
drake::TEST_F ( BoolTestSymbolic  ,
All   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestSymbolic  ,
TrueFalse   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestSymbolic  ,
ConstructFromBool   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestSymbolic  ,
AllOf   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestSymbolic  ,
ExtractBoolOrThrowNoException   
)
drake::TEST_F ( DeprecatedBoolTestSymbolic  ,
ExtractBoolOrThrowException   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestSymbolic  ,
Any   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestSymbolic  ,
AnyOf   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestSymbolic  ,
ExtractBoolOrThrowConsistency   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestSymbolic  ,
None   
)

Here is the call graph for this function:

drake::TEST_F ( BoolTestSymbolic  ,
NoneOf   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestSymbolic  ,
Value   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestSymbolic  ,
IfThenElse   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestSymbolic  ,
Cond   
)

Here is the call graph for this function:

drake::TEST_F ( DeprecatedBoolTestSymbolic  ,
LogicalOperators   
)

Here is the call graph for this function:

Tpl<Ts...> drake::type_bind ( type_pack< Ts... >  )

Returns an expression (only to be used in decltype) for inferring and binding a parameter pack to a template.

constexpr size_t drake::type_hash ( )

Provides short-hand for hashing a type.

void drake::type_visit ( Visitor &&  visitor,
type_pack< Ts... >  = {},
template_single_tag< Predicate >  = {} 
)

Visits each type in a type pack.

Template Parameters
VisitWithVisit helper.
See also
type_visit_with_default, type_visit_with_tag.
Template Parameters
PredicatePredicate operating on the type dictated by VisitWith.
Parameters
visitorLambda or functor for visiting a type.

Here is the caller graph for this function:

void drake::unused ( const Args &  ...)

Documents the argument(s) as unused, placating GCC's -Wunused-parameter warning.

This can be called within function bodies to mark that certain parameters are unused.

When possible, removing the unused parameter is better than placating the warning. However, in some cases the parameter is part of a virtual API or template concept that is used elsewhere, so we can't remove it. In those cases, this function might be an appropriate work-around.

Here's rough advice on how to fix Wunused-parameter warnings:

(1) If the parameter can be removed entirely, prefer that as the first choice. (This may not be possible if, e.g., a method must match some virtual API or template concept.)

(2) Unless the parameter name has acute value, prefer to omit the name of the parameter, leaving only the type, e.g.

void Print(const State& state) override { /* No state to print. */ }

changes to

void Print(const State&) override { /* No state to print. */}

This no longer triggers the warning and further makes it clear that a parameter required by the API is definitively unused in the function.

This is an especially good solution in the context of method definitions (vs declarations); the parameter name used in a definition is entirely irrelevant to Doxygen and most readers.

(3) When leaving the parameter name intact has acute value, it is acceptable to keep the name and mark it unused. For example, when the name appears as part of a virtual method's base class declaration, the name is used by Doxygen to document the method, e.g.,

/** Sets the default State of a System. This default implementation is to
* set all zeros. Subclasses may override to use non-zero defaults. The
* custom defaults may be based on the given @p context, when relevant. */
virtual void SetDefault(const Context<T>& context, State<T>* state) const {
unused(context);
state->SetZero();
}

Here is the caller graph for this function:

Variable Documentation

const char *const kDrakeResourceRootEnvironmentVariableName
Initial value:
=
"DRAKE_RESOURCE_ROOT"

The name of the environment variable that provides the first place where FindResource attempts to look.

The environment variable is allowed to be unset or empty; in that case, FindResource will attempt to use other locations without complaint.

The value is guaranteed to be "DRAKE_RESOURCE_ROOT". (For some users, it may be easier to hard-code a value than refer to this constant.)

When the environment variable is set, resources are sought in relation to it by appending the FindResource() resource_path to the environment variable (with an intermediate / as appropriate). For example, if the resource_path is drake/examples/pendulum/Pendulum.urdf and the DRAKE_RESOURCE_ROOT is set to /home/someuser/foo then the resource will be sought at /home/someuser/foo/drake/examples/pendulum/Pendulum.urdf.

The intended use of this variable is to seek resources from an installed copy of Drake, in case other methods have failed.

constexpr int kHomogeneousTransformSize = 16
constexpr int kQuaternionSize = 4
const int kRotmatSize = kSpaceDimension * kSpaceDimension
constexpr int kRpySize = 3
constexpr int kSpaceDimension = 3
constexpr auto nullopt = stx::nullopt