From 9bbbfc30d43c42120c67b390765cb9e9dfa83ac3 Mon Sep 17 00:00:00 2001 From: Cyrille Nofficial Date: Thu, 1 Sep 2022 15:27:36 +0200 Subject: [PATCH] add debug trace --- pkg/steering/corrector.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/steering/corrector.go b/pkg/steering/corrector.go index 3eff2bf..a5e2559 100644 --- a/pkg/steering/corrector.go +++ b/pkg/steering/corrector.go @@ -139,7 +139,7 @@ func (c *GridCorrector) AdjustFromObjectPosition(currentSteering float64, object // get nearest object nearest, err := c.nearObject(grpObjs) if err != nil { - zap.S().Warnf("unexpected error on nearest seach object, ignore objects: %v", err) + zap.S().Warnf("unexpected error on nearest search object, ignore objects: %v", err) return currentSteering } @@ -177,6 +177,7 @@ func (c *GridCorrector) computeDeviation(nearest *events.Object) float64 { var delta float64 var err error + zap.S().Debugf("search delta value for bottom limit: %v", nearest.Bottom) if nearest.Left < 0 && nearest.Right < 0 { delta, err = c.gridMap.ValueOf(float64(nearest.Right)*2-1., float64(nearest.Bottom)) } @@ -189,6 +190,7 @@ func (c *GridCorrector) computeDeviation(nearest *events.Object) float64 { zap.S().Warnf("unable to compute delta to apply to steering, skip correction: %v", err) delta = 0 } + zap.S().Debugf("new deviation computed: %v", delta) return delta }