]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Return immediately when not drivable
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Tue, 18 Jun 2019 07:53:12 +0000 (09:53 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 19 Jun 2019 11:55:11 +0000 (13:55 +0200)
vehicle_platform/bcar.cc

index f1580a184597d64f2d2ad3bf4764b17fb4c3cd55..9d87f2861904f306a362518e4033a5aec0610ce4 100644 (file)
@@ -280,11 +280,11 @@ bool BicycleCar::drivable(RRTNode *n)
         RRTNode *ccr = this->ccr();
         if (pow(ccl->x() - n->x(), 2) + pow(ccl->y() - n->y(), 2) <=
                         pow(this->turning_radius_, 2))
-                drivable = false;
+                return false;
         if (pow(ccr->x() - n->x(), 2) + pow(ccr->y() - n->y(), 2) <=
                         pow(this->turning_radius_, 2))
-                drivable = false;
-        return drivable;
+                return false;
+        return true;
 }
 
 BicycleCar *BicycleCar::move(RRTNode *c, float dh)