return nodes;
}
-float RRTBase::XI(RRTNode *n)
+int RRTBase::XI(RRTNode *n)
{
- return n->x();
+ float step = (this->HMAX - this->HMIN) / IXSIZE;
+ float index = (int) (floor(n->x() - this->HMIN) / step);
+ return index;
}
-float RRTBase::YI(RRTNode *n)
+int RRTBase::YI(RRTNode *n)
{
- return n->y();
+ float step = (this->VMAX - this->VMIN) / IYSIZE;
+ float index = (int) (floor(n->y() - this->VMIN) / step);
+ return index;
}
// RRT Framework
bool rebase(RRTNode *nr);
std::vector<RRTNode *> findt();
std::vector<RRTNode *> findt(RRTNode *n);
- float XI(RRTNode *n);
- float YI(RRTNode *n);
+ int XI(RRTNode *n);
+ int YI(RRTNode *n);
// RRT Framework
void setSamplingInfo(SamplingInfo si);