Drake
Drake C++ Documentation

Detailed Description

A convex set that contains exactly one element.

Also known as a singleton or unit set.

This set is always nonempty, even in the zero-dimensional case.

#include <drake/geometry/optimization/point.h>

Public Member Functions

 Point ()
 Constructs a default (zero-dimensional, nonempty) set. More...
 
 Point (const Eigen::Ref< const Eigen::VectorXd > &x)
 Constructs a Point. More...
 
 Point (const QueryObject< double > &query_object, GeometryId geometry_id, std::optional< FrameId > reference_frame=std::nullopt, double maximum_allowable_radius=0.0)
 Constructs a Point from a SceneGraph geometry and pose in the reference_frame frame, obtained via the QueryObject. More...
 
 ~Point () final
 
const Eigen::VectorXd & x () const
 Retrieves the point. More...
 
void set_x (const Eigen::Ref< const Eigen::VectorXd > &x)
 Changes the element x describing the set. More...
 
bool PointInSet (const Eigen::Ref< const Eigen::VectorXd > &x, double tol=0) const
 Returns true if the point is within tol of x(), under the L∞-norm. More...
 
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable
 Point (const Point &)=default
 
Pointoperator= (const Point &)=default
 
 Point (Point &&)=default
 
Pointoperator= (Point &&)=default
 
- Public Member Functions inherited from ConvexSet
virtual ~ConvexSet ()
 
std::unique_ptr< ConvexSetClone () const
 Creates a unique deep copy of this set. More...
 
int ambient_dimension () const
 Returns the dimension of the vector space in which the elements of this set are evaluated. More...
 
bool IntersectsWith (const ConvexSet &other) const
 Returns true iff the intersection between this and other is non-empty. More...
 
bool IsBounded () const
 Returns true iff the set is bounded, e.g., there exists an element-wise finite lower and upper bound for the set. More...
 
bool IsEmpty () const
 Returns true iff the set is empty. More...
 
std::optional< Eigen::VectorXd > MaybeGetPoint () const
 If this set trivially contains exactly one point, returns the value of that point. More...
 
std::optional< Eigen::VectorXd > MaybeGetFeasiblePoint () const
 Returns a feasible point within this convex set if it is nonempty, and nullopt otherwise. More...
 
bool PointInSet (const Eigen::Ref< const Eigen::VectorXd > &x, double tol=0) const
 Returns true iff the point x is contained in the set. More...
 
std::pair< VectorX< symbolic::Variable >, std::vector< solvers::Binding< solvers::Constraint > > > AddPointInSetConstraints (solvers::MathematicalProgram *prog, const Eigen::Ref< const solvers::VectorXDecisionVariable > &vars) const
 Adds a constraint to an existing MathematicalProgram enforcing that the point defined by vars is inside the set. More...
 
std::vector< solvers::Binding< solvers::Constraint > > AddPointInNonnegativeScalingConstraints (solvers::MathematicalProgram *prog, const Eigen::Ref< const solvers::VectorXDecisionVariable > &x, const symbolic::Variable &t) const
 Let S be this convex set. More...
 
std::vector< solvers::Binding< solvers::Constraint > > AddPointInNonnegativeScalingConstraints (solvers::MathematicalProgram *prog, const Eigen::Ref< const Eigen::MatrixXd > &A, const Eigen::Ref< const Eigen::VectorXd > &b, const Eigen::Ref< const Eigen::VectorXd > &c, double d, const Eigen::Ref< const solvers::VectorXDecisionVariable > &x, const Eigen::Ref< const solvers::VectorXDecisionVariable > &t) const
 Let S be this convex set. More...
 
std::pair< std::unique_ptr< Shape >, math::RigidTransformd > ToShapeWithPose () const
 Constructs a Shape and a pose of the set in the world frame for use in the SceneGraph geometry ecosystem. More...
 
double CalcVolume () const
 Computes the exact volume for the convex set. More...
 
SampledVolume CalcVolumeViaSampling (RandomGenerator *generator, const double desired_rel_accuracy=1e-2, const int max_num_samples=1e4) const
 Calculates an estimate of the volume of the convex set using sampling and performing Monte Carlo integration. More...
 
std::optional< std::pair< std::vector< double >, Eigen::MatrixXd > > Projection (const Eigen::Ref< const Eigen::MatrixXd > &points) const
 Computes in the L₂ norm the distance and the nearest point in this convex set to every column of points. More...
 
bool has_exact_volume () const
 Returns true if the exact volume can be computed for this convex set instance. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ConvexSet
 ConvexSet (int ambient_dimension, bool has_exact_volume)
 For use by derived classes to construct a ConvexSet. More...
 
template<typename Archive >
void Serialize (Archive *a)
 Implements non-virtual base class serialization. More...
 
virtual std::optional< Eigen::VectorXd > DoMaybeGetFeasiblePoint () const
 Non-virtual interface implementation for MaybeGetFeasiblePoint(). More...
 
virtual bool DoPointInSet (const Eigen::Ref< const Eigen::VectorXd > &x, double tol) const
 Non-virtual interface implementation for PointInSet(). More...
 
std::optional< symbolic::VariableHandleZeroAmbientDimensionConstraints (solvers::MathematicalProgram *prog, const ConvexSet &set, std::vector< solvers::Binding< solvers::Constraint >> *constraints) const
 Instances of subclasses such as CartesianProduct and MinkowskiSum can have constituent sets with zero ambient dimension, which much be handled in a special manner when calling methods such as DoAddPointInSetConstraints. More...
 
 ConvexSet (const ConvexSet &)=default
 
ConvexSetoperator= (const ConvexSet &)=default
 
 ConvexSet (ConvexSet &&)=default
 
ConvexSetoperator= (ConvexSet &&)=default
 

Constructor & Destructor Documentation

◆ Point() [1/5]

Point ( const Point )
default

◆ Point() [2/5]

Point ( Point &&  )
default

◆ Point() [3/5]

Point ( )

Constructs a default (zero-dimensional, nonempty) set.

◆ Point() [4/5]

Point ( const Eigen::Ref< const Eigen::VectorXd > &  x)
explicit

Constructs a Point.

◆ Point() [5/5]

Point ( const QueryObject< double > &  query_object,
GeometryId  geometry_id,
std::optional< FrameId reference_frame = std::nullopt,
double  maximum_allowable_radius = 0.0 
)

Constructs a Point from a SceneGraph geometry and pose in the reference_frame frame, obtained via the QueryObject.

If reference_frame frame is std::nullopt, then it will be expressed in the world frame.

Exceptions
std::exceptionif geometry_id does not correspond to a Sphere or if the Sphere has radius greater than maximum_allowable_radius.

◆ ~Point()

~Point ( )
final

Member Function Documentation

◆ operator=() [1/2]

Point& operator= ( const Point )
default

◆ operator=() [2/2]

Point& operator= ( Point &&  )
default

◆ PointInSet()

bool PointInSet

Returns true if the point is within tol of x(), under the L∞-norm.

◆ set_x()

void set_x ( const Eigen::Ref< const Eigen::VectorXd > &  x)

Changes the element x describing the set.

Precondition
x must be of size ambient_dimension().

◆ x()

const Eigen::VectorXd& x ( ) const

Retrieves the point.


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