We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 461ed57 commit f927db2Copy full SHA for f927db2
src/common/base_classes/Sensor.cpp
@@ -19,7 +19,7 @@ float Sensor::getVelocity() {
19
// calculate sample time
20
float Ts = (angle_prev_ts - vel_angle_prev_ts)*1e-6;
21
// quick fix for strange cases (micros overflow)
22
- if(Ts <= 0 || Ts > 0.5f) Ts = 1e-3f;
+ if(Ts <= 0) Ts = 1e-3f;
23
// velocity calculation
24
float vel = ( (float)(full_rotations - vel_full_rotations)*_2PI + (angle_prev - vel_angle_prev) ) / Ts;
25
// save variables for future pass
0 commit comments