GuidedPlanner Class Reference

A planner that will fire off child threads to investigate promising states in more detail. More...

#include <guidedPlanner.h>

Inheritance diagram for GuidedPlanner:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual PlannerType getType ()
 The type of this planner, for easier run-time check.
 GuidedPlanner (Hand *h)
void pausePlanner ()
 Not properly implemented yet as this also stops children for good (instead of pausing them).
bool resetPlanner ()
 Also clears the list of states to be avoided.
void setMaxChildren (int c)
void startPlanner ()
 Also hides the friction cones on the object.
void stopPlanner ()
 Also stops all children, for good (stops their threads).
 ~GuidedPlanner ()

Public Attributes

int mBestListSize
 Number of child results that are saved.
SearchEnergyType mChildEnergyType
 Energy computation type used by children.
int mChildSeedSize
 Max size of child seeds list.
float mDistanceThreshold
 Min distance separating child seeds.
int mMaxChildSteps
 Max iterations done by a child.
float mMinChildEnergy
 Min energy for a state to be deemed good enough to be used to seed a child.

Protected Member Functions

void checkChildren ()
 Checks if any of the currently active children have finished their execution.
void mainLoop ()
 Stores states to be used as "seeds" for children, and fires new children when appropriate.
void startChild (const GraspPlanningState *s)
 Fires of a child planner that will be seeded with the given state.
void stopChild (SimAnnPlanner *pl)
 Stops a child planner, gets its solutions and stops its thread.

Protected Attributes

std::list< GraspPlanningState * > mAvoidList
 A list of states that should be avoided by the search.
bool mChildClones
 Whether the children use clones of the current hand.
std::vector< SimAnnPlanner * > mChildPlanners
 The list of currently active child planners.
std::list< GraspPlanningState * > mChildSeeds
 A list of seeds that haven't been used yet.
bool mChildThreads
 Whether the children run in their own threads.
int mMaxChildren
 The max number of children that canbe used. Usually correlated with the number of cores available.

Detailed Description

A planner that will fire off child threads to investigate promising states in more detail.

The GuidedPlanner is a more complicated version of the SimAnn planner. It will run just like the SimAnn planner, but whenever it finds "good" states it will fire of children that run in separate threads to investigate the "good" states in more detail. The children will use a different type of EnergyCalculator which actually closes the hand and computes exact grasp quality for each state. If the time of planning is not an issue (2 mins or more) this is the best planner to guarantee finding exact force-closure grasps. Might be unstable due to multi-threaded operation.

States that have been sent to a child planner are remembered and avoided - no point in exploring them anymore since a child planner is exploring each of them in great detail.

Whenever a child thread finishes, the main planner will take its best solution and store it in its own solution list. Therefore, the list of solutions of the main planner (mBestList) is actually a list on solutions, one from each child that has finished.

In general, planners operating in eigengrasp space will always find "pre-grasps" that must usually be transformed into actual grasps by closing the fingers, or doing some slightly modified version of autoGrasp. The exact transformation from pre-grasp to final grasp is simple, but usually hidden inside the SearchEnergy class which analyzes pre-grasps. That class is kind of hard to understand, as it is old code in bad need of a shake-up.

Starting in version 2.1.0, the main GuidedPlanner also stores the final grasp for any of its solutions. Therefore, for each solution, the best list of this planner will contain the pre-grasp followed by the final grasp. This wsa done in an attempt to make this planner usable "off the shelf" without having to worry about recomputing exact final grasps after its done. See the stopChild(...) function for details about how the solutions recovered from children threads are saved.

Definition at line 77 of file guidedPlanner.h.


Constructor & Destructor Documentation

GuidedPlanner::GuidedPlanner ( Hand h  ) 

Definition at line 36 of file guidedPlanner.cpp.

GuidedPlanner::~GuidedPlanner (  ) 

Definition at line 60 of file guidedPlanner.cpp.


Member Function Documentation

void GuidedPlanner::checkChildren (  )  [protected]

Checks if any of the currently active children have finished their execution.

Deletes any children that are done. If there are seeds available and emtpty children slots it also fires of new children. If a new child is fired and the main planner is still in the area, the main planner is also reset so it goes plan somewhere else.

Definition at line 265 of file guidedPlanner.cpp.

virtual PlannerType GuidedPlanner::getType (  )  [inline, virtual]

The type of this planner, for easier run-time check.

Reimplemented from SimAnnPlanner.

