Skip to content

Commit cbc865b

Browse files
committed
Improve log statements for placing the ball
1 parent c71be3a commit cbc865b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/simctl/replace_ball.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,20 @@ func (r *BallReplacer) handleReplaceBall() {
4848

4949
balls := r.c.lastTrackedFrame.TrackedFrame.Balls
5050
if len(balls) == 0 {
51+
log.Printf("Ball vanished. Placing ball to %v", targetPos)
5152
r.placeBall(targetPos)
5253
return
5354
}
5455

5556
currentPos := geom.NewVector2Float32(*balls[0].Pos.X, *balls[0].Pos.Y)
5657

5758
if targetPos.DistanceTo(currentPos) > 0.1 {
59+
log.Printf("Placing ball from %v to %v", currentPos, targetPos)
5860
r.placeBall(targetPos)
5961
}
6062
}
6163

6264
func (r *BallReplacer) placeBall(ballPos *geom.Vector2) {
63-
log.Printf("Placing ball to %v", ballPos)
6465

6566
zero := float32(0)
6667
command := SimulatorCommand{

0 commit comments

Comments
 (0)