47 #ifndef DART_PLANNING_RRT_HPP_
48 #define DART_PLANNING_RRT_HPP_
66 namespace simulation {
80 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
111 const std::vector<std::size_t>&
dofs,
112 const Eigen::VectorXd& root,
118 const std::vector<std::size_t>&
dofs,
119 const std::vector<Eigen::VectorXd>& roots,
152 std::list<Eigen::VectorXd>& intermediatePoints,
153 Eigen::VectorXd& qnew,
154 const Eigen::VectorXd& qnear,
155 const Eigen::VectorXd& qtarget);
160 double getGap(
const Eigen::VectorXd& target);
165 int node, std::list<Eigen::VectorXd>& path,
bool reverse =
false);
180 std::vector<std::size_t>
193 virtual int addNode(
const Eigen::VectorXd& qnew,
int parentId);
The rapidly-expanding random tree implementation.
Definition: RRT.hpp:77
const double stepSize
Step size at each node creation.
Definition: RRT.hpp:96
virtual int addNode(const Eigen::VectorXd &qnew, int parentId)
Adds a new node to the tree.
Definition: RRT.cpp:197
std::vector< int > parentVector
The ith node in configVector has parent with index pV[i].
Definition: RRT.hpp:99
const int ndim
Number of dof we can manipulate (may be less than robot's)
Definition: RRT.hpp:95
StepResult tryStep()
Try a single step with the given "stepSize" to a random configuration.
Definition: RRT.cpp:138
StepResult
To get byte-aligned Eigen vectors.
Definition: RRT.hpp:84
@ STEP_PROGRESS
Definition: RRT.hpp:88
@ STEP_REACHED
Definition: RRT.hpp:86
@ STEP_COLLISION
Definition: RRT.hpp:85
flann::Index< flann::L2< double > > * index
The underlying flann data structure for fast nearest neighbor searches.
Definition: RRT.hpp:184
virtual bool newConfig(std::list< Eigen::VectorXd > &intermediatePoints, Eigen::VectorXd &qnew, const Eigen::VectorXd &qnear, const Eigen::VectorXd &qtarget)
Checks if the given new configuration is in collision with an obstacle.
Definition: RRT.cpp:186
int activeNode
Last added node or the nearest node found after a search.
Definition: RRT.hpp:98
RRT(dart::simulation::WorldPtr world, dart::dynamics::SkeletonPtr robot, const std::vector< std::size_t > &dofs, const Eigen::VectorXd &root, double stepSize=0.02)
virtual Eigen::VectorXd getRandomConfig()
Returns a random configuration with the specified node IDs.
Definition: RRT.cpp:253
RRT(simulation::WorldPtr world, dynamics::SkeletonPtr robot, const std::vector< std::size_t > &dofs, const std::vector< Eigen::VectorXd > &roots, double stepSize=0.02)
Constructor with multiple roots (so, multiple trees)
dynamics::SkeletonPtr robot
The ID of the robot for which a plan is generated.
Definition: RRT.hpp:179
double getGap(const Eigen::VectorXd &target)
Returns the distance between the current active node and the given node.
Definition: RRT.cpp:269
StepResult tryStep(const Eigen::VectorXd &qtry)
Try a single step with the given "stepSize" to the given configuration.
simulation::WorldPtr world
The world that the robot is in.
Definition: RRT.hpp:177
virtual int getNearestNeighbor(const Eigen::VectorXd &qsamp)
Returns the nearest neighbor to query point.
Definition: RRT.cpp:220
std::size_t getSize()
Returns the number of nodes in the tree.
Definition: RRT.cpp:301
virtual bool checkCollisions(const Eigen::VectorXd &c)
Implementation-specific function for checking collisions.
Definition: RRT.cpp:293
bool connect()
Reach for a random node by repeatedly extending nodes from the nearest neighbor in the tree.
Definition: RRT.cpp:112
std::vector< std::size_t > dofs
The dofs of the robot the planner can manipulate.
Definition: RRT.hpp:181
bool connect(const Eigen::VectorXd &target)
Reach for a target by repeatedly extending nodes from the nearest neighbor.
std::vector< const Eigen::VectorXd * > configVector
All visited configs.
Definition: RRT.hpp:105
void tracePath(int node, std::list< Eigen::VectorXd > &path, bool reverse=false)
Traces the path from some node to the initConfig node - useful in creating the full path after the go...
Definition: RRT.cpp:276
virtual ~RRT()
Destructor.
Definition: RRT.hpp:123
double randomInRange(double min, double max)
Returns a random value between the given minimum and maximum value.
Definition: RRT.cpp:241
virtual StepResult tryStepFromNode(const Eigen::VectorXd &qtry, int NNidx)
Tries to extend tree towards provided sample.
Definition: RRT.cpp:154
std::shared_ptr< Skeleton > SkeletonPtr
Definition: SmartPointer.hpp:60
std::shared_ptr< World > WorldPtr
Definition: SmartPointer.hpp:41
Definition: BulletCollisionDetector.cpp:65