while (!q.empty()) {
c = q.front();
q.pop();
- if (this->DH() > 0 && c->rfx() <= 0 && c->rrx() <= 0) {
- goto createcuspandfinish;
- } else if (this->DH() < 0 && c->lfx() >= 0 && c->lrx() >= 0) {
+ if (this->isInside(c)) {
goto createcuspandfinish;
} else if (c->s() < 9) {
BicycleCar *cc = this->flnc(c);
}
}
+bool ParallelSlot::isInside(BicycleCar *c)
+{
+ bool inside = true;
+ RRTNode *tmpn;
+ tmpn = new RRTNode(c->lfx(), c->lfy(), 0);
+ if (!this->slot().collide(tmpn))
+ inside = false;
+ delete tmpn;
+ tmpn = new RRTNode(c->lrx(), c->lry(), 0);
+ if (!this->slot().collide(tmpn))
+ inside = false;
+ delete tmpn;
+ tmpn = new RRTNode(c->rrx(), c->rry(), 0);
+ if (!this->slot().collide(tmpn))
+ inside = false;
+ delete tmpn;
+ tmpn = new RRTNode(c->rfx(), c->rfy(), 0);
+ if (!this->slot().collide(tmpn))
+ inside = false;
+ delete tmpn;
+ return inside;
+}
+
struct SamplingInfo ParallelSlot::getSamplingInfo()
{
struct SamplingInfo si;
);
/** Test possible init poses */
void fpose();
+ /** Return true if car is inside slot */
+ bool isInside(BicycleCar *c);
/** Return values to set sampling function of RRT */
struct SamplingInfo getSamplingInfo();
};