Skip to content

Commit

Permalink
Remove debug messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherRabotin committed Dec 13, 2016
1 parent 7565417 commit 48c4587
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
1 change: 0 additions & 1 deletion examples/jerkcar/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ func main() {

for k, yaccK := range yacc {
var measurement *mat64.Vector
fmt.Printf("\n---- k = %d ----\n", k)

if (k+1)%10 == 0 {
// Switch to using H1
Expand Down
4 changes: 2 additions & 2 deletions examples/jerkcar/vanilla.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Creation date (UTC): 2016-12-12 17:25:55.48429653 -0700 MST
# Creation date (UTC): 2016-12-12 17:33:31.215174543 -0700 MST
position,position+Covar,position-Covar,velocity,velocity+Covar,velocity-Covar,acceleration,acceleration+Covar,acceleration-Covar,bias,bias+Covar,bias-Covar
0.004501,6.324872,-6.324872,0.450187,6.324714,-6.324714,0.018710,4.478907,-4.478907,0.108776,4.478919,-4.478919
0.009003,6.325820,-6.325820,0.450329,6.325189,-6.325189,0.016469,4.476683,-4.476683,0.106020,4.477949,-4.477949
Expand Down Expand Up @@ -2000,4 +2000,4 @@ position,position+Covar,position-Covar,velocity,velocity+Covar,velocity-Covar,ac
1.410954,0.436806,-0.436806,-0.928453,0.246889,-0.246889,-0.080810,0.092910,-0.092910,-0.540108,0.167577,-0.167577
1.401687,0.438836,-0.438836,-0.929245,0.247649,-0.247649,-0.080842,0.093016,-0.093016,-0.544771,0.167637,-0.167637
1.431024,0.420897,-0.420897,-0.912095,0.240848,-0.240848,-0.076976,0.092049,-0.092049,-0.585599,0.167097,-0.167097
# Closing date (UTC): 2016-12-13 00:25:55.920301499 +0000 UTC
# Closing date (UTC): 2016-12-13 00:33:31.306593167 +0000 UTC
7 changes: 0 additions & 7 deletions vanilla.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func (kf *Vanilla) Update(measurement, control *mat64.Vector) (est Estimate, err
}

// Prediction step.
// \hat{x}_{k+1}^{-}
var xKp1Minus, xKp1Minus1, xKp1Minus2 mat64.Vector
xKp1Minus1.MulVec(kf.F, kf.prevEst.State())
if kf.needCtrl {
Expand All @@ -75,14 +74,12 @@ func (kf *Vanilla) Update(measurement, control *mat64.Vector) (est Estimate, err
} else {
xKp1Minus = xKp1Minus1
}
fmt.Printf("x-=%v\n", mat64.Formatted(&xKp1Minus, mat64.Prefix(" ")))

// P_{k+1}^{-}
var Pkp1Minus, FP, FPFt mat64.Dense
FP.Mul(kf.F, kf.prevEst.Covariance())
FPFt.Mul(&FP, kf.F.T())
Pkp1Minus.Add(&FPFt, kf.Noise.ProcessMatrix())
fmt.Printf("P-=%v\n", mat64.Formatted(&Pkp1Minus, mat64.Prefix(" ")))

// Compute estimated measurement update \hat{y}_{k}
var ykHat mat64.Vector
Expand All @@ -100,7 +97,6 @@ func (kf *Vanilla) Update(measurement, control *mat64.Vector) (est Estimate, err
Kkp1.Mul(&PHt, &HPHt)

// Measurement update
// xhatkkp1_minus + Kkkp1*(ykkp1 - Hkkp1*xhatkkp1_minus)
var xkp1Plus, xkp1Plus1, xkp1Plus2 mat64.Vector
xkp1Plus1.MulVec(kf.H, &xKp1Minus)
xkp1Plus1.SubVec(measurement, &xkp1Plus1)
Expand All @@ -115,9 +111,7 @@ func (kf *Vanilla) Update(measurement, control *mat64.Vector) (est Estimate, err
}
xkp1Plus.AddVec(&xKp1Minus, &xkp1Plus2)
xkp1Plus.AddVec(&xkp1Plus, kf.Noise.Process(kf.step))
fmt.Printf("x+=%v\n", mat64.Formatted(&xkp1Plus, mat64.Prefix(" ")))

// Pa_kp1_plus = (eye(4) - Kkp1*H)*P_kp1_minus;
var Pkp1Plus, Pkp1Plus1, Kkp1H, Kkp1R, Kkp1RKkp1 mat64.Dense
Kkp1H.Mul(&Kkp1, kf.H)
n, _ := Kkp1H.Dims()
Expand All @@ -127,7 +121,6 @@ func (kf *Vanilla) Update(measurement, control *mat64.Vector) (est Estimate, err
Kkp1R.Mul(&Kkp1, kf.Noise.MeasurementMatrix())
Kkp1RKkp1.Mul(&Kkp1R, Kkp1.T())
Pkp1Plus.Add(&Pkp1Plus, &Kkp1RKkp1)
fmt.Printf("P+=%v\n", mat64.Formatted(&Pkp1Plus, mat64.Prefix(" ")))

Pkp1PlusSym, err := AsSymDense(&Pkp1Plus)
if err != nil {
Expand Down

0 comments on commit 48c4587

Please sign in to comment.