Skip to content

Commit

Permalink
Add continuation issue for ball outside field
Browse files Browse the repository at this point in the history
  • Loading branch information
g3force committed Jul 6, 2023
1 parent dd937d3 commit 5223b30
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/app/engine/process_continue_next_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/RoboCup-SSL/ssl-game-controller/internal/app/state"
"github.com/RoboCup-SSL/ssl-game-controller/pkg/timer"
"google.golang.org/protobuf/types/known/timestamppb"
"math"
"strings"
"time"
)
Expand Down Expand Up @@ -221,6 +222,13 @@ func (e *Engine) readyToContinueFromStop() (issues []string) {
ballToPlacementPosDist, e.gameConfig.BallPlacementRequiredDistance))
}
}

ballPos := e.trackerStateGc.Ball.Pos.ToVector2()
if math.Abs(float64(*ballPos.X)) > e.getGeometry().FieldLength/2 ||
math.Abs(float64(*ballPos.Y)) > e.getGeometry().FieldWidth/2 {
issues = append(issues, fmt.Sprintf("Ball is outside of field: %v", ballPos))
}

if !e.trackerStateGc.Ball.IsSteady() {
issues = append(issues, "Ball position is not steady")
}
Expand Down

0 comments on commit 5223b30

Please sign in to comment.