Loading...
Searching...
No Matches
HySST.cpp
36/* Adapted from: ompl/geometric/planners/src/SST.cpp by Zakary Littlefield of Rutgers the State University of New
52ompl::control::HySST::HySST(const control::SpaceInformationPtr &si_) : base::Planner(si_, "HySST")
58 addPlannerProgressProperty("best cost REAL", [this] { return std::to_string(this->prevSolutionCost_.value()); });
144ompl::control::HySST::Motion *ompl::control::HySST::selectNode(ompl::control::HySST::Motion *sample)
177ompl::control::HySST::Witness *ompl::control::HySST::findClosestWitness(ompl::control::HySST::Motion *node)
185 witnesses_->size() == 0) // If the closest witness is outside the pruning radius or if there are no witnesses
204 double tFlow = 0; // Tracking variable for the amount of flow time used in a given continuous simulation step
210 bool priority = in_jump && in_flow ? random / RAND_MAX > 0.5 : in_jump; // If both are true, there is an equal
233 intermediateState, ompl::base::HybridStateSpace::getStateTime(previousState) + flowStepDuration_);
323ompl::base::PlannerStatus ompl::control::HySST::solve(const base::PlannerTerminationCondition &ptc)
380 base::Cost cost = base::Cost(nmotion->accCost_.value() + incCost.value()); // Combine total cost
386 collisionParentMotion->accCost_ = base::Cost(nmotion->accCost_.value() + costFunc_(dMotion[1]).value());
393 cost.value() < closestWitness->rep_->accCost_.value()) // If the newly propagated state is a child of the
416 if (solved && motion->accCost_.value() < prevSolutionCost_.value()) // If the new state is a solution and
438 if (solution == nullptr && dist_ < approxdif) // If no solution found and distance to goal of this new
459 while (oldRep->inactive_ && oldRep->numChildren_ == 0) // While the current node is inactive and is a
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition Cost.h:48
static void setStateTime(ompl::base::State *state, double position)
Set the time position value of the given state.
Definition HybridStateSpace.cpp:108
static double getStateTime(const ompl::base::State *state)
The time value of the given state.
Definition HybridStateSpace.cpp:98
static void setStateJumps(ompl::base::State *state, int jumps)
Set the jumps value of the given state.
Definition HybridStateSpace.cpp:113
static int getStateJumps(const ompl::base::State *state)
The jumps value of the given state.
Definition HybridStateSpace.cpp:103
Objective for attempting to maximize the minimum clearance along a path.
Definition MaximizeMinClearanceObjective.h:48
The cost of a path is defined as the worst state cost over the entire path. This objective attempts t...
Definition MinimaxObjective.h:50
Base class for a vertex in the PlannerData structure. All derived classes must implement the clone an...
Definition PlannerData.h:59
Object containing planner generated vertex and edge data. It is assumed that all vertices are unique,...
Definition PlannerData.h:175
unsigned int addStartVertex(const PlannerDataVertex &v)
Adds the given vertex to the graph data, and marks it as a start vertex. The vertex index is returned...
Definition PlannerData.cpp:405
unsigned int addGoalVertex(const PlannerDataVertex &v)
Adds the given vertex to the graph data, and marks it as a start vertex. The vertex index is returned...
Definition PlannerData.cpp:414
virtual bool addEdge(unsigned int v1, unsigned int v2, const PlannerDataEdge &edge=PlannerDataEdge(), Cost weight=Cost(1.0))
Adds a directed edge between the given vertex indexes. An optional edge structure and weight can be s...
Definition PlannerData.cpp:424
Encapsulate a termination condition for a motion planner. Planners will call operator() to decide whe...
Definition PlannerTerminationCondition.h:64
void addPlannerProgressProperty(const std::string &progressPropertyName, const PlannerProgressProperty &prop)
Add a planner progress property called progressPropertyName with a property querying function prop to...
Definition Planner.h:394
virtual void checkValidity()
Check to see if the planner is in a working state (setup has been called, a goal was set,...
Definition Planner.cpp:106
virtual void setup()
Perform extra configuration steps, if needed. This call will also issue a call to ompl::base::SpaceIn...
Definition Planner.cpp:92
std::vector< base::State * > * solutionPair
The integration steps defining the edge of the motion, between the parent and child vertices.
Definition HySST.h:121
Representation of a witness vertex in the search tree.
Definition HySST.h:372
int batchSize_
The number of solutions allowed until the most optimal solution is returned.
Definition HySST.h:587
double flowStepDuration_
The flow time for a given integration step, within a flow propagation step. Must be set by user.
Definition HySST.h:483
std::shared_ptr< NearestNeighbors< Motion * > > nn_
A nearest-neighbors datastructure containing the tree of motions.
Definition HySST.h:426
control::SpaceInformation * siC_
The base::SpaceInformation cast as control::SpaceInformation, for convenience.
Definition HySST.h:465
std::function< base::State *(base::State *curState, const control::Control *u, base::State *newState)> discreteSimulator_
Simulator for propagation under jump regime.
Definition HySST.h:493
std::function< ompl::base::State *(const control::Control *control, ompl::base::State *x_cur, double tFlow, ompl::base::State *new_state)> continuousSimulator
Simulates the dynamics of the system.
Definition HySST.h:308
std::function< bool(Motion *motion, std::function< bool(Motion *motion)> obstacleSet, base::State *newState, double *collisionTime)> collisionChecker_
Collision checker. Default is point-by-point collision checking using the jump set.
Definition HySST.h:447
Motion * selectNode(Motion *sample)
Finds the best node in the tree withing the selection radius around a random sample.
Definition HySST.cpp:144
double pruningRadius_
The radius for determining the size of the pruning region. Delta_bn.
Definition HySST.h:572
void checkMandatoryParametersSet(void) const
Check if all required parameters have been set.
Definition HySST.h:339
std::function< double(base::State *state1, base::State *state2)> distanceFunc_
Compute distance between states, default is Euclidean distance.
Definition HySST.h:473
base::OptimizationObjectivePtr opt_
The optimization objective. Default is a shortest path objective.
Definition HySST.h:517
std::function< base::State *(const control::Control *u, base::State *curState, double tFlowMax, base::State *newState)> continuousSimulator_
Simulator for propagation under flow regime.
Definition HySST.h:532
std::shared_ptr< NearestNeighbors< Motion * > > witnesses_
A nearest-neighbors datastructure containing the tree of witness motions.
Definition HySST.h:566
double tM_
The maximum flow time for a given flow propagation step. Must be set by the user.
Definition HySST.h:477
void setContinuousSimulator(std::function< base::State *(const control::Control *u, base::State *curState, double tFlowMax, base::State *newState)> function)
Define the continuous dynamics simulator.
Definition HySST.h:298
std::function< bool(Motion *motion)> flowSet_
Function that returns true if a motion intersects with the flow set, and false if not.
Definition HySST.h:507
void getPlannerData(base::PlannerData &data) const override
Get the PlannerData object associated with this planner.
Definition HySST.cpp:562
std::function< base::Cost(Motion *motion)> costFunc_
Calculate the cost of a motion. Default is using optimization objective.
Definition HySST.h:520
Witness * findClosestWitness(Motion *node)
Find the closest witness node to a newly generated potential node.
Definition HySST.cpp:177
std::function< bool(Motion *motion)> unsafeSet_
Function that returns true if a motion intersects with the unsafe set, and false if not.
Definition HySST.h:514
std::function< bool(Motion *motion)> jumpSet_
Function that returns true if a motion intersects with the jump set, and false if not.
Definition HySST.h:500
double dist_
Minimum distance from goal to final vertex of generated trajectories.
Definition HySST.h:578
base::PlannerStatus solve(const base::PlannerTerminationCondition &ptc) override
Main solve function.
Definition HySST.cpp:323
std::vector< Motion * > prevSolution_
The best solution (with best cost) we have found so far.
Definition HySST.h:581
double selectionRadius_
The radius for determining the node selected for extension. Delta_s.
Definition HySST.h:569
base::PlannerStatus constructSolution(Motion *lastMotion)
Construct the path, starting at the last edge.
Definition HySST.cpp:495
static NearestNeighbors< _T > * getDefaultNearestNeighbors(const base::Planner *planner)
Select a default nearest neighbor datastructure for the given space.
Definition SelfConfig.h:105
This namespace contains sampling based planning routines shared by both planning under geometric cons...
Definition ConstrainedSpaceInformation.h:55
This namespace contains sampling based planning routines used by planning under differential constrai...
Definition Control.h:45
Includes various tools such as self config, benchmarking, etc.
Definition LightningRetrieveRepair.h:48
A class to store the exit status of Planner::solve().
Definition PlannerStatus.h:49