fix speed log staying 0

This commit is contained in:
interfisch 2021-05-28 20:04:42 +02:00
parent dc3b7d6ff5
commit b96c3bcc19
1 changed files with 1 additions and 1 deletions

View File

@ -295,7 +295,7 @@ void loop() {
if (newData2 || newData3) { //when new data arrived from one controller
float _meanRPM=FeedbackFront.speedL_meas-FeedbackFront.speedR_meas+FeedbackRear.speedL_meas-FeedbackRear.speedR_meas;
float meanSpeedms=_meanRPM*wheelcircumference/60.0; // Units: 1/min * m / 60s
meanSpeedms=_meanRPM*wheelcircumference/60.0; // Units: 1/min * m / 60s
trip+=abs(meanSpeedms)* (millis()-last_feedback) / 1000.0;
last_feedback=millis();
}