RobWorkProject  24.5.15-
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PlaneMetric Class Reference

A metric for calculating plane-to-plane distance. More...

#include <Plane.hpp>

Inherits Metric< rw::geometry::Plane >.

Public Member Functions

 PlaneMetric (double angToDistWeight=1.0)
 Constructor. More...
 
- Public Member Functions inherited from Metric< rw::geometry::Plane >
virtual ~Metric ()
 Destructor.
 
scalar_type distance (const value_type &q) const
 The distance from the zero element to q.
 
scalar_type distance (const value_type &a, const value_type &b) const
 The distance from element a to b. More...
 
int size () const
 The dimension of elements on which this metric operates. More...
 

Protected Member Functions

double doDistance (const Plane &q) const
 Calculates distance from the plane to reference plane (X-Y surface)
 
double doDistance (const Plane &a, const Plane &b) const
 Calculates distance between two planes. More...
 
int doSize () const
 The dimension of elements on which this metric operates. More...
 
- Protected Member Functions inherited from Metric< rw::geometry::Plane >
 Metric ()
 Protected constructor called by subclassed.
 
 Metric (const Metric &)
 Disable copying of superclass.
 
Metricoperator= (const Metric &)
 Disable assignment of superclass.
 

Protected Attributes

double _angToDistWeight
 

Additional Inherited Members

- Public Types inherited from Metric< rw::geometry::Plane >
typedef rw::geometry::Plane value_type
 The type of element on which the metric operates.
 
typedef T::value_type scalar_type
 The type of the scalar.
 
typedef rw::core::Ptr< Metric< rw::geometry::Plane > > Ptr
 A pointer to a Metric<T>.
 
typedef rw::core::Ptr< const Metric< rw::geometry::Plane > > CPtr
 A pointer to a const Metric<T>.
 

Detailed Description

A metric for calculating plane-to-plane distance.

Constructor & Destructor Documentation

◆ PlaneMetric()

PlaneMetric ( double  angToDistWeight = 1.0)
inline

Constructor.

Parameters
angToDistWeight[in] weighting of angle compared to linear distance.

Member Function Documentation

◆ doDistance()

double doDistance ( const Plane a,
const Plane b 
) const
inlineprotectedvirtual

Calculates distance between two planes.

The distance is calculated according to formula:

val = 0.5*angle(p1.normal, p2.normal)*angToDistWeight + 0.5*fabs(p1.d-p2.d);

Angle is normalized, so that planes with opposite normals are treated as the same plane.

Implements Metric< rw::geometry::Plane >.

◆ doSize()

int doSize ( ) const
inlineprotectedvirtual

The dimension of elements on which this metric operates.

The returns -1 if the elements don't have a measure of dimension or if the metric works for elements of all dimensions.

Note
this function always return -1.

Reimplemented from Metric< rw::geometry::Plane >.

Member Data Documentation

◆ _angToDistWeight

double _angToDistWeight
protected
Parameters
weightingof angle compared to linear distance.

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