Parasol Planning Library (PPL)
LocalPlanner_UseCase.cpp

This is an example of how to use the local planner methods.

void LocalPlannerUseCase() {
// Get the local planner method by the XML node label.
std::string lpLabel = "StraightLine";
LocalPlannerMethod* localPlanner = this->GetLocalPlanner(lpLabel);
// The environment defines properties of the planning problem workspace. This
// is nessecary within the context of the LocalPlanner as to provide the
// positional and orientational resolutions on a configuration's degrees of
// freedom.
Environment* env = this->GetEnvironment();
// c1 and c2 are the configurations that will be queried for a connecting path
// in both main functions. col is the witness configuration if a path cannot
// be determined by the function IsConnected(failure).
CfgType c1, c2, col;
// lpOut is an abstraction that will be populated with various information
// regarding the attempted path upon being called by IsConnected.
// Functions as a secondary output.
// IsConnected is the main function of LocalPlanner, and takes in all of the
// above information in attempting to solve for a path between the two
// provided configurations. Returns true if a path is found, false otherwise;
// additional information is stored within the provided LPOutput..
localPlanner->IsConnected(c1, c2, col, &lpOut, env->GetPositionRes(),
// BlindPath is a secondary main function of LocalPlanner, taking in the above
// information to build and return a path from one configuration to another.
// It does not use collision checking, and as such is best utilized for
// recomputing and working with pre-validated paths and path waypoints.
// Returns a vector of intermediate configurations connecting the given
// endpoints (excluding endpoints).
localPlanner->BlindPath({c1, c2}, env->GetPositionRes(),
}
Definition: Environment.h:137
double GetOrientationRes() const noexcept
Get the orientation resolution.
Definition: Environment.cpp:600
double GetPositionRes() const noexcept
Get the position resolution.
Definition: Environment.cpp:586
Definition: LocalPlannerMethod.h:32
virtual bool IsConnected(const Cfg &_start, const Cfg &_end, Cfg &_col, LPOutput *_lpOutput, double _posRes, double _oriRes, bool _checkCollision=true, bool _savePath=false)=0
std::vector< Cfg > BlindPath(const std::vector< Cfg > &_waypoints, const double _posRes, const double _oriRes)
Definition: LocalPlannerMethod.cpp:69
Definition: LPOutput.h:24