Skip to content

Commit

Permalink
⚠️ fix is_visible robots
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamagoham committed Jun 29, 2024
1 parent b3f59bf commit c27f06e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion createprotos.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func createRobotInfo(i int, ourteam int, simmode bool) *pb_gen.Robot_Infos {
var difftheta float32 = robot_difference_Theta[i]

var batt float32 = battery_voltage[i]
var online bool = true
var online bool = robot_online[i]
pe := &pb_gen.Robot_Infos{
RobotId: &robotid,
X: &x,
Expand Down
13 changes: 6 additions & 7 deletions visionreceive.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,12 @@ func VisionReceive(chvision chan bool, port int, ourteam int, goalpos int, simmo
// f, _ = os.OpenFile("./ball_cords.txt", os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644)

for {
var visible_in_vision_b [16]bool
var visible_in_vision_y [16]bool
for i := 0; i < 16; i++ {
visible_in_vision_b[i] = false
visible_in_vision_y[i] = false
}
for i := 0; i < maxcameras; i++ {
var n int
var err error
Expand Down Expand Up @@ -232,16 +238,9 @@ func VisionReceive(chvision chan bool, port int, ourteam int, goalpos int, simmo
}
}

var visible_in_vision_b [16]bool
var visible_in_vision_y [16]bool
num_yellowrobots = 0
num_bluerobots = 0

for i := 0; i < 16; i++ {
visible_in_vision_b[i] = false
visible_in_vision_y[i] = false
}

// Get Blue Robots
for _, robot := range packet.Detection.GetRobotsBlue() {
switch halfswitch_n {
Expand Down

0 comments on commit c27f06e

Please sign in to comment.