Drake
Drake C++ Documentation
SceneGraphCollisionChecker Class Referencefinal

Detailed Description

An implementation of CollisionChecker that uses SceneGraph to provide collision checks.

Its behavior and limitations are exactly those of SceneGraph, e.g., in terms of what kinds of geometries can be collided.

#include <drake/planning/scene_graph_collision_checker.h>

Public Member Functions

 SceneGraphCollisionChecker (CollisionCheckerParams params)
 Creates a new checker with the given params. More...
 
Does not allow copy, move, or assignment.
void operator= (const SceneGraphCollisionChecker &)=delete
 
- Public Member Functions inherited from CollisionChecker
virtual ~CollisionChecker ()
 
std::unique_ptr< CollisionCheckerClone () const
 
bool SupportsParallelChecking () const
 Does the collision checker support true parallel collision checks? More...
 
 CollisionChecker (CollisionChecker &&)=delete
 
CollisionCheckeroperator= (const CollisionChecker &)=delete
 
CollisionCheckeroperator= (CollisionChecker &&)=delete
 
const RobotDiagram< double > & model () const
 
const multibody::MultibodyPlant< double > & plant () const
 
const multibody::RigidBody< double > & get_body (multibody::BodyIndex body_index) const
 
const std::vector< multibody::ModelInstanceIndex > & robot_model_instances () const
 Gets the set of model instances belonging to the robot. More...
 
bool IsPartOfRobot (const multibody::RigidBody< double > &body) const
 
bool IsPartOfRobot (multibody::BodyIndex body_index) const
 
const Eigen::VectorXd & GetZeroConfiguration () const
 
int num_allocated_contexts () const
 
const CollisionCheckerContextmodel_context (std::optional< int > context_number=std::nullopt) const
 Accesses a collision checking context from within the implicit context pool owned by this collision checker. More...
 
const systems::Context< double > & plant_context (std::optional< int > context_number=std::nullopt) const
 Accesses a multibody plant sub-context context from within the implicit context pool owned by this collision checker. More...
 
const systems::Context< double > & UpdatePositions (const Eigen::VectorXd &q, std::optional< int > context_number=std::nullopt) const
 Updates the generalized positions q in the implicit context specified and returns a reference to the MultibodyPlant's now-updated context. More...
 
const systems::Context< double > & UpdateContextPositions (CollisionCheckerContext *model_context, const Eigen::VectorXd &q) const
 Explicit Context-based version of UpdatePositions(). More...
 
std::shared_ptr< CollisionCheckerContextMakeStandaloneModelContext () const
 Make and track a CollisionCheckerContext. More...
 
void PerformOperationAgainstAllModelContexts (const std::function< void(const RobotDiagram< double > &, CollisionCheckerContext *)> &operation)
 Allows externally-provided operations that must be performed against all contexts in the per-thread context pool, and any standalone contexts made with MakeStandaloneModelContext(). More...
 
bool AddCollisionShape (const std::string &group_name, const BodyShapeDescription &description)
 Requests the addition of a shape to a body, both given in description. More...
 
int AddCollisionShapes (const std::string &group_name, const std::vector< BodyShapeDescription > &descriptions)
 Requests the addition of N shapes to N bodies, each given in the set of descriptions. More...
 
std::map< std::string, intAddCollisionShapes (const std::map< std::string, std::vector< BodyShapeDescription >> &geometry_groups)
 Requests the addition of a collection of shapes to bodies across multiple geometry groups. More...
 
bool AddCollisionShapeToFrame (const std::string &group_name, const multibody::Frame< double > &frameA, const geometry::Shape &shape, const math::RigidTransform< double > &X_AG)
 Requests the addition of shape to the frame A in the checker's model. More...
 
bool AddCollisionShapeToBody (const std::string &group_name, const multibody::RigidBody< double > &bodyA, const geometry::Shape &shape, const math::RigidTransform< double > &X_AG)
 Requests the addition of shape to the body A in the checker's model The added shape will belong to the named geometry group. More...
 
std::map< std::string, std::vector< BodyShapeDescription > > GetAllAddedCollisionShapes () const
 Gets all checker geometries currently added across the whole checker. More...
 
void RemoveAllAddedCollisionShapes (const std::string &group_name)
 Removes all added checker geometries which belong to the named group. More...
 
void RemoveAllAddedCollisionShapes ()
 Removes all added checker geometries from all geometry groups. More...
 
std::optional< doubleMaybeGetUniformRobotEnvironmentPadding () const
 If the padding between all robot bodies and environment bodies is the same, returns the common padding value. More...
 
std::optional< doubleMaybeGetUniformRobotRobotPadding () const
 If the padding between all pairs of robot bodies is the same, returns the common padding value. More...
 
double GetPaddingBetween (multibody::BodyIndex bodyA_index, multibody::BodyIndex bodyB_index) const
 Gets the padding value for the pair of bodies specified. More...
 
