Skip to content

Commit

Permalink
⚠️ degree to radian
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamagoham committed May 24, 2022
1 parent 6cc509c commit 9fba3d6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var enemy_intercept [16]float32
var enemy_speed [16]float32
var enemy_angular_velocity [16]float32
var distance_ball_robot [16]float32
var degree_ball_robot [16]float32
var radian_ball_robot [16]float32

var framecounter int
var fps float32
Expand Down Expand Up @@ -481,7 +481,7 @@ func Observer(chobserver chan bool, ourteam int, goalpos int) {
pre_robot_Y[i] = robot.GetY()
pre_robot_Theta[i] = robot.GetOrientation()

degree_ball_robot[i] = Calc_degree_normalize(Calc_degree(ball.GetX(), ball.GetY(), robot.GetX(), robot.GetY()) - robot.GetOrientation())
radian_ball_robot[i] = Calc_degree_normalize(Calc_degree(ball.GetX(), ball.GetY(), robot.GetX(), robot.GetY()) - robot.GetOrientation())
distance_ball_robot[i] = Calc_distance(ball.GetX(), ball.GetY(), robot.GetX(), robot.GetY())

}
Expand Down Expand Up @@ -575,7 +575,7 @@ func createRobotInfo(i int, ourteam int) *pb_gen.Robot_Infos {
Y: &y,
Theta: &theta,
DistanceBallRobot: &distance_ball_robot[i],
DegreeBallRobot: &degree_ball_robot[i],
RadianBallRobot: &radian_ball_robot[i],
Speed: &robot_speed[i],
Slope: &robot_slope[i],
Intercept: &robot_intercept[i],
Expand Down Expand Up @@ -628,7 +628,7 @@ func createEnemyInfo(i int, ourteam int) *pb_gen.Robot_Infos {
func createBallInfo() *pb_gen.Ball_Info {
var x float32 = ball.GetX()
var y float32 = ball.GetY()
var slopedegree float32 = ball_slope_degree
var sloperadian float32 = ball_slope_degree
var slope float32 = ball_slope
var intercept float32 = ball_intercept
var speed float32 = ball_speed
Expand All @@ -637,7 +637,7 @@ func createBallInfo() *pb_gen.Ball_Info {
FilteredY: &filtered_ball_y,
X: &x,
Y: &y,
SlopeDegree: &slopedegree,
SlopeRadian: &sloperadian,
Intercept: &intercept,
Speed: &speed,
Slope: &slope,
Expand Down
24 changes: 12 additions & 12 deletions proto/pb_gen/to_racoonai.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions proto/pb_src/to_racoonai.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ message Robot_Infos {
required float y = 3;
required float theta = 4;
optional float distance_ball_robot = 5;
optional float degree_ball_robot = 6;
optional float radian_ball_robot = 6;
required float speed = 7;
required float slope = 8;
required float intercept = 9;
Expand All @@ -24,7 +24,7 @@ message Ball_Info {
required float filtered_y = 2;
required float x = 3;
required float y = 4;
required float slope_degree = 5;
required float slope_radian = 5;
required float intercept = 6;
required float speed = 7;
required float slope = 8;
Expand Down

0 comments on commit 9fba3d6

Please sign in to comment.