Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
Plane< T > Class Template Reference

Detailed Description

template<typename T>
class drake::geometry::Plane< T >

The definition of a plane in ℜ³, posed in an arbitrary frame.

The plane normal implicitly defines "above" and "below" directions relative to the plane. The "height" of a point relative to the plane can be queried.

It is defined with the implicit equation: P(x⃗ = n̂⋅x⃗- d = 0. A particular instance is measured and expressed in a particular frame, such that only points measured and expressed in that same frame can be meaningfully compared to the plane. E.g.,

const Vector3<T> nhat_F = ...;
const Vector3<T> p_FP = ...; // P is a point on the plane.
const Plane<T> plane_F(nhat_F, p_FP); // Plane in frame F.
const double distance_Q = plane_F.CalcHeight(p_FQ); // valid!
const double distance_R = plane_F.CalcHeight(p_GR); // invalid!
Plane(const Plane &)=default
Eigen::Matrix< Scalar, 3, 1 > Vector3
A column vector of size 3, templated on scalar type.
Definition eigen_types.h:48

#include <drake/geometry/proximity/plane.h>

Public Member Functions

 Plane (const Vector3< T > &normal, const Vector3< T > &point_on_plane, bool already_normalized=false)
 Constructs a Plane in frame F which is normal to normal and passes through the point point_on_plane.
template<typename U = T>
promoted_numerical_t< U, T > CalcHeight (const Vector3< U > &point) const
 Computes the height of Point Q relative to the plane.
const Vector3< T > & unit_normal () const
 Gets the plane's unit normal expressed in frame F.
const Vector3< T > reference_point () const
 Returns a point on the plane, measured and expressed in frame F.
bool BoxOverlaps (const Eigen::Vector3d &half_width, const Eigen::Vector3d &box_center_in_plane, const math::RotationMatrixd &box_orientation_in_plane) const
 Reports if the given box intersects this plane.
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 Plane (const Plane &)=default
Planeoperator= (const Plane &)=default
 Plane (Plane &&)=default
Planeoperator= (Plane &&)=default

Constructor & Destructor Documentation

◆ Plane() [1/3]

template<typename T>
Plane ( const Plane< T > & )
default

◆ Plane() [2/3]

template<typename T>
Plane ( Plane< T > && )
default

◆ Plane() [3/3]

template<typename T>
Plane ( const Vector3< T > & normal,
const Vector3< T > & point_on_plane,
bool already_normalized = false )

Constructs a Plane in frame F which is normal to normal and passes through the point point_on_plane.

Parameters
normalA (possibly unit-length) vector perpendicular to the plane expressed in Frame F (the in the implicit equation). By default, the vector will be normalized before being stored (see below), becoming the nhat_F documented above.
point_on_planeA point on the plane measured and expressed in Frame F, p_FP. The d in the implicit equation is derived from this quantity.
already_normalized(Advanced) If true, the normal will be treated as if it has already been normalized by the caller. It should still essentially have unit length. This function reserves the right to validate this property in debug build up to an arbitrary tolerance. When in doubt, allow the plane to normalize the normal vector.
Precondition
If already_normalized is false, normal must have magnitude ≥ 1e-10.

Member Function Documentation

◆ BoxOverlaps()

template<typename T>
bool BoxOverlaps ( const Eigen::Vector3d & half_width,
const Eigen::Vector3d & box_center_in_plane,
const math::RotationMatrixd & box_orientation_in_plane ) const

Reports if the given box intersects this plane.

The plane is specified in a frame P (the plane normal is not necessarily aligned with Pz). The box is specified in generic terms. It is an box whose axes are aligned to frame B, centered on Bo, and posed in the plane's frame P.

Parameters
half_widthThe half-width extents of the box along its local axes.
box_center_in_planeThe center of the box measured and expressed in the plane's frame: p_PBo.
box_orientation_in_planeThe orientation of the box expressed in the plane's frame. The ith column goes with the ith half width: R_PB.

◆ CalcHeight()

template<typename T>
template<typename U = T>
promoted_numerical_t< U, T > CalcHeight ( const Vector3< U > & point) const

Computes the height of Point Q relative to the plane.

A positive height indicates the point lies above the plane; negative height indicates below. The point must be measured and expressed in the same frame as the plane.

The return type depends on both the plane's scalar type T and the given query point's scalar type U. See promoted_numerical_t for details.

Parameters
pointThe quantity p_FQ (query point Q measured and expressed in the plane's frame F).

◆ operator=() [1/2]

template<typename T>
Plane & operator= ( const Plane< T > & )
default

◆ operator=() [2/2]

template<typename T>
Plane & operator= ( Plane< T > && )
default

◆ reference_point()

template<typename T>
const Vector3< T > reference_point ( ) const

Returns a point on the plane, measured and expressed in frame F.

This is not necessarily the same point used to construct the plane.

◆ unit_normal()

template<typename T>
const Vector3< T > & unit_normal ( ) const

Gets the plane's unit normal expressed in frame F.


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