Skip to content

Commit

Permalink
⚠️ ball speed to raw xy values
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamagoham committed Mar 21, 2024
1 parent 6388a4c commit 00ebd87
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,8 @@ func VisionReceive(chvision chan bool, port int, ourteam int, goalpos int, simmo
//
/////////////////////////////////////
if ball != nil && pre_ball_X != 0 {
var ball_X float32 = filtered_ball_x
var ball_Y float32 = filtered_ball_y
var ball_X float32 = ball.GetX()
var ball_Y float32 = ball.GetY()

ball_difference_X = ball_X - pre_ball_X
ball_difference_Y = ball_Y - pre_ball_Y
Expand All @@ -655,12 +655,12 @@ func VisionReceive(chvision chan bool, port int, ourteam int, goalpos int, simmo
ball_speed = 0.0
}

pre_ball_X = filtered_ball_x
pre_ball_Y = filtered_ball_y
pre_ball_X = ball.GetX()
pre_ball_Y = ball.GetY()

} else if ball != nil {
pre_ball_X = filtered_ball_x
pre_ball_Y = filtered_ball_y
pre_ball_X = ball.GetX()
pre_ball_Y = ball.GetY()

} else {
time.Sleep(1 * time.Second)
Expand Down

0 comments on commit 00ebd87

Please sign in to comment.