Simox  2.3.74.0
Saba::Rrt Class Reference

A simple sampling based, single rrt planner using the extend or connect method. More...

Inheritance diagram for Saba::Rrt:
Saba::MotionPlanner Saba::BiRrt Saba::GraspRrt Saba::GraspIkRrt

Public Types

enum  RrtMethod { eExtend, eConnect, eConnectCompletePath }
 
enum  ExtensionResult { eError, eFailed, eSuccess, ePartial }
 

Public Member Functions

 Rrt (CSpacePtr cspace, RrtMethod mode=eConnect, float probabilityExtendToGoal=0.1f, float samplingSize=-1)
 
 ~Rrt () override
 
bool plan (bool bQuiet=false) override
 
void printConfig (bool printOnlyParams=false) override
 
void reset () override
 reset the planner More...
 
bool setStart (const Eigen::VectorXf &c) override
 set start configuration More...
 
bool setGoal (const Eigen::VectorXf &c) override
 set goal configuration More...
 
void setProbabilityExtendToGoal (float p)
 
CSpaceTreePtr getTree ()
 
- Public Member Functions inherited from Saba::MotionPlanner
EIGEN_MAKE_ALIGNED_OPERATOR_NEW MotionPlanner (CSpacePtr cspace)
 
virtual ~MotionPlanner ()
 destructor More...
 
CSpacePathPtr getSolution ()
 
void setMaxCycles (unsigned int mc)
 
Eigen::VectorXf getStartConfig ()
 return start configuration More...
 
Eigen::VectorXf getGoalConfig ()
 return goal configuration More...
 
unsigned int getNrOfCycles ()
 check that planner is initialized More...
 
CSpacePtr getCSpace ()
 The CSpace. More...
 
virtual void stopExecution ()
 
void setName (std::string sName)
 Give the planner a name. More...
 
std::string getName ()
 The name of the planner. More...
 
float getPlanningTimeMS ()
 
virtual bool isInitialized ()
 returns true, when start and goal config have been set More...
 
void setPlanningTimeout (float timeoutMs)
 

Protected Member Functions

bool createSolution (bool bQuiet=false) override
 create the solution More...
 
virtual ExtensionResult extend (Eigen::VectorXf &c, CSpaceTreePtr tree, int &storeLastAddedID)
 
virtual ExtensionResult connectComplete (Eigen::VectorXf &c, CSpaceTreePtr tree, int &storeLastAddedID)
 
virtual ExtensionResult connectUntilCollision (Eigen::VectorXf &c, CSpaceTreePtr tree, int &storeLastAddedID)
 

Protected Attributes

CSpaceTreePtr tree
 the rrt on which are operating More...
 
CSpaceNodePtr startNode
 start node (root of RRT) More...
 
CSpaceNodePtr goalNode
 goal node (set when RRT weas successfully connected to goalConfig) More...
 
Eigen::VectorXf tmpConfig
 tmp config More...
 
float extendGoToGoal
 the probability that the goal config is used instead of a randomly created configuration More...
 
float extendStepSize
 step size for one rrt extend (copied from cspace) More...
 
int lastAddedID
 ID of last added node. More...
 
RrtMethod rrtMode
 
- Protected Attributes inherited from Saba::MotionPlanner
CSpacePtr cspace
 the cspace on which are operating More...
 
CSpacePathPtr solution
 the solution More...
 
bool stopSearch
 indicates that the search should be interrupted More...
 
unsigned int dimension
 dimension of c-space More...
 
Eigen::VectorXf startConfig
 start config More...
 
bool startValid
 
Eigen::VectorXf goalConfig
 goal config More...
 
bool goalValid
 
unsigned int maxCycles
 maximum cycles for searching More...
 
unsigned int cycles
 current cycles done in the run method More...
 
std::string name
 Name of this planner (standard: "Motion Planner") More...
 
float planningTime
 
float planningTimeout
 Planning time in milliseconds. More...
 

Detailed Description

A simple sampling based, single rrt planner using the extend or connect method.

Rrt-related algorithms are known to allow efficient motion planning in high dimensional configuration spaces. Complex setups can be specified via the used c-space classes. The number of degrees of freedom (DoF/dimension) is defined via the c-space. Also the collision detection is handled by the c-space classes.

