From: Jiri Vlasak Date: Wed, 3 Apr 2019 07:37:46 +0000 (+0200) Subject: Add distance to rear corner getter X-Git-Tag: v0.6.0~5^2~12 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/hubacji1/iamcar.git/commitdiff_plain/f2aef95ff70d38c567a6ddea6058b3af9dec781e Add distance to rear corner getter --- diff --git a/incl/bcar.h b/incl/bcar.h index afac7c7..0abd3dd 100644 --- a/incl/bcar.h +++ b/incl/bcar.h @@ -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 */ diff --git a/vehicle_platform/bcar.cc b/vehicle_platform/bcar.cc index 3972c96..f1580a1 100644 --- a/vehicle_platform/bcar.cc +++ b/vehicle_platform/bcar.cc @@ -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) +