ADD (WIP) speedometer implementation
This commit is contained in:
parent
db2d5308bc
commit
0d18073562
@ -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
|
Loading…
x
Reference in New Issue
Block a user