]> rtime.felk.cvut.cz Git - hubacji1/bcar.git/commitdiff
Add front track, refine mtr computation
authorJiri Vlasak <jiri.vlasak.2@cvut.cz>
Thu, 2 Dec 2021 22:32:50 +0000 (23:32 +0100)
committerJiri Vlasak <jiri.vlasak.2@cvut.cz>
Thu, 2 Dec 2021 22:53:00 +0000 (23:53 +0100)
incl/bcar.hh
src/bcar.cc

index c6210f8d2ccbe3aab78f38af599a3134cd3e3a5e..c24334fc52585090614381ef0c9684466daee0cb 100644 (file)
@@ -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_,
index bf273e6351c26e4285fe8523a3d73c32a69bf54c..060ed153103859da28b3b5f3258a79174831e450 100644 (file)
@@ -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