Namespaces | |
| namespace | assert |
| namespace | common |
| namespace | examples |
| namespace | geometry |
| namespace | lcm |
| namespace | logging |
| namespace | manipulation |
| namespace | math |
| namespace | multibody |
| namespace | perception |
| namespace | planning |
| namespace | schema |
| namespace | solvers |
| namespace | symbolic |
| namespace | systems |
| namespace | trajectories |
| namespace | visualization |
| namespace | yaml |
Classes | |
| class | AbstractValue |
| A fully type-erased container class. More... | |
| 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. | |
| 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... | |
| class | FindResourceResult |
| Models the outcome of drake::FindResource. More... | |
| class | Identifier |
| A simple identifier class. 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 |
| class | ManualTimer |
| Implementation of timing for use with unit tests that control time manually. More... | |
| class | MemoryFile |
| A virtual file, stored in memory. More... | |
| class | NameValue |
| (Advanced) A basic implementation of the Name-Value Pair concept as used in the Serialize / Archive pattern. 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... | |
| struct | ostream_formatter |
| When using fmt >= 9, this is an alias for fmt::ostream_formatter. More... | |
| class | Parallelism |
| Specifies a desired degree of parallelism for a parallelized operation. More... | |
| class | Polynomial |
| A scalar multi-variate polynomial, modeled after the msspoly in spotless. More... | |
| class | RandomGenerator |
| Defines Drake's canonical implementation of the UniformRandomBitGenerator C++ concept (as well as a few conventional extras beyond the concept, e.g., seeds). 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 | RlocationOrError |
| (Advanced.) The return type of FindRunfile(). More... | |
| struct | scalar_predicate |
| A traits struct that describes the return type of predicates over a scalar type (named T). More... | |
| class | ScopeExit |
| Helper class to create a scope exit guard – an object that when destroyed runs func. More... | |
| class | Sha256 |
| Represents a SHA-256 cryptographic checksum. More... | |
| struct | SortedPair |
| This class is similar to the std::pair class. More... | |
| class | SteadyTimer |
| Implementation of timing utility that uses monotonic std::chrono::steady_clock. More... | |
| class | Timer |
| Abstract base class for timing utility. More... | |
| class | TypeSafeIndex |
| A type-safe non-negative index class. More... | |
| struct | uhash |
| A hashing functor, somewhat like std::hash. More... | |
| class | Value |
| A container class for an arbitrary type T (with some restrictions). More... | |
Typedefs | |
| template<typename T> | |
| using | boolean = typename scalar_predicate<T>::type |
| An alias for a boolean-like value, conditioned on the scalar type T. | |
| using | AutoDiffXd = Eigen::AutoDiffScalar<Eigen::VectorXd> |
| An autodiff variable with a dynamic number of partials. | |
| template<int num_vars> | |
| using | AutoDiffd = Eigen::AutoDiffScalar<Eigen::Matrix<double, num_vars, 1> > |
| An autodiff variable with num_vars partials. | |
| 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. | |
| typedef AutoDiffVecd< Eigen::Dynamic, Eigen::Dynamic > | AutoDiffVecXd |
| A dynamic-sized vector of autodiff variables, each with a dynamic-sized vector of partials. | |
| template<typename Scalar> | |
| using | Vector0 = Eigen::Matrix<Scalar, 0, 1> |
| The empty column vector (zero rows, one column), templated on scalar type. | |
| template<typename Scalar> | |
| 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. | |
| template<typename Scalar> | |
| using | Vector2 = Eigen::Matrix<Scalar, 2, 1> |
| A column vector of size 2, templated on scalar type. | |
| template<typename Scalar> | |
| using | Vector3 = Eigen::Matrix<Scalar, 3, 1> |
| A column vector of size 3, templated on scalar type. | |
| template<typename Scalar> | |
| using | Vector4 = Eigen::Matrix<Scalar, 4, 1> |
| A column vector of size 4, templated on scalar type. | |
| template<typename Scalar> | |
| using | Vector6 = Eigen::Matrix<Scalar, 6, 1> |
| A column vector of size 6. | |
| using | Vector6d = Eigen::Matrix<double, 6, 1> |
| A column vector of size 6 of doubles. | |
| template<typename Scalar, int Rows> | |
| using | Vector = Eigen::Matrix<Scalar, Rows, 1> |
| A column vector templated on the number of rows. | |
| template<typename Scalar> | |
| using | VectorX = Eigen::Matrix<Scalar, Eigen::Dynamic, 1> |
| A column vector of any size, templated on scalar type. | |
| 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. | |
| template<typename Scalar> | |
| using | RowVector2 = Eigen::Matrix<Scalar, 1, 2> |
| A row vector of size 2, templated on scalar type. | |
| template<typename Scalar> | |
| using | RowVector3 = Eigen::Matrix<Scalar, 1, 3> |
| A row vector of size 3, templated on scalar type. | |
| template<typename Scalar> | |
| using | RowVector4 = Eigen::Matrix<Scalar, 1, 4> |
| A row vector of size 4, templated on scalar type. | |
| template<typename Scalar> | |
| using | RowVector6 = Eigen::Matrix<Scalar, 1, 6> |
| A row vector of size 6. | |
| template<typename Scalar, int Cols> | |
| using | RowVector = Eigen::Matrix<Scalar, 1, Cols> |
| A row vector templated on the number of columns. | |
| template<typename Scalar> | |
| using | RowVectorX = Eigen::Matrix<Scalar, 1, Eigen::Dynamic> |
| A row vector of any size, templated on scalar type. | |
| template<typename Scalar> | |
| using | Matrix2 = Eigen::Matrix<Scalar, 2, 2> |
| A matrix of 2 rows and 2 columns, templated on scalar type. | |
| template<typename Scalar> | |
| using | Matrix3 = Eigen::Matrix<Scalar, 3, 3> |
| A matrix of 3 rows and 3 columns, templated on scalar type. | |
| template<typename Scalar> | |
| using | Matrix4 = Eigen::Matrix<Scalar, 4, 4> |
| A matrix of 4 rows and 4 columns, templated on scalar type. | |
| template<typename Scalar> | |
| using | Matrix6 = Eigen::Matrix<Scalar, 6, 6> |
| A matrix of 6 rows and 6 columns, templated on scalar type. | |
| template<typename Scalar> | |
| using | Matrix2X = Eigen::Matrix<Scalar, 2, Eigen::Dynamic> |
| A matrix of 2 rows, dynamic columns, templated on scalar type. | |
| template<typename Scalar> | |
| using | Matrix3X = Eigen::Matrix<Scalar, 3, Eigen::Dynamic> |
| A matrix of 3 rows, dynamic columns, templated on scalar type. | |
| template<typename Scalar> | |
| using | Matrix4X = Eigen::Matrix<Scalar, 4, Eigen::Dynamic> |
| A matrix of 4 rows, dynamic columns, templated on scalar type. | |
| template<typename Scalar> | |
| using | Matrix6X = Eigen::Matrix<Scalar, 6, Eigen::Dynamic> |
| A matrix of 6 rows, dynamic columns, templated on scalar type. | |
| template<typename Scalar> | |
| using | MatrixX = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> |
| A matrix of dynamic size, templated on scalar type. | |
| template<typename Scalar> | |
| using | MatrixUpTo6 |
| A matrix of dynamic size templated on scalar type, up to a maximum of 6 rows and 6 columns. | |
| template<typename Scalar> | |
| using | Matrix6xUpTo6 = Eigen::Matrix<Scalar, 6, Eigen::Dynamic, 0, 6, 6> |
| A matrix of 6 rows and dynamic column size up to a maximum of 6, templated on scalar type. | |
| template<typename Scalar, typename Derived> | |
| using | MatrixLikewise |
| A matrix with the same compile-time sizes and storage order as Derived, but with a different scalar type and its default alignment (Eigen::AutoAlign). | |
| using | StrideX = Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic> |
| A fully dynamic Eigen stride. | |
| template<typename Scalar> | |
| using | Quaternion = Eigen::Quaternion<Scalar> |
| A quaternion templated on scalar type. | |
| template<typename Scalar> | |
| using | AngleAxis = Eigen::AngleAxis<Scalar> |
| An AngleAxis templated on scalar type. | |
| template<typename Scalar> | |
| using | Isometry3 = Eigen::Transform<Scalar, 3, Eigen::Isometry> |
| An Isometry templated on scalar type. | |
| using | FileSource = std::variant<std::filesystem::path, MemoryFile> |
| Represents a file. | |
| using | DefaultHasher = internal::FNV1aHasher |
| The default HashAlgorithm concept implementation across Drake. | |
| using | DefaultHash = drake::uhash<DefaultHasher> |
| The default hashing functor, akin to std::hash. | |
| template<typename T> | |
| using | is_cloneable = is_cloneable_internal::is_cloneable_helper<T, void> |
| Provides method for determining at run time if a class is "cloneable". | |
| typedef Polynomial< double > | Polynomiald |
| typedef Eigen::Matrix< Polynomiald, Eigen::Dynamic, 1 > | VectorXPoly |
| A column vector of polynomials; used in several optimization classes. | |
| template<typename T> | |
| using | string_map = std::map<std::string, T, std::less<void>> |
| Like std::map<std::string, T>, but with better defaults than the plain std::map<std::string, T> spelling. | |
| template<typename T> | |
| using | string_multimap = std::multimap<std::string, T, std::less<void>> |
| Like std::multimap<std::string, T>, but with better defaults than the plain std::multimap<std::string, T> spelling. | |
| using | string_set = std::set<std::string, std::less<void>> |
| Like std::set<std::string>, but with better defaults than the plain std::set<std::string> spelling. | |
| using | string_multiset = std::multiset<std::string, std::less<void>> |
| Like std::multiset<std::string>, but with better defaults than the plain std::multiset<std::string> spelling. | |
| template<typename T> | |
| using | string_unordered_map |
| Like std::unordered_map<std::string, T>, but with better defaults than the plain std::unordered_map<std::string, T> spelling. | |
| template<typename T> | |
| using | string_unordered_multimap |
| Like std::unordered_multimap<std::string, T>, but with better defaults than the plain std::unordered_multimap<std::string, T> spelling. | |
| using | string_unordered_set |
| Like std::unordered_set<std::string>, but with better defaults than the plain std::unordered_set<std::string> spelling. | |
| using | string_unordered_multiset |
| Like std::unordered_multiset<std::string>, but with better defaults than the plain std::unordered_multiset<std::string> spelling. | |
Enumerations | |
| enum class | ToleranceType { kAbsolute , kRelative } |
| enum class | RandomDistribution { kUniform = 0 , kGaussian = 1 , kExponential = 2 } |
| Drake supports explicit reasoning about a few carefully chosen random distributions. More... | |
Functions | |
| template<typename DerType> | |
| double | ExtractDoubleOrThrow (const Eigen::AutoDiffScalar< DerType > &scalar) |
| Returns the autodiff scalar's value() as a double. | |
| template<typename DerType, int RowsAtCompileTime, int ColsAtCompileTime, int Options, int MaxRowsAtCompileTime, int MaxColsAtCompileTime> | |
| auto | ExtractDoubleOrThrow (const Eigen::MatrixBase< Eigen::Matrix< Eigen::AutoDiffScalar< DerType >, RowsAtCompileTime, ColsAtCompileTime, Options, MaxRowsAtCompileTime, MaxColsAtCompileTime > > &matrix) |
Returns matrix as an Eigen::Matrix<double, ...> with the same size allocation as matrix. | |
| 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. | |
| 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. | |
| double | if_then_else (bool f_cond, double v_then, double v_else) |
| Provides if-then-else expression for double. | |
| template<typename Derived> | |
| Derived::Scalar | all (const Eigen::DenseBase< Derived > &m) |
Checks truth for all elements in matrix m. | |
| 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. | |
| template<typename Derived> | |
| Derived::Scalar | any (const Eigen::DenseBase< Derived > &m) |
Checks truth for at least one element in matrix m. | |
| 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. | |
| template<typename Derived> | |
| Derived::Scalar | none (const Eigen::MatrixBase< Derived > &m) |
Checks that no elements of m are true. An empty matrix returns true. | |
| 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. | |
| template<typename T, int Rows> | |
| auto | if_then_else (const boolean< T > &f_cond, const Eigen::Matrix< T, Rows, 1 > &m_then, const Eigen::Matrix< T, Rows, 1 > &m_else) |
| Overloads if_then_else for Eigen vectors of m_then and m_else values with with a single f_cond condition to toggle them all at once. | |
| std::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. | |
| template<typename Container> | |
| auto | EigenMapView (Container &&c) |
| Given a random access container (like std::vector, std::array, or C array), returns an Eigen::Map view into that container. | |
| double | ExtractDoubleOrThrow (double scalar) |
Returns scalar as a double. Never throws. | |
| double | ExtractDoubleOrThrow (float scalar) |
Returns scalar as a double. Never throws. | |
| template<typename Derived> | |
| std::enable_if_t< std::is_same_v< typename Derived::Scalar, double >, MatrixLikewise< double, Derived > > | ExtractDoubleOrThrow (const Eigen::MatrixBase< Derived > &matrix) |
Returns matrix as an Eigen::Matrix<double, ...> with the same size allocation as matrix. | |
| std::string | to_string (const FileSource &source) |
| Returns a string representation. | |
| std::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. | |
| FindResourceResult | FindResource (const std::string &resource_path) |
| (Advanced) Attempts to locate a Drake resource named by the given resource_path. | |
| std::string | FindResourceOrThrow (const std::string &resource_path) |
| (Advanced) Convenient wrapper for querying FindResource(resource_path) followed by FindResourceResult::get_absolute_path_or_throw(). | |
| std::optional< std::string > | ReadFile (const std::filesystem::path &path) |
| Returns the content of the file at the given path, or nullopt if it cannot be read. | |
| std::string | ReadFileOrThrow (const std::filesystem::path &path) |
| Returns the content of the file at the given path, or throws if it cannot be read. | |
| bool | HasRunfiles () |
| (Advanced.) Returns true iff this process has Bazel runfiles available. | |
| RlocationOrError | FindRunfile (const std::string &resource_path, const std::string &source_repository={}) |
| (Advanced.) Returns the absolute path to the given resource_path from Bazel runfiles, or else an error message when not found. | |
| auto | fmt_runtime (std::string_view s) |
| When using fmt >= 8, this is an alias for fmt::runtime. | |
| template<typename T> requires (std::is_same_v<T, float> || std::is_same_v<T, double>) | |
| std::string | fmt_floating_point (T x) |
| Returns fmt::to_string(x) but always with at least one digit after the decimal point. | |
| template<typename T> requires (!(std::is_same_v<T, float> || std::is_same_v<T, double>)) | |
| std::string | fmt_floating_point (T x) |
| Returns fmt::to_string(x) but always with at least one digit after the decimal point. | |
| std::string | fmt_debug_string (std::string_view x) |
| Returns fmt::("{:?}", x), i.e, using fmt's "debug string format"; see https://fmt.dev docs for the '? | |
| template<typename Derived> | |
| internal::fmt_eigen_ref< typename Derived::Scalar > | fmt_eigen (const Eigen::MatrixBase< Derived > &matrix) |
| When passing an Eigen::Matrix to fmt, use this wrapper function to instruct fmt to use Drake's custom formatter for Eigen types. | |
| template<typename T> | |
| auto | fmt_streamed (const T &ref) |
| When using fmt >= 9, this is an alias for fmt::streamed. | |
| template<class HashAlgorithm, class T> | |
| std::enable_if_t< std::is_integral_v< T > > | hash_append (HashAlgorithm &hasher, const T &item) noexcept |
| Provides hash_append generic hashing for integral constants. | |
| template<class HashAlgorithm, class T> | |
| void | hash_append (HashAlgorithm &hasher, const T *item) noexcept |
| Provides hash_append generic hashing for bare pointers. | |
| template<class HashAlgorithm, class T> | |
| std::enable_if_t< std::is_enum_v< T > > | hash_append (HashAlgorithm &hasher, const T &item) noexcept |
| Provides hash_append generic hashing for enumerations. | |
| template<class HashAlgorithm, class T> | |
| std::enable_if_t< std::is_floating_point_v< T > > | hash_append (HashAlgorithm &hasher, const T &item) noexcept |
| Provides hash_append generic hashing for floating point values. | |
| 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. | |
| 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. | |
| template<class HashAlgorithm, class T> | |
| void | hash_append (HashAlgorithm &hasher, const std::optional< T > &item) noexcept |
| Provides hash_append generic hashing for std::optional. | |
| 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. | |
| 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. | |
| 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. | |
| template<typename Tag> | |
| std::string | to_string (const drake::Identifier< Tag > &id) |
| Enables use of identifiers with to_string. | |
| 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. | |
| 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. | |
| template<typename T> | |
| NameValue< T > | MakeNameValue (const char *name, T *value) |
| (Advanced) Creates a NameValue. | |
| template<class T, class U> | |
| std::unique_ptr< T > | 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. | |
| template<class T, class U> | |
| std::unique_ptr< T > | 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. | |
| template<class T, class U> | |
| std::unique_ptr< T > | 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::exception. | |
| template<class T, class U> | |
| T * | dynamic_pointer_cast_or_throw (U *other) |
| Casts the pointer other from type U to T using dynamic_cast. | |
| template<typename T> | |
| Polynomial< T > | pow (const Polynomial< T > &base, typename Polynomial< T >::PowerType exponent) |
| Provides power function for Polynomial. | |
| template<typename T, int Rows, int Cols> | |
| std::ostream & | operator<< (std::ostream &os, const Eigen::Matrix< Polynomial< T >, Rows, Cols > &poly_mat) |
| template<typename T> | |
| T | CalcProbabilityDensity (RandomDistribution distribution, const Eigen::Ref< const VectorX< T > > &x) |
| Calculates the density (probability density function) of the multivariate distribution. | |
| 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. | |
| template<class T> | |
| bool | operator< (const SortedPair< T > &x, const SortedPair< T > &y) |
| Compares two pairs using lexicographic ordering. | |
| template<class T> | |
| bool | operator!= (const SortedPair< T > &x, const SortedPair< T > &y) |
| Determine whether two SortedPair objects are not equal using operator==. | |
| template<class T> | |
| bool | operator> (const SortedPair< T > &x, const SortedPair< T > &y) |
| Determines whether x > y using operator<. | |
| template<class T> | |
| bool | operator<= (const SortedPair< T > &x, const SortedPair< T > &y) |
| Determines whether x <= y using operator<. | |
| template<class T> | |
| bool | operator>= (const SortedPair< T > &x, const SortedPair< T > &y) |
| Determines whether x >= y using operator<. | |
| template<class T> | |
| constexpr SortedPair< typename std::decay< T >::type > | MakeSortedPair (T &&x, T &&y) |
| A convenience wrapper for creating a sorted pair from two objects. | |
| template<class C> | |
| constexpr auto | ssize (const C &c) -> std::common_type_t< std::ptrdiff_t, std::make_signed_t< decltype(c.size())> > |
| Implements C++20 std::ssize() for earlier compilers. | |
| template<class T, std::ptrdiff_t N> | |
| constexpr std::ptrdiff_t | ssize (const T(&array)[N]) noexcept |
| This signature returns the size of built-in (C style) arrays. | |
| 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. | |
| double | ExtractDoubleOrThrow (const symbolic::Expression &e) |
| Returns the symbolic expression's value() as a double. | |
| template<typename Derived> | |
| std::enable_if_t< std::is_same_v< typename Derived::Scalar, symbolic::Expression >, MatrixLikewise< double, Derived > > | ExtractDoubleOrThrow (const Eigen::MatrixBase< Derived > &matrix) |
Returns matrix as an Eigen::Matrix<double, ...> with the same size allocation as matrix. | |
| std::string | temp_directory () |
| Returns a directory location suitable for temporary files. | |
| logging::logger * | log () |
| Retrieve an instance of a logger to use for logging; for example: | |
| template<typename Tag, typename U> | |
| std::enable_if_t< std::is_integral_v< U > &&std::is_unsigned_v< U >, bool > | operator== (const U &value, const TypeSafeIndex< Tag > &tag) |
| template<typename Tag, typename U> | |
| std::enable_if_t< std::is_integral_v< U > &&std::is_unsigned_v< U >, bool > | operator!= (const U &value, const TypeSafeIndex< Tag > &tag) |
| template<typename Tag, typename U> | |
| std::enable_if_t< std::is_integral_v< U > &&std::is_unsigned_v< U >, bool > | operator< (const U &value, const TypeSafeIndex< Tag > &tag) |
| template<typename Tag, typename U> | |
| std::enable_if_t< std::is_integral_v< U > &&std::is_unsigned_v< U >, bool > | operator<= (const U &value, const TypeSafeIndex< Tag > &tag) |
| template<typename Tag, typename U> | |
| std::enable_if_t< std::is_integral_v< U > &&std::is_unsigned_v< U >, bool > | operator> (const U &value, const TypeSafeIndex< Tag > &tag) |
| template<typename Tag, typename U> | |
| std::enable_if_t< std::is_integral_v< U > &&std::is_unsigned_v< U >, bool > | 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. | |
| template<typename Tag> | |
| std::ostream & | operator<< (std::ostream &out, const Identifier< Tag > &id) |
| Streaming output operator. | |
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
| |
| 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 | |
| template<typename T> | |
| constexpr bool | is_default_scalar |
| static constexpr auto | eigen_all = Eigen::placeholders::all |
| A portable alias for Eigen::placeholders::all. | |
| const char *const | kDrakeResourceRootEnvironmentVariableName |
| The name of the environment variable that provides the first place where FindResource attempts to look. | |
| using AngleAxis = Eigen::AngleAxis<Scalar> |
An AngleAxis templated on scalar type.
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.
| using DefaultHash = drake::uhash<DefaultHasher> |
The default hashing functor, akin to std::hash.
| using DefaultHasher = internal::FNV1aHasher |
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 FileSource = std::variant<std::filesystem::path, MemoryFile> |
Represents a file.
The file can be on-disk or in-memory.
| using is_cloneable = is_cloneable_internal::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):
Definition of "cloneability"
To be cloneable, the class Foo must have a public method of the form:
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.
| T | The 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 Matrix6xUpTo6 = Eigen::Matrix<Scalar, 6, Eigen::Dynamic, 0, 6, 6> |
A matrix of 6 rows and dynamic column size up to a maximum of 6, templated on scalar type.
| using MatrixLikewise |
A matrix with the same compile-time sizes and storage order as Derived, but with a different scalar type and its default alignment (Eigen::AutoAlign).
| using MatrixUpTo6 |
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.
| typedef Polynomial<double> Polynomiald |
| using Quaternion = Eigen::Quaternion<Scalar> |
A quaternion templated on scalar type.
| using RowVector = Eigen::Matrix<Scalar, 1, Cols> |
A row vector templated on the number of columns.
| 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 StrideX = Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic> |
A fully dynamic Eigen stride.
| using string_map = std::map<std::string, T, std::less<void>> |
Like std::map<std::string, T>, but with better defaults than the plain std::map<std::string, T> spelling.
We need std::less<void> as the comparison function so that std::string_view and const char* can be used as lookup keys without copying them to a std::string.
| using string_multimap = std::multimap<std::string, T, std::less<void>> |
Like std::multimap<std::string, T>, but with better defaults than the plain std::multimap<std::string, T> spelling.
We need std::less<void> as the comparison function so that std::string_view and const char* can be used as lookup keys without copying them to a std::string.
| using string_multiset = std::multiset<std::string, std::less<void>> |
Like std::multiset<std::string>, but with better defaults than the plain std::multiset<std::string> spelling.
We need std::less<void> as the comparison function so that std::string_view and const char* can be used as lookup keys without copying them to a std::string.
| using string_set = std::set<std::string, std::less<void>> |
Like std::set<std::string>, but with better defaults than the plain std::set<std::string> spelling.
We need std::less<void> as the comparison function so that std::string_view and const char* can be used as lookup keys without copying them to a std::string.
| using string_unordered_map |
Like std::unordered_map<std::string, T>, but with better defaults than the plain std::unordered_map<std::string, T> spelling.
We need the custom hash and comparison functions so that std::string_view and const char* can be used as lookup keys without copying them to a std::string.
| using string_unordered_multimap |
Like std::unordered_multimap<std::string, T>, but with better defaults than the plain std::unordered_multimap<std::string, T> spelling.
We need the custom hash and comparison functions so that std::string_view and const char* can be used as lookup keys without copying them to a std::string.
Like std::unordered_multiset<std::string>, but with better defaults than the plain std::unordered_multiset<std::string> spelling.
We need the custom hash and comparison functions so that std::string_view and const char* can be used as lookup keys without copying them to a std::string.
| using string_unordered_set |
Like std::unordered_set<std::string>, but with better defaults than the plain std::unordered_set<std::string> spelling.
We need the custom hash and comparison functions so that std::string_view and const char* can be used as lookup keys without copying them to a std::string.
| using Vector = Eigen::Matrix<Scalar, Rows, 1> |
A column vector templated on the number of rows.
| using Vector0 = Eigen::Matrix<Scalar, 0, 1> |
The empty column vector (zero rows, one column), templated on scalar type.
| using Vector1 = Eigen::Matrix<Scalar, 1, 1> |
A column vector of size 1 (that is, a scalar), templated on scalar type.
| 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.
| typedef Eigen::Matrix<Polynomiald, Eigen::Dynamic, 1> VectorXPoly |
A column vector of polynomials; used in several optimization classes.
|
strong |
Drake supports explicit reasoning about a few carefully chosen random distributions.
| Enumerator | |
|---|---|
| kUniform | Vector elements are independent and uniformly distributed ∈ [0.0, 1.0). |
| kGaussian | Vector elements are independent and drawn from a mean-zero, unit-variance normal (Gaussian) distribution. |
| kExponential | Vector elements are independent and drawn from an exponential distribution with λ=1.0. |
|
strong |
| Derived::Scalar 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.
| 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.
An empty matrix returns true.
| Derived::Scalar 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.
| 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.
An empty matrix returns false.
| T CalcProbabilityDensity | ( | RandomDistribution | distribution, |
| const Eigen::Ref< const VectorX< T > > & | x ) |
Calculates the density (probability density function) of the multivariate distribution.
| distribution | The distribution type. |
| x | The value of the sampled vector. |
| T | The scalar type, which must be one of the default nonsymbolic scalars. |
| 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.
| ScalarType cond | ( | const decltype(ScalarType()< ScalarType())& | f_cond, |
| const ScalarType & | e_then, | ||
| Rest... | rest ) |
| ScalarType cond | ( | const ScalarType & | e | ) |
| 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.
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).
|
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.
| std::unique_ptr< T > 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::exception.
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.
| std::exception | if the cast fails. |
Note that this function only supports default deleters.
| T * dynamic_pointer_cast_or_throw | ( | U * | other | ) |
Casts the pointer other from type U to T using dynamic_cast.
The result is never nullptr.
This differs from the C++ built-in dynamic_cast by providing a nicer exception message, and always throwing on any failure.
| std::exception | if other is nullptr or the cast fails. |
| auto EigenMapView | ( | Container && | c | ) |
Given a random access container (like std::vector, std::array, or C array), returns an Eigen::Map view into that container.
Because this effectively forms a reference to borrowed memory, you must be be careful using the return value as anything other than a temporary. The Map return value currently uses Eigen::Dynamic size at compile time even when the container is fixed-size (e.g., std::array); if that ever turns into a performance bottleneck in practice, it would be plausible to interrogate the size and return a fixed-size Map, instead.
| double ExtractDoubleOrThrow | ( | const Eigen::AutoDiffScalar< DerType > & | scalar | ) |
Returns the autodiff scalar's value() as a double.
Never throws. Overloads ExtractDoubleOrThrow from common/extract_double.h.
| std::enable_if_t< std::is_same_v< typename Derived::Scalar, double >, MatrixLikewise< double, Derived > > ExtractDoubleOrThrow | ( | const Eigen::MatrixBase< Derived > & | matrix | ) |
Returns matrix as an Eigen::Matrix<double, ...> with the same size allocation as matrix.
Calls ExtractDoubleOrThrow on each element of the matrix, and therefore throws if any one of the extractions fail.
| std::enable_if_t< std::is_same_v< typename Derived::Scalar, symbolic::Expression >, MatrixLikewise< double, Derived > > ExtractDoubleOrThrow | ( | const Eigen::MatrixBase< Derived > & | matrix | ) |
Returns matrix as an Eigen::Matrix<double, ...> with the same size allocation as matrix.
Calls ExtractDoubleOrThrow on each element of the matrix, and therefore throws if any one of the extractions fail.
| auto ExtractDoubleOrThrow | ( | const Eigen::MatrixBase< Eigen::Matrix< Eigen::AutoDiffScalar< DerType >, RowsAtCompileTime, ColsAtCompileTime, Options, MaxRowsAtCompileTime, MaxColsAtCompileTime > > & | matrix | ) |
Returns matrix as an Eigen::Matrix<double, ...> with the same size allocation as matrix.
Calls ExtractDoubleOrThrow on each element of the matrix, and therefore throws if any one of the extractions fail.
| double ExtractDoubleOrThrow | ( | const symbolic::Expression & | e | ) |
Returns the symbolic expression's value() as a double.
| std::exception | if it is not possible to evaluate the symbolic expression with an empty environment. |
| double ExtractDoubleOrThrow | ( | float | scalar | ) |
Returns scalar as a double. Never throws.
| FindResourceResult FindResource | ( | const std::string & | resource_path | ) |
(Advanced) 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 an error result. The resource_path must refer to a file (not a directory).
The search scans for the resource in the following resource roots and in the following order:
The first resource root from the list that exists is used to find any and all Drake resources. If the resource root does not contain the resource, the result is an error even (if a resource root lower on the list happens to have the resource). If all three roots are unavailable, then returns an error result.
| std::string FindResourceOrThrow | ( | const std::string & | resource_path | ) |
(Advanced) Convenient wrapper for querying FindResource(resource_path) followed by FindResourceResult::get_absolute_path_or_throw().
The primary purpose of this function is for Drake's software internals to locate Drake resources (e.g., config files) within Drake's build system. In most cases, end users should not need to use it.
Do NOT use this function to feed into a drake::multibody::parsing::Parser. Instead, use parser.AddModelsFromUrl() in coordination with the parser's PackageMap.
| RlocationOrError FindRunfile | ( | const std::string & | resource_path, |
| const std::string & | source_repository = {} ) |
(Advanced.) Returns the absolute path to the given resource_path from Bazel runfiles, or else an error message when not found.
When HasRunfiles() is false, returns an error.
| resource_path | The path to find, formulated as the repository name followed by package and filename, e.g., "repository/topdir/subdir/file.ext". Drake resource paths look like "drake/common/foo.txt". |
| source_repository | When looking up a Drake runfile, this value is ignored (and therefore may be set to anything). Otherwise, it should be set to the value of the preprocessor definition BAZEL_CURRENT_REPOSITORY or else when running with bzlmod enabled you risk using an incorrect repo_mapping. That preprocessor definition is Bazel magic that takes on different values depending on which translation unit is being compiled (and is undefined unless you add Bazel's runfiles library to your own library's deps = ... directly), so cannot be used as the default value here. |
| std::string fmt_debug_string | ( | std::string_view | x | ) |
Returns fmt::("{:?}", x), i.e, using fmt's "debug string format"; see https://fmt.dev docs for the '?
' presentation type for details. We provide this wrapper because not all of our supported platforms have a new-enough fmt to rely on it. On platforms with older fmt, we use a Drake re-implementation of the feature that does NOT handle unicode correctly.
| internal::fmt_eigen_ref< typename Derived::Scalar > fmt_eigen | ( | const Eigen::MatrixBase< Derived > & | matrix | ) |
When passing an Eigen::Matrix to fmt, use this wrapper function to instruct fmt to use Drake's custom formatter for Eigen types.
Within Drake, when formatting an Eigen matrix into a string you must wrap the Eigen object as fmt_eigen(M). This holds true whether it be for logging, error messages, debugging, or etc.
For example:
| std::string fmt_floating_point | ( | T | x | ) |
Returns fmt::to_string(x) but always with at least one digit after the decimal point.
Different versions of fmt disagree on whether to omit the trailing ".0" when formatting integer-valued floating-point numbers.
| T | must be either float or double. |
| std::string fmt_floating_point | ( | T | x | ) |
Returns fmt::to_string(x) but always with at least one digit after the decimal point.
Different versions of fmt disagree on whether to omit the trailing ".0" when formatting integer-valued floating-point numbers.
| T | must be either float or double. |
| auto fmt_runtime | ( | std::string_view | s | ) |
When using fmt >= 8, this is an alias for fmt::runtime.
When using fmt < 8, this is a no-op.
| auto fmt_streamed | ( | const T & | ref | ) |
When using fmt >= 9, this is an alias for fmt::streamed.
When using fmt < 9, this uses a polyfill instead.
Within Drake, the nominal use for fmt::streamed is when formatting third-party types that provide operator<< support but not fmt::formatter<T> support. Once we stop using FMT_DEPRECATED_OSTREAM=1, compilation errors will help you understand where you are required to use this wrapper.
|
noexcept |
Provides hash_append generic hashing for std::string.
(Technically, any string based on CharT = char.)
|
noexcept |
Provides hash_append generic hashing for std::map.
Note that there is no hash_append overload for std::unordered_map. See N3980 for details.
|
noexcept |
Provides hash_append generic hashing for std::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.
|
noexcept |
Provides hash_append generic hashing for std::pair.
|
noexcept |
Provides hash_append generic hashing for std::set.
Note that there is no hash_append overload for std::unordered_set. See N3980 for details.
|
noexcept |
Provides hash_append generic hashing for integral constants.
|
noexcept |
Provides hash_append generic hashing for enumerations.
|
noexcept |
Provides hash_append generic hashing for floating point values.
|
noexcept |
Provides hash_append generic hashing for bare pointers.
|
noexcept |
Provides hash_append generic hashing for a range, as given by two iterators.
| bool HasRunfiles | ( | ) |
(Advanced.) Returns true iff this process has Bazel runfiles available.
For both C++ and Python programs, and no matter what workspace a program resides in (@drake or otherwise), this will be true when running bazel-bin/pkg/program or bazel test //pkg:program or bazel run pkg:program.
| 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.
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).
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.
| auto if_then_else | ( | const boolean< T > & | f_cond, |
| const Eigen::Matrix< T, Rows, 1 > & | m_then, | ||
| const Eigen::Matrix< T, Rows, 1 > & | m_else ) |
Overloads if_then_else for Eigen vectors of m_then and m_else values with with a single f_cond condition to toggle them all at once.
| 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.
Special values (infinities, NaN, etc.) do not compare as equal elements.
| 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.
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.
| std::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.
| logging::logger * log | ( | ) |
Retrieve an instance of a logger to use for logging; for example:
drake::log()->info("potato!")
See the text_logging.h documentation for a short tutorial.
| NameValue< T > MakeNameValue | ( | const char * | name, |
| T * | value ) |
(Advanced) Creates a NameValue.
The conventional method for calling this function is the DRAKE_NVP sugar macro below.
Both pointers are aliased for the lifetime of the return value.
|
constexpr |
A convenience wrapper for creating a sorted pair from two objects.
| x | The first_ object. |
| y | The second_ object. |
| std::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.
| Derived::Scalar none | ( | const Eigen::MatrixBase< Derived > & | m | ) |
Checks that no elements of m are true. An empty matrix returns true.
| 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.
An empty matrix returns true.
| bool operator!= | ( | const SortedPair< T > & | x, |
| const SortedPair< T > & | y ) |
Determine whether two SortedPair objects are not equal using operator==.
| std::enable_if_t< std::is_integral_v< U > &&std::is_unsigned_v< U >, bool > operator!= | ( | const U & | value, |
| const TypeSafeIndex< Tag > & | tag ) |
| bool operator< | ( | const SortedPair< T > & | x, |
| const SortedPair< T > & | y ) |
Compares two pairs using lexicographic ordering.
| std::enable_if_t< std::is_integral_v< U > &&std::is_unsigned_v< U >, bool > operator< | ( | const U & | value, |
| const TypeSafeIndex< Tag > & | tag ) |
| std::ostream & operator<< | ( | std::ostream & | os, |
| const Eigen::Matrix< Polynomial< T >, Rows, Cols > & | poly_mat ) |
| bool operator<= | ( | const SortedPair< T > & | x, |
| const SortedPair< T > & | y ) |
Determines whether x <= y using operator<.
| std::enable_if_t< std::is_integral_v< U > &&std::is_unsigned_v< U >, bool > operator<= | ( | const U & | value, |
| const TypeSafeIndex< Tag > & | tag ) |
| 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.
| std::enable_if_t< std::is_integral_v< U > &&std::is_unsigned_v< U >, bool > operator== | ( | const U & | value, |
| const TypeSafeIndex< Tag > & | tag ) |
| bool operator> | ( | const SortedPair< T > & | x, |
| const SortedPair< T > & | y ) |
Determines whether x > y using operator<.
| std::enable_if_t< std::is_integral_v< U > &&std::is_unsigned_v< U >, bool > operator> | ( | const U & | value, |
| const TypeSafeIndex< Tag > & | tag ) |
| bool operator>= | ( | const SortedPair< T > & | x, |
| const SortedPair< T > & | y ) |
Determines whether x >= y using operator<.
| std::enable_if_t< std::is_integral_v< U > &&std::is_unsigned_v< U >, bool > operator>= | ( | const U & | value, |
| const TypeSafeIndex< Tag > & | tag ) |
| Polynomial< T > pow | ( | const Polynomial< T > & | base, |
| typename Polynomial< T >::PowerType | exponent ) |
Provides power function for Polynomial.
| std::optional< std::string > ReadFile | ( | const std::filesystem::path & | path | ) |
Returns the content of the file at the given path, or nullopt if it cannot be read.
Note that the path is a filesystem path, not a resource_path.
| std::string ReadFileOrThrow | ( | const std::filesystem::path & | path | ) |
Returns the content of the file at the given path, or throws if it cannot be read.
Note that the path is a filesystem path, not a resource_path.
|
constexpr |
Implements C++20 std::ssize() for earlier compilers.
See https://en.cppreference.com/w/cpp/iterator/size for documentation. Will be removed once all Drake-supported platforms offer std::ssize().
|
constexprnoexcept |
This signature returns the size of built-in (C style) arrays.
|
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.
| std::string temp_directory | ( | ) |
Returns a directory location suitable for temporary files.
The directory will be called ${parent}/robotlocomotion_drake_XXXXXX where each X is replaced by a character from the portable filename character set. The path ${parent} is defined as one of the following (in decreasing priority):
If successful, this will always create a new directory. While the caller is not obliged to delete the directory, it has full power to do so based on specific context and need.
| if | the directory ${parent}/robotlocomotion_drake_XXXXXX cannot be created, or is not a directory. |
| std::string to_string | ( | const drake::Identifier< Tag > & | id | ) |
Enables use of identifiers with to_string.
It requires ADL to work. So, it should be invoked as: to_string(id); and should be preceded by using std::to_string.
| std::string to_string | ( | const FileSource & | source | ) |
Returns a string representation.
| void 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.
changes to
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.,
|
staticconstexpr |
A portable alias for Eigen::placeholders::all.
|
extern |
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.