double GetPaddingBetween (const multibody::RigidBody< double > &bodyA, const multibody::RigidBody< double > &bodyB) const
 Overload that uses body references. More...
 
void SetPaddingBetween (multibody::BodyIndex bodyA_index, multibody::BodyIndex bodyB_index, double padding)
 Sets the padding value for the pair of bodies specified. More...
 
void SetPaddingBetween (const multibody::RigidBody< double > &bodyA, const multibody::RigidBody< double > &bodyB, double padding)
 Overload that uses body references. More...
 
const Eigen::MatrixXd & GetPaddingMatrix () const
 Gets the collision padding matrix. More...
 
void SetPaddingMatrix (const Eigen::MatrixXd &collision_padding)
 Sets the collision padding matrix. More...
 
double GetLargestPadding () const
 Gets the current largest collision padding across all (robot, *) body pairs. More...
 
void SetPaddingOneRobotBodyAllEnvironmentPairs (multibody::BodyIndex body_index, double padding)
 Sets the environment collision padding for the provided robot body with respect to all environment bodies. More...
 
void SetPaddingAllRobotEnvironmentPairs (double padding)
 Sets the padding for all (robot, environment) pairs. More...
 
void SetPaddingAllRobotRobotPairs (double padding)
 Sets the padding for all (robot, robot) pairs. More...
 
const Eigen::MatrixXi & GetNominalFilteredCollisionMatrix () const
 Returns the "nominal" collision filter matrix. More...
 
const Eigen::MatrixXi & GetFilteredCollisionMatrix () const
 Gets the "active" collision filter matrix. More...
 
void SetCollisionFilterMatrix (const Eigen::MatrixXi &filter_matrix)
 Sets the "active" collision filter matrix. More...
 
bool IsCollisionFilteredBetween (multibody::BodyIndex bodyA_index, multibody::BodyIndex bodyB_index) const
 Checks if collision is filtered between the two bodies specified. More...
 
bool IsCollisionFilteredBetween (const multibody::RigidBody< double > &bodyA, const multibody::RigidBody< double > &bodyB) const
 Overload that uses body references. More...
 
void SetCollisionFilteredBetween (multibody::BodyIndex bodyA_index, multibody::BodyIndex bodyB_index, bool filter_collision)
 Declares the body pair (bodyA, bodyB) to be filtered (or not) based on filter_collision. More...
 
void SetCollisionFilteredBetween (const multibody::RigidBody< double > &bodyA, const multibody::RigidBody< double > &bodyB, bool filter_collision)
 Overload that uses body references. More...
 
