Drake
Drake C++ Documentation
SignedDistancePair< T > Struct Template Reference

## Detailed Description

### template<typename T> struct drake::geometry::SignedDistancePair< T >

The data for reporting the signed distance between two geometries, A and B.

It provides the id's of the two geometries, the witness points Ca and Cb on the surfaces of A and B, the signed distance, and nhat_BA_W a direction of fastest increasing distance (always unit length and always point outward from B's surface).

• When A and B are separated, distance > 0.
• When A and B are touching or penetrating, distance <= 0.
• By definition, nhat_AB_W must be in the opposite direction of nhat_BA_W.
• (p_WCa - p_Wcb) = distance · nhat_BA_W.
Warning
For two geometries that are just touching (i.e., distance = 0), the underlying code can guarantee a correct value for nhat_BA_W only when one geometry is a sphere, and the other geometry is a sphere, a box, or a cylinder. Otherwise, the underlying code is not in place yet to guarantee a correct value for nhat_BA_W when surfaces are just touching, and the vector will be populated by NaN values.
Template Parameters
 T The underlying scalar type. Must be a valid Eigen scalar.

#include <drake/geometry/query_results/signed_distance_pair.h>

## Public Member Functions

SignedDistancePair ()=default

SignedDistancePair (GeometryId a, GeometryId b, const Vector3< T > &p_ACa_in, const Vector3< T > &p_BCb_in, const T &dist, const Vector3< T > &nhat_BA_W_in)
Constructor. More...

void SwapAAndB ()
Swaps the interpretation of geometries A and B. More...

Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
SignedDistancePair (const SignedDistancePair &)=default

SignedDistancePairoperator= (const SignedDistancePair &)=default

SignedDistancePair (SignedDistancePair &&)=default

SignedDistancePairoperator= (SignedDistancePair &&)=default

## Public Attributes

GeometryId id_A
The id of the first geometry in the pair. More...

GeometryId id_B
The id of the second geometry in the pair. More...

Vector3< T > p_ACa
The witness point on geometry A's surface, expressed in A's frame. More...

Vector3< T > p_BCb
The witness point on geometry B's surface, expressed in B's frame. More...

distance {}
The signed distance between p_ACa and p_BCb. More...

Vector3< T > nhat_BA_W
A direction of fastest increasing distance. More...

## ◆ SignedDistancePair() [1/4]

 SignedDistancePair ( const SignedDistancePair< T > & )
default

## ◆ SignedDistancePair() [2/4]

 SignedDistancePair ( SignedDistancePair< T > && )
default

## ◆ SignedDistancePair() [3/4]

 SignedDistancePair ( )
default

## ◆ SignedDistancePair() [4/4]

 SignedDistancePair ( GeometryId a, GeometryId b, const Vector3< T > & p_ACa_in, const Vector3< T > & p_BCb_in, const T & dist, const Vector3< T > & nhat_BA_W_in )

Constructor.

Parameters
 a The id of the first geometry (A). b The id of the second geometry (B). p_ACa_in The witness point on geometry A's surface, in A's frame. p_BCb_in The witness point on geometry B's surface, in B's frame. dist The signed distance between p_A and p_B. nhat_BA_W_in A direction of fastest increasing distance.
Precondition
nhat_BA_W_in is unit-length.

## ◆ operator=() [1/2]

 SignedDistancePair& operator= ( const SignedDistancePair< T > & )
default

## ◆ operator=() [2/2]

 SignedDistancePair& operator= ( SignedDistancePair< T > && )
default

## ◆ SwapAAndB()

 void SwapAAndB ( )

Swaps the interpretation of geometries A and B.

## ◆ distance

 T distance {}

The signed distance between p_ACa and p_BCb.

## ◆ id_A

 GeometryId id_A

The id of the first geometry in the pair.

## ◆ id_B

 GeometryId id_B

The id of the second geometry in the pair.

## ◆ nhat_BA_W

 Vector3 nhat_BA_W

A direction of fastest increasing distance.

## ◆ p_ACa

 Vector3 p_ACa

The witness point on geometry A's surface, expressed in A's frame.

## ◆ p_BCb

 Vector3 p_BCb

The witness point on geometry B's surface, expressed in B's frame.

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