See also
CSpaceSampled
CSpacePath
CSpaceTree

Member Enumeration Documentation

◆ ExtensionResult

Enumerator
eError 
eFailed 
eSuccess 
ePartial 

◆ RrtMethod

Enumerator
eExtend 
eConnect 
eConnectCompletePath 

Constructor & Destructor Documentation

◆ Rrt()

Saba::Rrt::Rrt ( CSpacePtr  cspace,
RrtMethod  mode = eConnect,
float  probabilityExtendToGoal = 0.1f,
float  samplingSize = -1 
)

Constructor

Parameters
cspaceA cspace, defining the used joints (the dimension/DoF) and the collision detection setup.
modeSpecify the RRT method that should be used
probabilityExtendToGoalSpecify how often the goal node should be used instead of a random config (value must be between 0 and 1)

◆ ~Rrt()

Saba::Rrt::~Rrt ( )
overridedefault

Member Function Documentation

◆ connectComplete()

Rrt::ExtensionResult Saba::Rrt::connectComplete ( Eigen::VectorXf &  c,
CSpaceTreePtr  tree,
int &  storeLastAddedID 
)
protectedvirtual

Reimplemented in Saba::GraspRrt.

◆ connectUntilCollision()

Rrt::ExtensionResult Saba::Rrt::connectUntilCollision ( Eigen::VectorXf &  c,
CSpaceTreePtr  tree,
int &  storeLastAddedID 
)
protectedvirtual

◆ createSolution()

bool Saba::Rrt::createSolution ( bool  bQuiet = false)
overrideprotectedvirtual

create the solution

Implements Saba::MotionPlanner.

◆ extend()

Rrt::ExtensionResult Saba::Rrt::extend ( Eigen::VectorXf &  c,
CSpaceTreePtr  tree,
int &  storeLastAddedID 
)
protectedvirtual

◆ getTree()

Saba::CSpaceTreePtr Saba::Rrt::getTree ( )

◆ plan()

bool Saba::Rrt::plan ( bool  bQuiet = false)
overridevirtual

Do the planning (blocking method). On success the Rrt can be accessed with the getTree() method and the found solution with getSolution().

Parameters
bQuietPrint some info or not.
Returns
true if solution was found, otherwise false

Implements Saba::MotionPlanner.

◆ printConfig()

void Saba::Rrt::printConfig ( bool  printOnlyParams = false)
overridevirtual

Print setup of planner.

Parameters
printOnlyParamsIf set the decorating start and end is skipped (can be used to print derived classes).

Reimplemented from Saba::MotionPlanner.

◆ reset()

void Saba::Rrt::reset ( )
overridevirtual

reset the planner

Reimplemented from Saba::MotionPlanner.

◆ setGoal()

bool Saba::Rrt::setGoal ( const Eigen::VectorXf &  c)
overridevirtual

set goal configuration

Reimplemented from Saba::MotionPlanner.

◆ setProbabilityExtendToGoal()

void Saba::Rrt::setProbabilityExtendToGoal ( float  p)

◆ setStart()

bool Saba::Rrt::setStart ( const Eigen::VectorXf &  c)
overridevirtual

set start configuration

Reimplemented from Saba::MotionPlanner.

Field Documentation

◆ extendGoToGoal

float Saba::Rrt::extendGoToGoal
protected

the probability that the goal config is used instead of a randomly created configuration

◆ extendStepSize

float Saba::Rrt::extendStepSize
protected

step size for one rrt extend (copied from cspace)

◆ goalNode

CSpaceNodePtr Saba::Rrt::goalNode
protected

goal node (set when RRT weas successfully connected to goalConfig)

◆ lastAddedID

int Saba::Rrt::lastAddedID
protected

ID of last added node.

◆ rrtMode

RrtMethod Saba::Rrt::rrtMode
protected

◆ startNode

CSpaceNodePtr Saba::Rrt::startNode
protected

start node (root of RRT)

◆ tmpConfig

Eigen::VectorXf Saba::Rrt::tmpConfig
protected

tmp config

◆ tree

CSpaceTreePtr Saba::Rrt::tree
protected

the rrt on which are operating