Definition at line 128 of file guidedPlanner.h.

void GuidedPlanner::mainLoop (  )  [protected, virtual]

Stores states to be used as "seeds" for children, and fires new children when appropriate.

Does the usual main loop of a SimAnn planner, but checks if the current state is good enough to be placed in the list of seeds to be used for children. The list of seeds is also pruned to remove similar state, and only keep a list of "unique" seeds.

Reimplemented from SimAnnPlanner.

Definition at line 216 of file guidedPlanner.cpp.

void GuidedPlanner::pausePlanner (  )  [virtual]

Not properly implemented yet as this also stops children for good (instead of pausing them).

Reimplemented from EGPlanner.

Definition at line 97 of file guidedPlanner.cpp.

bool GuidedPlanner::resetPlanner (  )  [virtual]

Also clears the list of states to be avoided.

Reimplemented from EGPlanner.

Definition at line 109 of file guidedPlanner.cpp.

void GuidedPlanner::setMaxChildren ( int  c  )  [inline]

Definition at line 138 of file guidedPlanner.h.

void GuidedPlanner::startChild ( const GraspPlanningState seed  )  [protected]

Fires of a child planner that will be seeded with the given state.

Starts a child and gives it as an "input" state the seed. The child will then be biased to spend more time in the vicinity of this state. The exact confidence levels in the seed state are hard-coded in.

Also hard-coded are the annealing parameters that the child uses (ANNEALING_STRICT) and other parameters for the child. The seed state is also marked visually to give some visual feedback, since the child planners typically use cloned hands which are hidden.

Definition at line 128 of file guidedPlanner.cpp.

void GuidedPlanner::startPlanner (  )  [virtual]

Also hides the friction cones on the object.

Since child planner will actually compute actual contacts with the object, we disable rendering of friction cones, as rendering requests from different threads can cause problems.

Reimplemented from EGPlanner.

Definition at line 77 of file guidedPlanner.cpp.

void GuidedPlanner::stopChild ( SimAnnPlanner pl  )  [protected]

Stops a child planner, gets its solutions and stops its thread.

Stops a child, and waits for the child thread to finish. After that, it retrieves the solutions found by the child, and places them in the list of solutions and also in the list of states to be avoided in the future. Solutions are also marked visually.

Note that, for each solution recovered from a child, this function also reconstructs the final grasp (remember that solutions are usually pre-grasps) and saves BOTH in the list of solutions.

Definition at line 170 of file guidedPlanner.cpp.

void GuidedPlanner::stopPlanner (  )  [virtual]

Also stops all children, for good (stops their threads).

After the children have been stopped, it also deletes them. Any current solutions of the children are lost.

Reimplemented from EGPlanner.

Definition at line 87 of file guidedPlanner.cpp.


Member Data Documentation

A list of states that should be avoided by the search.

They are avoded because they have either been used by a child or are scheduled to be used by one. Essentially, it is the union of mChildSeeds and mBestList.

Definition at line 94 of file guidedPlanner.h.

Number of child results that are saved.

Definition at line 114 of file guidedPlanner.h.

bool GuidedPlanner::mChildClones [protected]

Whether the children use clones of the current hand.

True by default, should be set to false only for debugging purposes.

Definition at line 98 of file guidedPlanner.h.

Energy computation type used by children.

Definition at line 122 of file guidedPlanner.h.

std::vector<SimAnnPlanner*> GuidedPlanner::mChildPlanners [protected]

The list of currently active child planners.

Definition at line 84 of file guidedPlanner.h.

A list of seeds that haven't been used yet.

Definition at line 87 of file guidedPlanner.h.

Max size of child seeds list.

Definition at line 116 of file guidedPlanner.h.

bool GuidedPlanner::mChildThreads [protected]

Whether the children run in their own threads.

True by default, should be set to false only for debugging purposes.

Definition at line 101 of file guidedPlanner.h.

Min distance separating child seeds.

Definition at line 118 of file guidedPlanner.h.

int GuidedPlanner::mMaxChildren [protected]

The max number of children that canbe used. Usually correlated with the number of cores available.

Definition at line 82 of file guidedPlanner.h.

Max iterations done by a child.

Definition at line 124 of file guidedPlanner.h.

Min energy for a state to be deemed good enough to be used to seed a child.

Definition at line 120 of file guidedPlanner.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


graspit
Author(s):
autogenerated on Wed Jan 25 11:00:22 2012