]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Implement method
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 11 Jul 2019 13:25:48 +0000 (15:25 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Thu, 11 Jul 2019 13:25:48 +0000 (15:25 +0200)
src/bcar.cc

index a3203e0124e024e124ec3fa633c70a6b98cb53b3..ef4191858bce5387526d6595e5b7ba165c4de36a 100644 (file)
@@ -4,6 +4,18 @@
 // kinematic constraints
 bool BicycleCar::drivable(BicycleCar *bc)
 {
+        if (
+                pow(this->ccl()->x() - bc->x(), 2)
+                + pow(this->ccl()->y() - bc->y(), 2)
+                <= pow(this->mtr(), 2)
+        )
+                return false;
+        if (
+                pow(this->ccr()->x() - bc->x(), 2)
+                + pow(this->ccr()->y() - bc->y(), 2)
+                <= pow(this->mtr(), 2)
+        )
+                return false;
         return true;
 }