ADD (WIP) speedometer implementation
This commit is contained in:
parent
db2d5308bc
commit
0d18073562
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#include "speedometer.hpp"
|
#include "speedometer.hpp"
|
||||||
|
|
||||||
|
#include "static_scheduling/gear_device.hpp"
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <ratio>
|
#include <ratio>
|
||||||
|
|
||||||
@ -106,8 +108,9 @@ void Speedometer::computeSpeed() {
|
|||||||
// ~= 560 m / min = 33.6 km/h
|
// ~= 560 m / min = 33.6 km/h
|
||||||
|
|
||||||
// TODO
|
// 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() {
|
void Speedometer::computeDistance() {
|
||||||
@ -120,6 +123,7 @@ void Speedometer::computeDistance() {
|
|||||||
// distance traveled.
|
// distance traveled.
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace bike_computer
|
} // namespace bike_computer
|
Loading…
x
Reference in New Issue
Block a user