fix meanrpm calculation

This commit is contained in:
interfisch 2021-05-29 12:20:55 +02:00
parent f33fe75d89
commit 0c4d805054
1 changed files with 1 additions and 1 deletions

View File

@ -315,7 +315,7 @@ void loop() {
sendCMD();
//Update speed and trip
float _meanRPM=FeedbackFront.speedL_meas-FeedbackFront.speedR_meas+FeedbackRear.speedL_meas-FeedbackRear.speedR_meas;
float _meanRPM=(FeedbackFront.speedL_meas-FeedbackFront.speedR_meas+FeedbackRear.speedL_meas-FeedbackRear.speedR_meas)/4.0;
meanSpeedms=_meanRPM*wheelcircumference/60.0; // Units: 1/min * m / 60s
trip+=abs(meanSpeedms)* (SENDPERIOD/1000.0);