Skip to content

Commit e671333

Browse files
committed
[feature] Add new counters to referee message
1 parent 1a5c8ce commit e671333

File tree

6 files changed

+1235
-1
lines changed

6 files changed

+1235
-1
lines changed

internal/app/controller/publisher.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package controller
22

33
import (
4-
"github.com/RoboCup-SSL/ssl-go-tools/sslproto"
4+
"github.com/RoboCup-SSL/ssl-game-controller/pkg/proto"
55
"github.com/golang/protobuf/proto"
66
"log"
77
"net"
@@ -60,6 +60,9 @@ func initTeamInfo(t *sslproto.SSL_Referee_TeamInfo) {
6060
t.Timeouts = new(uint32)
6161
t.TimeoutTime = new(uint32)
6262
t.Goalie = new(uint32)
63+
t.BotCollisions = new(uint32)
64+
t.BallPlacementFailures = new(uint32)
65+
t.BotSpeedInfringements = new(uint32)
6366
}
6467

6568
// Publish the state and command
@@ -141,6 +144,9 @@ func updateTeam(team *sslproto.SSL_Referee_TeamInfo, state *TeamInfo) {
141144
*team.Timeouts = uint32(state.TimeoutsLeft)
142145
*team.TimeoutTime = uint32(state.TimeoutTimeLeft.Nanoseconds() / 1000)
143146
*team.Goalie = uint32(state.Goalie)
147+
*team.BotCollisions = uint32(state.BotCollisions)
148+
*team.BallPlacementFailures = uint32(state.BallPlacementFailures)
149+
*team.BotSpeedInfringements = uint32(state.BotSpeedInfringements)
144150
}
145151

146152
func mapTimes(durations []time.Duration) []uint32 {

pkg/proto/generateProto.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
go get -u github.com/golang/protobuf/protoc-gen-go
3+
4+
protoc --go_out=import_path=sslproto:. *.proto

pkg/proto/ssl_game_event.pb.go

Lines changed: 337 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)