Skip to content

Commit

Permalink
fix missing if-else
Browse files Browse the repository at this point in the history
  • Loading branch information
sterlingdeng committed Nov 12, 2024
1 parent 82bca40 commit 63459d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/gcc/kalman.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ func (k *kalman) updateEstimate(measurement time.Duration) time.Duration {
root3 := 3 * root
if zms > root3 {
k.measurementUncertainty = math.Max(alpha*k.measurementUncertainty+(1-alpha)*root3*root3, 1)
} else {
k.measurementUncertainty = math.Max(alpha*k.measurementUncertainty+(1-alpha)*zms*zms, 1)
}
k.measurementUncertainty = math.Max(alpha*k.measurementUncertainty+(1-alpha)*zms*zms, 1)
}

estimateUncertainty := k.estimateError + k.processUncertainty
Expand Down

0 comments on commit 63459d3

Please sign in to comment.