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.
T | The 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 | |
SignedDistanceToPoint & | operator= (const SignedDistanceToPoint &)=default |
SignedDistanceToPoint (SignedDistanceToPoint &&)=default | |
SignedDistanceToPoint & | operator= (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... | |
T | 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... | |
|
default |
|
default |
|
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.
id_G_in | The id of the geometry G to which we measure distance from the query point Q. |
p_GN_in | The position of the nearest point N on G's surface from the query point Q, expressed in G's frame. |
distance_in | 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_in | The gradient vector of the distance function with respect to the query point Q, expressed in world frame W. |
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.
|
default |
|
default |
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.
Vector3<T> grad_W |
The gradient vector of the distance function with respect to the query point Q, expressed in world frame W.
GeometryId id_G |
The id of the geometry G to which we measure distance from the query point Q.
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.