Skip to content

Commit a455452

Browse files
authored
Merge pull request #18 from lixfel/highlightBall
Add ball highlighter
2 parents 2add2b3 + 6a6abea commit a455452

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pkg/client/converter.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ func (p *Package) AddTrackedFrame(frame *tracked.TrackerWrapperPacket) {
5151
}
5252
for _, ball := range frame.TrackedFrame.Balls {
5353
p.Shapes = append(p.Shapes, Shape{OrderNumber: 3, Circle: createBallShape(*ball.Pos.X*1000, *ball.Pos.Y*1000, *ball.Pos.Z*1000)})
54+
p.Shapes = append(p.Shapes, Shape{OrderNumber: 1, Circle: createBallHighlighter(*ball.Pos.X*1000, *ball.Pos.Y*1000)})
5455
}
5556

5657
for _, bot := range frame.TrackedFrame.Robots {
@@ -80,6 +81,18 @@ func createBallShape(x, y, z float32) *Circle {
8081
}
8182
}
8283

84+
func createBallHighlighter(x, y float32) *Circle {
85+
return &Circle{
86+
Center: Point{x, -y},
87+
Radius: 500,
88+
Style: Style{
89+
Stroke: &orange,
90+
StrokeWidth: &lineWidth,
91+
FillOpacity: &noFill,
92+
},
93+
}
94+
}
95+
8396
func (p *Package) AddGeometryShapes(geometry *vision.SSL_GeometryData) {
8497
p.FieldWidth = float32(*geometry.Field.FieldWidth)
8598
p.FieldLength = float32(*geometry.Field.FieldLength)

0 commit comments

Comments
 (0)