KrisLibrary
1.0.0
|
A helper class that assists with selective overriding of another cspace's methods (similar to "monkey-patching"). More...
#include <CSpaceHelpers.h>
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< CSet > | Constraint (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::NonlinearProgram * | FeasibleNumeric () |
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 | |
CSpace * | baseSpace |
Public Attributes inherited from CSpace | |
std::vector< std::string > | constraintNames |
std::vector< std::shared_ptr< CSet > > | constraints |
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.
|
virtual |
If possible, project x onto a nearby feasible configuration and return true. If not, return false.
Reimplemented from CSpace.
Reimplemented in SubsetConstraintCSpace.
|
virtual |
Returns properties of the space that might be useful for planners.
Typical properties may include
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().