bool RRTBase::add_iy(RRTNode *n)
{
- int i = IYI(n->y());
+ int i = this->YI(n);
if (i < 0)
i = 0;
if (i >= IYSIZE)
bool RRTBase::add_ixy(RRTNode *n)
{
- int ix = IXI(n->x());
+ int ix = this->XI(n);
if (ix < 0)
ix = 0;
if (ix >= IXSIZE)
ix = IXSIZE - 1;
- int iy = IYI(n->y());
+ int iy = this->YI(n);
if (iy < 0)
iy = 0;
if (iy >= IYSIZE)
}
if (to_del < this->nodes_.size())
this->nodes_.erase(this->nodes_.begin() + to_del);
- iy = IYI(tmp->y());
+ iy = this->YI(tmp);
to_del = this->iy_[iy].size();
#pragma omp parallel for reduction(min: to_del)
for (i = 0; i < this->iy_[iy].size(); i++) {
RRTNode *RRTBase::nn(RRTNode *rs)
{
- int iy = IYI(rs->y());
+ int iy = this->YI(rs);
struct mcnn nn;
nn.nn = nullptr;
nn.mc = 9999;
std::vector<RRTNode *> RRTBase::nv(RRTNode *node, float dist)
{
std::vector<RRTNode *> nvs;
- unsigned int iy = IYI(node->y());
+ unsigned int iy = this->YI(node);
unsigned int iy_dist = floor(dist / IYSTEP) + 1;
unsigned int i = 0; // vector index
unsigned int j = 0; // array index
if (this->collide(pn, ns)) {
pn->children().pop_back();
ns->remove_parent();
- this->iy_[IYI(ns->y())].pop_back();
+ this->iy_[this->YI(ns)].pop_back();
en_add = false;
} else {
this->ocost(ns);
if (this->collide(pn, ns)) {
pn->children().pop_back();
ns->remove_parent();
- this->iy_[IYI(ns->y())].pop_back();
+ this->iy_[this->YI(ns)].pop_back();
en_add = false;
} else {
this->ocost(ns);
if (this->collide(pn, ns)) {
pn->children().pop_back();
ns->remove_parent();
- this->iy_[IYI(ns->y())].pop_back();
+ this->iy_[this->YI(ns)].pop_back();
en_add = false;
} else {
this->ocost(ns);
this->add_iy(ns);
// connect
if (!this->connect(pn, ns, nvs)) {
- this->iy_[IYI(ns->y())].pop_back();
+ this->iy_[this->YI(ns)].pop_back();
en_add = false;
} else {
// rewire
this->add_iy(ns);
// connect
if (!this->connect(pn, ns, nvs)) {
- this->iy_[IYI(ns->y())].pop_back();
+ this->iy_[this->YI(ns)].pop_back();
this->nodes().pop_back();
delete ns;
en_add = false;
if (this->collide(pn, ns)) {
pn->children().pop_back();
ns->remove_parent();
- this->iy_[IYI(ns->y())].pop_back();
+ this->iy_[this->YI(ns)].pop_back();
this->nodes().pop_back();
delete ns;
en_add = false;
if (this->collide(pn, ns)) {
pn->children().pop_back();
ns->remove_parent();
- this->iy_[IYI(ns->y())].pop_back();
+ this->iy_[this->YI(ns)].pop_back();
this->nodes().pop_back();
delete ns;
en_add = false;
this->add_iy(ns);
// connect
if (!this->connect(nn, ns, nvs)) {
- this->iy_[IYI(ns->y())].pop_back();
+ this->iy_[this->YI(ns)].pop_back();
ret = 2;
} else {
// rewire
this->add_iy(ns);
// connect
if (!this->connect(pn, ns, nvs)) {
- this->iy_[IYI(ns->y())].pop_back();
+ this->iy_[this->YI(ns)].pop_back();
en_add = false;
ret = 2;
} else {