From: Jiri Vlasak Date: Thu, 2 Dec 2021 22:32:50 +0000 (+0100) Subject: Add front track, refine mtr computation X-Git-Tag: v0.8.0~6 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/hubacji1/bcar.git/commitdiff_plain/42cfdd753a4f7e662ab85ed894d3c56ddb083a13 Add front track, refine mtr computation --- diff --git a/incl/bcar.hh b/incl/bcar.hh index c6210f8..c24334f 100644 --- a/incl/bcar.hh +++ b/incl/bcar.hh @@ -205,6 +205,7 @@ private: double wheelbase_ = 2.450; double distance_to_front_ = 3.105; double length_ = 3.760; + double _front_track = 1.625; public: /*! Get curb-to-curb distance. */ double ctc() const; @@ -239,6 +240,12 @@ public: /*! Get distance from rear axle to rear. */ double dr() const; + /*! Set front track. */ + void ft(double ft); + + /*! Get front track. */ + double ft() const; + /*! \brief Get minimum turning radius. * * Please, note that the method returns really _minimum turning radius_, diff --git a/src/bcar.cc b/src/bcar.cc index bf273e6..060ed15 100644 --- a/src/bcar.cc +++ b/src/bcar.cc @@ -495,12 +495,24 @@ CarSize::dr() const return this->len() - this->df(); } +void +CarSize::ft(double ft) +{ + this->_front_track = ft; +} + +double +CarSize::ft() const +{ + return this->_front_track; +} + double CarSize::mtr() const { auto ctc2 = pow(this->ctc() / 2.0, 2.0); auto wb2 = pow(this->wb(), 2.0); - return sqrt(ctc2 - wb2) - this->w() / 2.0; + return sqrt(ctc2 - wb2) - this->ft() / 2.0; } double