From 447122e7c3c587c3601d4b64f868c32bee98233f Mon Sep 17 00:00:00 2001 From: Tamagoham Date: Sun, 28 Apr 2024 02:27:27 +0900 Subject: [PATCH] :warning: use raw value to diff x y our robots --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index b6d680c..3e253fe 100644 --- a/main.go +++ b/main.go @@ -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]) @@ -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())