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

Detailed Description

template<typename T>
struct drake::geometry::SignedDistanceToPoint< T >

The data for reporting the signed distance from a query point to a geometry.

Reports the result of a signed distance query between a query point Q and geometry G. This includes G's id, the signed distance, the nearest point N on the surface of G, and the gradient of the signed distance with respect to the position of Q. Generally, the gradient of the signed distance function is not defined everywhere. The value reported in this struct depends on the query function returning it. Refer to the query function's documentation for what value it will report for otherwise undefined gradient values.

Template Parameters
TThe underlying scalar type. Must be a valid Eigen scalar.

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

Public Member Functions

 SignedDistanceToPoint ()=default
 
 SignedDistanceToPoint (GeometryId id_G_in, const Vector3< T > &p_GN_in, T distance_in, const Vector3< T > &grad_W_in)
 Constructs SignedDistanceToPoint struct from calculated results. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 SignedDistanceToPoint (const SignedDistanceToPoint &)=default
 
SignedDistanceToPointoperator= (const SignedDistanceToPoint &)=default
 
 SignedDistanceToPoint (SignedDistanceToPoint &&)=default
 
SignedDistanceToPointoperator= (SignedDistanceToPoint &&)=default
 

Public Attributes

GeometryId id_G
 The id of the geometry G to which we measure distance from the query point Q. More...
 
Vector3< T > p_GN
 The position of the nearest point N on G's surface from the query point Q, expressed in G's frame. More...
 
distance {}
 The signed distance from the query point Q to the nearest point N on the surface of geometry G. More...
 
Vector3< T > grad_W
 The gradient vector of the distance function with respect to the query point Q, expressed in world frame W. More...
 

Constructor & Destructor Documentation

◆ SignedDistanceToPoint() [1/4]

SignedDistanceToPoint ( const SignedDistanceToPoint< T > &  )
default

◆ SignedDistanceToPoint() [2/4]

◆ SignedDistanceToPoint() [3/4]

SignedDistanceToPoint ( )
default

◆ SignedDistanceToPoint() [4/4]

SignedDistanceToPoint ( GeometryId  id_G_in,
const Vector3< T > &  p_GN_in,
distance_in,
const Vector3< T > &  grad_W_in 
)

Constructs SignedDistanceToPoint struct from calculated results.

Parameters
id_G_inThe id of the geometry G to which we measure distance from the query point Q.
p_GN_inThe position of the nearest point N on G's surface from the query point Q, expressed in G's frame.
distance_inThe signed distance from the query point Q to the nearest point N on the surface of geometry G. It is positive if Q is outside G. It is negative if Q is inside G. It is zero if Q is on the boundary of G.
grad_W_inThe gradient vector of the distance function with respect to the query point Q, expressed in world frame W.
Note
grad_W is not well defined everywhere. For example, when computing the distance from a point to a sphere, and the point coincides with the center of the sphere, grad_W is not well defined (as it can be computed as p_GQ / |p_GQ|, but the denominator is 0). When grad_W is not well defined, and we instantiate SignedDistanceToPoint<T> with T being an AutoDiffScalar (like AutoDiffXd), the gradient of the query result is not well defined either, so the user should use the gradient in p_GN, distance and grad_W with caution.
Precondition
grad_W_in must not contain NaN.

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

Member Data Documentation

◆ distance

T distance {}

The signed distance from the query point Q to the nearest point N on the surface of geometry G.

It is positive if Q is outside G. It is negative if Q is inside G. It is zero if Q is on the boundary of G.

◆ grad_W

Vector3<T> grad_W

The gradient vector of the distance function with respect to the query point Q, expressed in world frame W.

◆ id_G

GeometryId id_G

The id of the geometry G to which we measure distance from the query point Q.

◆ p_GN

Vector3<T> p_GN

The position of the nearest point N on G's surface from the query point Q, expressed in G's frame.


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