Simox
2.3.74.0
|
Contains CSpaceTree which uses a CSpace for managing configurations. More...
Public Member Functions | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | CSpaceTree (CSpacePtr cspace) |
constructor More... | |
virtual | ~CSpaceTree () |
destructor More... | |
CSpaceNodePtr | getNode (unsigned int id) |
CSpaceNodePtr | getLastAddedNode () |
CSpacePtr | getCSpace () |
virtual unsigned int | getNrOfNodes () const |
get number of nodes More... | |
unsigned int | getDimension () const |
virtual bool | createPath (CSpaceNodePtr startNode, CSpaceNodePtr goalNode, CSpacePathPtr fillPath) |
virtual void | reset () |
set the number of nodes to zero More... | |
virtual bool | saveAllNodes (char const *filename) |
saves all nodes with ID, configuration and parentID to a file More... | |
void | setUpdateChildren (bool enable) |
bool | getUpdateChildren () |
virtual CSpaceNodePtr | appendNode (const Eigen::VectorXf &config, int parentID, bool calcDistance=false) |
creates new CSpaceNode with configuration config and parentID More... | |
virtual void | removeNode (CSpaceNodePtr n) |
remove tree node More... | |
virtual unsigned int | getNearestNeighborID (const Eigen::VectorXf &config, float *storeDist=NULL) |
virtual CSpaceNodePtr | getNearestNeighbor (const Eigen::VectorXf &config, float *storeDist=NULL) |
virtual bool | appendPath (CSpaceNodePtr startNode, const Eigen::VectorXf &config, int *storeLastAddedID=NULL) |
virtual bool | appendPath (CSpaceNodePtr startNode, CSpacePathPtr path, int *storeLastAddedID=NULL) |
virtual bool | appendPathUntilCollision (CSpaceNodePtr startNode, const Eigen::VectorXf &config, int *storeLastAddedID) |
virtual std::vector< CSpaceNodePtr > | getNodes () |
void | lock () |
void | unlock () |
float | getTreeLength (bool useMetricWeights=true) |
bool | hasNode (CSpaceNodePtr n) |
Protected Member Functions | |
virtual float | getPathDist (unsigned int idStart, unsigned int idEnd, bool useMetricWeights) |
get distance of path start to end More... | |
Protected Attributes | |
unsigned int | dimension |
shutdown tree, reset all data More... | |
CSpacePtr | cspace |
Eigen::VectorXf | tmpConfig |
std::vector< CSpaceNodePtr > | nodes |
bool | updateChildren |
vector with pointers to all used nodes More... | |
std::map< unsigned int, CSpaceNodePtr > | idNodeMapping |
std::mutex | mutex |
Contains CSpaceTree which uses a CSpace for managing configurations.
A connected tree in c-space which represents a RRT.
Saba::CSpaceTree::CSpaceTree | ( | CSpacePtr | cspace | ) |
constructor
|
virtualdefault |
destructor
|
virtual |
creates new CSpaceNode with configuration config and parentID
config | the configuration |
parentID | ID of the parent |
calcDistance | if set, the distance to obstacles is calculated and stored in the node (be careful: expensive), otherwise the dist is set to -1.0 |
|
virtual |
append a path to the tree (without any checks) Intermediate configs are generated according to the current cspace
startNode | start from this node |
config | |
storeLastAddedID | if given, the id of the last added node is stored here |
|
virtual |
Append the given path to this tree. No checks are performed.
|
virtual |
Append a path to the tree until a collision is detected Intermediate configs are generated according to the current cspace
startNode | start from this node |
config | |
storeLastAddedID | if given, the id of the last added node is stored here |
|
virtual |
creates path from startNode to goalNode by traversing the parents of goalNode
startNode | The start. |
goalNode | The goal. |
fillPath | Stores all configs. |
Saba::CSpacePtr Saba::CSpaceTree::getCSpace | ( | ) |
unsigned int Saba::CSpaceTree::getDimension | ( | ) | const |
CSpaceNodePtr Saba::CSpaceTree::getLastAddedNode | ( | ) |
|
virtual |
|
virtual |
get ID of nearest neighbor
config | configuration |
storeDist | pointer to float for storing the distance (if not NULL) |
CSpaceNodePtr Saba::CSpaceTree::getNode | ( | unsigned int | id | ) |
Return a cspace node.
id | the id of the node |
|
virtual |
|
virtual |
get number of nodes
|
protectedvirtual |
get distance of path start to end
float Saba::CSpaceTree::getTreeLength | ( | bool | useMetricWeights = true | ) |
Computes the complete length of all edges.
useMetricWeights | When set, the metric weights of the corresponding cspace are used for length calculation. When the cspace is not initialized with any metric weights, this option has no effect. |
|
inline |
bool Saba::CSpaceTree::hasNode | ( | CSpaceNodePtr | n | ) |
void Saba::CSpaceTree::lock | ( | ) |
Create a new cspace node (does !not! set the config values to zero).
|
virtual |
remove tree node
|
virtual |
set the number of nodes to zero
|
virtual |
saves all nodes with ID, configuration and parentID to a file
|
inline |
consider child vector list when adding nodes to the tree (standard: false)
void Saba::CSpaceTree::unlock | ( | ) |
|
protected |
|
protected |
shutdown tree, reset all data
dimension of the cspace
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
vector with pointers to all used nodes