Skip to content

Commit 5d1005c

Browse files
authored
Handle case when velocity calculation is not valid (#533)
velocity 0 of no movement, BUGFIX
1 parent 1a21c1e commit 5d1005c

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/common/base_classes/Sensor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ float Sensor::getVelocity() {
4444
vel_angle_prev = angle_prev;
4545
vel_full_rotations = full_rotations;
4646
vel_angle_prev_ts = angle_prev_ts;
47+
}else{
48+
velocity = 0;
4749
}
4850

4951
return velocity;

0 commit comments

Comments
 (0)