ADD (WIP) speedometer implementation

This commit is contained in:
fastium 2024-10-29 17:10:58 +01:00
parent db2d5308bc
commit 0d18073562

View File

@ -24,6 +24,8 @@
#include "speedometer.hpp"
#include "static_scheduling/gear_device.hpp"
#include <chrono>
#include <ratio>
@ -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<std::chrono::seconds>(this->_pedalRotationTime).count();
this->_currentSpeed = static_cast<float>(kTraySize) / this->_gearSize * this->kWheelCircumference * ;
}
void Speedometer::computeDistance() {
@ -120,6 +123,7 @@ void Speedometer::computeDistance() {
// distance traveled.
// TODO
}
} // namespace bike_computer