Skip to content

Commit

Permalink
⚠️ use raw value to diff x y our robots
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamagoham committed Apr 27, 2024
1 parent 2bd7821 commit 447122e
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 @@ -724,8 +724,8 @@ func VisionReceive(chvision chan bool, port int, ourteam int, goalpos int, simmo
filtered_robot_x[i] = float32(modelRobotX[i].Value(filterRobotX[i].State()))
filtered_robot_y[i] = float32(modelRobotY[i].Value(filterRobotY[i].State()))

robot_difference_X[i] = filtered_robot_x[i] - pre_robot_X[i]
robot_difference_Y[i] = filtered_robot_y[i] - pre_robot_Y[i]
robot_difference_X[i] = robot.GetX() - pre_robot_X[i]
robot_difference_Y[i] = robot.GetY() - pre_robot_Y[i]
robot_difference_Theta[i] = robot.GetOrientation() - pre_robot_Theta[i]

rdX64[i] = float64(robot_difference_X[i])
Expand All @@ -743,8 +743,8 @@ func VisionReceive(chvision chan bool, port int, ourteam int, goalpos int, simmo

robot_angular_velocity[i] = robot_difference_Theta[i] / 0.016

pre_robot_X[i] = filtered_robot_x[i]
pre_robot_Y[i] = filtered_robot_y[i]
pre_robot_X[i] = robot.GetX()
pre_robot_Y[i] = robot.GetY()
pre_robot_Theta[i] = robot.GetOrientation()

radian_ball_robot[i] = Calc_degree_normalize(Calc_degree(ball.GetX(), ball.GetY(), robot.GetX(), robot.GetY()) - robot.GetOrientation())
Expand Down

0 comments on commit 447122e

Please sign in to comment.