diff --git a/common/speedometer.cpp b/common/speedometer.cpp index a30ecaa..7f1b4c1 100644 --- a/common/speedometer.cpp +++ b/common/speedometer.cpp @@ -24,6 +24,8 @@ #include "speedometer.hpp" +#include "static_scheduling/gear_device.hpp" + #include #include @@ -106,8 +108,9 @@ void Speedometer::computeSpeed() { // ~= 560 m / min = 33.6 km/h // TODO - - + //Distance run with one pedal turn = tray size / rear gear size * circumference of the wheel + std::chrono::seconds pedal_rotation_time = std::chrono::duration_cast(this->_pedalRotationTime).count(); + this->_currentSpeed = static_cast(kTraySize) / this->_gearSize * this->kWheelCircumference * ; } void Speedometer::computeDistance() { @@ -120,6 +123,7 @@ void Speedometer::computeDistance() { // distance traveled. // TODO + } } // namespace bike_computer \ No newline at end of file