void SetCollisionFilteredWithAllBodies (multibody::BodyIndex body_index)
 Declares that body pair (B, O) is filtered (for all bodies O in this checker's plant). More...
 
void SetCollisionFilteredWithAllBodies (const multibody::RigidBody< double > &body)
 Overload that uses body references. More...
 
bool CheckConfigCollisionFree (const Eigen::VectorXd &q, std::optional< int > context_number=std::nullopt) const
 Checks a single configuration for collision using the current thread's associated context. More...
 
bool CheckContextConfigCollisionFree (CollisionCheckerContext *model_context, const Eigen::VectorXd &q) const
 Explicit Context-based version of CheckConfigCollisionFree(). More...
 
std::vector< uint8_t > CheckConfigsCollisionFree (const std::vector< Eigen::VectorXd > &configs, Parallelism parallelize=Parallelism::Max()) const
 Checks a vector of configurations for collision, evaluating in parallel when supported and enabled by parallelize. More...
 
void SetDistanceAndInterpolationProvider (std::shared_ptr< const DistanceAndInterpolationProvider > provider)
 Sets the distance and interpolation provider to use. More...
 
const DistanceAndInterpolationProviderdistance_and_interpolation_provider () const
 Gets the DistanceAndInterpolationProvider in use. More...
 
void SetConfigurationDistanceFunction (const ConfigurationDistanceFunction &distance_function)
 Sets the configuration distance function to distance_function. More...
 
double ComputeConfigurationDistance (const Eigen::VectorXd &q1, const Eigen::VectorXd &q2) const
 Computes configuration-space distance between the provided configurations q1 and q2, using the distance function configured at construction- time or via SetConfigurationDistanceFunction(). More...
 
ConfigurationDistanceFunction MakeStandaloneConfigurationDistanceFunction () const
 
void SetConfigurationInterpolationFunction (const ConfigurationInterpolationFunction &interpolation_function)
 Sets the configuration interpolation function to interpolation_function. More...
 
Eigen::VectorXd InterpolateBetweenConfigurations (const Eigen::VectorXd &q1, const Eigen::VectorXd &q2, double ratio) const
 Interpolates between provided configurations q1 and q2. More...
 
ConfigurationInterpolationFunction MakeStandaloneConfigurationInterpolationFunction () const
 
double edge_step_size () const
 Gets the current edge step size. More...
 
void set_edge_step_size (double edge_step_size)
 Sets the edge step size to edge_step_size. More...
 
bool CheckEdgeCollisionFree (const Eigen::VectorXd &q1, const Eigen::VectorXd &q2, std::optional< int > context_number=std::nullopt) const
 Checks a single configuration-to-configuration edge for collision, using the current thread's associated context. More...
 
bool CheckContextEdgeCollisionFree (CollisionCheckerContext *model_context, const Eigen::VectorXd &q1, const Eigen::VectorXd &q2) const
 Explicit Context-based version of CheckEdgeCollisionFree(). More...
 
bool CheckEdgeCollisionFreeParallel (const Eigen::VectorXd &q1, const Eigen::VectorXd &q2, Parallelism parallelize=Parallelism::Max()) const
 Checks a single configuration-to-configuration edge for collision. More...
 
std::vector< uint8_t > CheckEdgesCollisionFree (const std::vector< std::pair< Eigen::VectorXd, Eigen::VectorXd >> &edges, Parallelism parallelize=Parallelism::Max()) const
 Checks multiple configuration-to-configuration edges for collision. More...
 
EdgeMeasure MeasureEdgeCollisionFree (const Eigen::VectorXd &q1, const Eigen::VectorXd &q2, std::optional< int > context_number=std::nullopt) const
 Checks a single configuration-to-configuration edge for collision, using the current thread's associated context. More...
 
EdgeMeasure MeasureContextEdgeCollisionFree (CollisionCheckerContext *model_context, const Eigen::VectorXd &q1, const Eigen::VectorXd &q2) const
 Explicit Context-based version of MeasureEdgeCollisionFree(). More...
 
EdgeMeasure MeasureEdgeCollisionFreeParallel (const Eigen::VectorXd &q1, const Eigen::VectorXd &q2, Parallelism parallelize=Parallelism::Max()) const
 Checks a single configuration-to-configuration edge for collision. More...
 
std::vector< EdgeMeasureMeasureEdgesCollisionFree (const std::vector< std::pair< Eigen::VectorXd, Eigen::VectorXd >> &edges, Parallelism parallelize=Parallelism::Max()) const
 Checks multiple configuration-to-configuration edge for collision. More...
 
RobotClearance CalcRobotClearance (const Eigen::VectorXd &q, double influence_distance, std::optional< int > context_number=std::nullopt) const
 Calculates the distance, ϕ, and distance Jacobian, Jqᵣ_ϕ, for each potential collision whose distance is less than influence_distance, using the current thread's associated context. More...
 
RobotClearance CalcContextRobotClearance (CollisionCheckerContext *model_context, const Eigen::VectorXd &q, double influence_distance) const
 Explicit Context-based version of CalcRobotClearance(). More...
 
int MaxNumDistances (std::optional< int > context_number=std::nullopt) const
 Returns an upper bound on the number of distances returned by CalcRobotClearance(), using the current thread's associated context. More...
 
int MaxContextNumDistances (const CollisionCheckerContext &model_context) const
 Explicit Context-based version of MaxNumDistances(). More...
 
std::vector< RobotCollisionTypeClassifyBodyCollisions (const Eigen::VectorXd &q, std::optional< int > context_number=std::nullopt) const
 Classifies which robot bodies are in collision (and which type of collision) for the provided configuration q, using the current thread's associated context. More...
 
std::vector< RobotCollisionTypeClassifyContextBodyCollisions (CollisionCheckerContext *model_context, const Eigen::VectorXd &q) const
 Explicit Context-based version of ClassifyBodyCollisions(). More...
 

Additional Inherited Members

- Protected Member Functions inherited from CollisionChecker
 CollisionChecker (CollisionCheckerParams params, bool supports_parallel_checking)
 Derived classes declare upon construction whether they support parallel checking (see SupportsParallelChecking()). More...
 
 CollisionChecker (const CollisionChecker &)
 To support Clone(), allow copying (but not move nor assign). More...
 
void AllocateContexts ()
 Allocate the per-thread context pool, and discontinue mutable access to the robot model. More...
 
virtual std::unique_ptr< CollisionCheckerContextCreatePrototypeContext () const
 Collision checkers that use derived context types can override this implementation to allocate their context type instead. More...
 
bool IsInitialSetup () const
 
RobotDiagram< double > & GetMutableSetupModel ()
 
bool CanEvaluateInParallel () const
 
std::string CriticizePaddingMatrix () const
 

Constructor & Destructor Documentation

◆ SceneGraphCollisionChecker()

Creates a new checker with the given params.

Member Function Documentation

◆ operator=()

void operator= ( const SceneGraphCollisionChecker )
delete

The documentation for this class was generated from the following file: