Skip to content

Commit

Permalink
⚠️ use filtered ball speed
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamagoham committed Mar 21, 2024
1 parent 00ebd87 commit d4107d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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 = ball.GetX()
var ball_Y float32 = ball.GetY()
var ball_X float32 = filtered_ball_x
var ball_Y float32 = filtered_ball_y

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

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

} else if ball != nil {
pre_ball_X = ball.GetX()
Expand Down

1 comment on commit d4107d7

@Tamagoham
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#8 done

Please sign in to comment.