Skip to content

Commit

Permalink
Merge pull request #18 from lixfel/highlightBall
Browse files Browse the repository at this point in the history
Add ball highlighter
  • Loading branch information
g3force authored Jun 27, 2021
2 parents 2add2b3 + 6a6abea commit a455452
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/client/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func (p *Package) AddTrackedFrame(frame *tracked.TrackerWrapperPacket) {
}
for _, ball := range frame.TrackedFrame.Balls {
p.Shapes = append(p.Shapes, Shape{OrderNumber: 3, Circle: createBallShape(*ball.Pos.X*1000, *ball.Pos.Y*1000, *ball.Pos.Z*1000)})
p.Shapes = append(p.Shapes, Shape{OrderNumber: 1, Circle: createBallHighlighter(*ball.Pos.X*1000, *ball.Pos.Y*1000)})
}

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

func createBallHighlighter(x, y float32) *Circle {
return &Circle{
Center: Point{x, -y},
Radius: 500,
Style: Style{
Stroke: &orange,
StrokeWidth: &lineWidth,
FillOpacity: &noFill,
},
}
}

func (p *Package) AddGeometryShapes(geometry *vision.SSL_GeometryData) {
p.FieldWidth = float32(*geometry.Field.FieldWidth)
p.FieldLength = float32(*geometry.Field.FieldLength)
Expand Down

0 comments on commit a455452

Please sign in to comment.