Skip to content

Commit

Permalink
Merge pull request #46 from Rione/info/show_ref_command
Browse files Browse the repository at this point in the history
✏️ log ref cmd
  • Loading branch information
Tamagoham authored Jul 14, 2024
2 parents d3af8b2 + 6c7a3a0 commit b73c9d8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions createprotos.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ func createRefInfo(ourteam int, attackdirection int, ignore_ref_mismatch bool, g
redcards = 0
}

// log.Println("[MW] Referee Command: ", command)

pe := &pb_gen.Referee_Info{
Command: command,
Stage: stage,
Expand Down
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,21 @@ func RunServer(chserver chan bool, reportrate uint, ourteam int, goalpose int, d
ipv4 := NW_AI_IPADDR
port := NW_AI_PORT
port_controller := NW_AI_PORT_CONTROLLER
port_gui := NW_AI_PORT_GUI
addr := ipv4 + ":" + port
addr_controller := ipv4 + ":" + port_controller
addr_gui := ipv4 + ":" + port_gui

log.Println("Send to:", addr)

conn, err := net.Dial("udp", addr)
CheckError(err)
conn_controller, err := net.Dial("udp", addr_controller)
CheckError(err)
conn_gui, err := net.Dial("udp", addr_gui)
defer conn.Close()
defer conn_controller.Close()
defer conn_gui.Close()

var counter int

Expand Down Expand Up @@ -199,6 +203,7 @@ func RunServer(chserver chan bool, reportrate uint, ourteam int, goalpose int, d
if isvisionrecv && geometrydata != nil {
conn.Write([]byte(Data))
conn_controller.Write([]byte(Data))
conn_gui.Write([]byte(Data))
}

time.Sleep(time.Duration(reportrate) * time.Millisecond)
Expand Down
1 change: 1 addition & 0 deletions variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var NW_VISION_REFEREE_INTERFACE_NAME string = "nil"
var NW_AI_IPADDR string = "127.0.0.1"
var NW_AI_PORT string = "30011"
var NW_AI_PORT_CONTROLLER string = "30012"
var NW_AI_PORT_GUI string = "30013"
var NW_REF_MAX_DATAGRAM_SIZE int = 8192 * 2

var IMU_RESET_INTERVAL time.Duration = 5000 * time.Millisecond
Expand Down

0 comments on commit b73c9d8

Please sign in to comment.