FIX clang format

This commit is contained in:
fastium 2025-01-04 15:53:13 +01:00
parent b9c129e872
commit afa1fb8aef

View File

@ -24,11 +24,11 @@
#include "speedometer.hpp" #include "speedometer.hpp"
#include "static_scheduling/gear_device.hpp"
#include <chrono> #include <chrono>
#include <ratio> #include <ratio>
#include "static_scheduling/gear_device.hpp"
// from disco_h747i/wrappers // from disco_h747i/wrappers
#include "joystick.hpp" #include "joystick.hpp"
#include "mbed_trace.h" #include "mbed_trace.h"
@ -108,10 +108,14 @@ void Speedometer::computeSpeed() {
// ~= 560 m / min = 33.6 km/h // ~= 560 m / min = 33.6 km/h
// TODO : done // TODO : done
//Distance run with one pedal turn = tray size / rear gear size * circumference of the wheel // Distance run with one pedal turn = tray size / rear gear size * circumference of
// the wheel
constexpr float ms_in_hour = static_cast<float>(3600 * 1000); constexpr float ms_in_hour = static_cast<float>(3600 * 1000);
float pedal_rotation_per_hour = ms_in_hour / std::chrono::duration_cast<std::chrono::milliseconds>(_pedalRotationTime).count(); float pedal_rotation_per_hour =
float gear_ratio = static_cast<float>(kTraySize) / static_cast<float>(this->_gearSize); ms_in_hour /
std::chrono::duration_cast<std::chrono::milliseconds>(_pedalRotationTime).count();
float gear_ratio =
static_cast<float>(kTraySize) / static_cast<float>(this->_gearSize);
float wheel_dist_km = static_cast<float>(this->kWheelCircumference) / 1000.0; float wheel_dist_km = static_cast<float>(this->kWheelCircumference) / 1000.0;
this->_currentSpeed = gear_ratio * wheel_dist_km * pedal_rotation_per_hour; this->_currentSpeed = gear_ratio * wheel_dist_km * pedal_rotation_per_hour;
} }