KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
PiggybackCSpace Class Reference

A helper class that assists with selective overriding of another cspace's methods (similar to "monkey-patching"). More...

#include <CSpaceHelpers.h>

Inheritance diagram for PiggybackCSpace:
CSpace AdaptiveCSpace KinodynamicSteeringCSpaceAdaptor SubsetConstraintCSpace

Public Member Functions

 PiggybackCSpace (CSpace *_baseSpace=NULL)
 
virtual int NumDimensions ()
 
virtual std::string VariableName (int i)
 
virtual int NumConstraints ()
 
virtual std::string ConstraintName (int i)
 
virtual std::shared_ptr< CSetConstraint (int i)
 
virtual void Sample (Config &x)
 
virtual void SampleNeighborhood (const Config &c, Real r, Config &x)
 
virtual EdgePlannerPtr LocalPlanner (const Config &a, const Config &b)
 
virtual EdgePlannerPtr PathChecker (const Config &a, const Config &b)
 
virtual EdgePlannerPtr PathChecker (const Config &a, const Config &b, int obstacle)
 
virtual bool IsFeasible (const Config &x)
 
virtual bool IsFeasible (const Config &, int constraint)
 
virtual bool ProjectFeasible (Config &x)
 
virtual Optimization::NonlinearProgramFeasibleNumeric ()
 If possible, give the feasible set as a nonlinear program.
 
virtual Real Distance (const Config &x, const Config &y)
 optionally overrideable (default uses euclidean space)
 
virtual void Interpolate (const Config &x, const Config &y, Real u, Config &out)
 
virtual void Midpoint (const Config &x, const Config &y, Config &out)
 
virtual void Properties (PropertyMap &map)
 Returns properties of the space that might be useful for planners. More...
 
- Public Member Functions inherited from CSpace
void AddConstraint (const std::string &name, CSet *constraint)
 
void AddConstraint (const std::string &name, const std::shared_ptr< CSet > &constraint)
 
void AddConstraint (const std::string &name, CSet::CPredicate test)
 
void CopyConstraints (const CSpace *space, const std::string &prefix="")
 
virtual Real ObstacleDistance (const Config &a)
 for local planners using obstacle distance
 
virtual void CheckConstraints (const Config &, std::vector< bool > &satisfied)
 Returns a vector indicating which constraints are satisfied.
 
void GetFeasibleNames (const Config &q, std::vector< std::string > &names)
 Gets a list of feasible obstacles for the given configuration.
 
void GetInfeasibleNames (const Config &q, std::vector< std::string > &names)
 Gets a list of infeasible obstacles for the given configuration.
 
void PrintInfeasibleNames (const Config &q, std::ostream &out=std::cout, const char *prefix="", const char *suffix="\n")
 Prints out the list of infeasible obstacles for the given configuration.
 

Public Attributes

CSpacebaseSpace
 
- Public Attributes inherited from CSpace
std::vector< std::string > constraintNames
 
std::vector< std::shared_ptr< CSet > > constraints
 

Detailed Description

A helper class that assists with selective overriding of another cspace's methods (similar to "monkey-patching").

All CSpace methods are copied except those that are overridden by the subclass of PiggybackCSpace.

Warning: unexpected behavior may be observed when using the baseSpace's local planners, because they often contain pointers to the CSpace that created them, not the piggybacking CSpace.

Member Function Documentation

bool PiggybackCSpace::ProjectFeasible ( Config x)
virtual

If possible, project x onto a nearby feasible configuration and return true. If not, return false.

Reimplemented from CSpace.

Reimplemented in SubsetConstraintCSpace.

void PiggybackCSpace::Properties ( PropertyMap map)
virtual

Returns properties of the space that might be useful for planners.

Typical properties may include

  • name (string): an identifier for the space
  • cartesian (0 or 1): whether its a euclidean space
  • submanifold (0 or 1): whether its a submanifold space
  • canproject (0 or 1): whether ProjectFeasible is implemented
  • hasobstacledistance (0 or 1): whether ObstacleDistance is implemented
  • volume (real): volume of the space
  • diameter (real): maximum distance between any two points in the space
  • minimum (real array): minimum element of the space
  • maximum (real array): maximum element of the space
  • intrinsicDimension (real): for submanifolds, intrinsic dimension of space
  • geodesic (0 or 1): whether interpolation is along geodesics
  • metric (string): the type of metric ("euclidean", "weighted euclidean", "mahalanobis", "manhattan", "weighted manhattan", "Linf", "weighted Linf")
  • metricWeights (real array): the metric weight vector Empty values indicate that the property is unknown.

Default implementation returns the properties of a Euclidean space.

Reimplemented from CSpace.

Reimplemented in KinodynamicSteeringCSpaceAdaptor.

References CSpace::Properties(), and Math::Rand().

Referenced by KinodynamicSteeringCSpaceAdaptor::Properties().


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