]> rtime.felk.cvut.cz Git - hubacji1/iamcar.git/commitdiff
Add distance to rear corner getter
authorJiri Vlasak <hubacji1@fel.cvut.cz>
Wed, 3 Apr 2019 07:37:46 +0000 (09:37 +0200)
committerJiri Vlasak <hubacji1@fel.cvut.cz>
Fri, 5 Apr 2019 07:22:49 +0000 (09:22 +0200)
incl/bcar.h
vehicle_platform/bcar.cc

index afac7c7b49d5379f8e1ba7e7113dba2d53bcb012..0abd3dd26f9c6bf05eda30c82cd9845c0d98f33c 100644 (file)
@@ -92,6 +92,8 @@ class BicycleCar: public RRTNode {
 
                 /** Return distance from wheelbase center to top corner */
                 float diag_radi();
+                /** Return distance from wheelbase center to rear corner */
+                float diag_rradi();
                 /** Outer radius of the farthest point */
                 float out_radi();
                 /** Angle between wheelbase line and outer radius */
index 3972c96e4c462df490ba9f3baae791ccc9bb0d0c..f1580a184597d64f2d2ad3bf4764b17fb4c3cd55 100644 (file)
@@ -254,6 +254,13 @@ float BicycleCar::diag_radi()
         return pow(xx + yy, 0.5);
 }
 
+float BicycleCar::diag_rradi()
+{
+        float xx = pow(this->dr(), 2);
+        float yy = pow(this->width_ / 2, 2);
+        return pow(xx + yy, 0.5);
+}
+
 float BicycleCar::out_radi()
 {
         return pow((pow(this->turning_radius_ + this->width_ / 2, 2) +