]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/blobdiff - src/pslot.cc
Add arguments for find entry method
[hubacji1/bcar.git] / src / pslot.cc
index 07b2cdbeb95d0984ead2dcd26592db4e5546192e..5a4f1352d573feb288fb988c6d47f4cf89b710a9 100644 (file)
@@ -175,11 +175,10 @@ ParkingSlot::drive_in_slot(BicycleCar c, unsigned int& max)
 }
 
 PoseRange
-ParkingSlot::fe()
+ParkingSlot::fe(BicycleCar c, unsigned int& max)
 {
        assert(this->parallel());
        assert(this->right());
-       BicycleCar c;
        c.h(this->h());
        double clen = this->offset_ + this->len() - c.df();
        double cw = this->offset_ + c.w() / 2.0;
@@ -191,8 +190,8 @@ ParkingSlot::fe()
        this->curb_.intersects_with(b3, c.len());
        double max_to_slot;
        auto const& rr = c.rr();
-       auto const& i1 = this->curb_.in1();
-       auto const& i2 = this->curb_.in2();
+       auto const& i1 = this->curb_.i1();
+       auto const& i2 = this->curb_.i2();
        if (rr.edist(i1) < rr.edist(i2)) {
                max_to_slot = rr.min_angle_between(b3, i1);
        } else {
@@ -206,9 +205,8 @@ ParkingSlot::fe()
                starts.push_back(c);
        }
        std::vector<std::vector<BicycleCar>> entries;
-       unsigned int max_cusp = 10;
        for (auto s: starts) {
-               auto r = this->drive_in_slot(s, max_cusp);
+               auto r = this->drive_in_slot(s, max);
                if (r.size() > 0) {
                        entries.push_back(r);
                }
@@ -227,8 +225,8 @@ ParkingSlot::fe()
        Line li2(b2, e2);
        li1.intersects_with(li2);
        PoseRange pr;
-       pr.x(li1.in1().x());
-       pr.y(li1.in1().y());
+       pr.x(li1.i1().x());
+       pr.y(li1.i1().y());
        pr.b(b);
        pr.e(e);
        return pr;