Commit c858963c authored by MarkG's avatar MarkG Committed by TIGERs GitLab
Browse files

Resolve "Fix detection of invalid goals after fouls"

Closes #1738

See merge request main/Sumatra!1509

sumatra-commit: a0f25f9b31882470ef5221f6f08ecd3680178406
parent 473faeab
Pipeline #17629 passed with stage
in 3 minutes and 29 seconds
time-acquisition-mode: ci
network:
publish-address:
# set a network IP to only publish to that network - else messages will be published to all network interfaces
publish-nif:
vision-address: 224.5.23.2:11006
tracker-address: 224.5.23.2:11010
skip-interfaces: [ ]
server:
auto-ref:
address: :11007
......@@ -68,6 +71,7 @@ game:
defense-area-width: 3.6
penalty-kick-dist-to-goal: 8.0
goal-width: 1.8
center-circle-radius: 0.5
placement-offset-touch-line: 0.2
placement-offset-goal-line: 0.2
placement-offset-goal-line-goal-kick: 1.0
......@@ -79,6 +83,7 @@ game:
defense-area-width: 2.0
penalty-kick-dist-to-goal: 6.0
goal-width: 1.0
center-circle-radius: 0.5
placement-offset-touch-line: 0.2
placement-offset-goal-line: 0.2
placement-offset-goal-line-goal-kick: 1.0
......
/*
* Copyright (c) 2009 - 2020, DHBW Mannheim - TIGERs Mannheim
* Copyright (c) 2009 - 2022, DHBW Mannheim - TIGERs Mannheim
*/
package edu.tigers.autoreferee.engine.detector;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import com.github.g3force.configurable.Configurable;
import edu.tigers.autoreferee.AutoRefUtil;
import edu.tigers.autoreferee.generic.BotPosition;
import edu.tigers.sumatra.geometry.Geometry;
......@@ -25,6 +18,10 @@ import edu.tigers.sumatra.referee.gameevent.AttackerTouchedBallInDefenseArea;
import edu.tigers.sumatra.referee.gameevent.DefenderInDefenseArea;
import edu.tigers.sumatra.referee.gameevent.IGameEvent;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
/**
* This rule detects attackers/defenders that touch the ball while inside the defense area of the defending/their own
......@@ -120,14 +117,6 @@ public class BotInDefenseAreaDetector extends AGameEventDetector
}
}
Set<BotID> keepers = new HashSet<>();
keepers.add(frame.getRefereeMsg().getKeeperBotID(ETeamColor.BLUE));
keepers.add(frame.getRefereeMsg().getKeeperBotID(ETeamColor.YELLOW));
if (keepers.contains(curKicker.getBotID()))
{
return Optional.empty();
}
return checkPenaltyAreas(curKicker);
}
......@@ -151,10 +140,10 @@ public class BotInDefenseAreaDetector extends AGameEventDetector
.distanceToNearestPointOutside(curKicker.getPos());
return Optional.of(new AttackerTouchedBallInDefenseArea(curKickerId, curKicker.getPos(), distance));
} else if (defenderIsPushed(curKickerId, curKicker.getPos()))
{
return Optional.empty();
} else if (ownPenArea.isPointInShape(curKicker.getPos(), -Geometry.getBotRadius()))
}
if (curKickerId != frame.getRefereeMsg().getKeeperBotID(curKickerColor)
&& !defenderIsPushed(curKickerId, curKicker.getPos())
&& ownPenArea.isPointInShape(curKicker.getPos(), -Geometry.getBotRadius()))
{
/*
* Multiple Defender:
......
......@@ -40,5 +40,5 @@ dependencies {
api 'com.google.protobuf:protobuf-java:3.19.4'
implementation 'com.sleepycat:je:18.3.12'
runtimeOnly "com.github.TIGERs-Mannheim:ssl-game-controller-maven:2.15.2.0:${osClassifier}"
runtimeOnly "com.github.TIGERs-Mannheim:ssl-game-controller-maven:2.15.4.0:${osClassifier}"
}
......@@ -31,7 +31,7 @@ public class RulerMouseAdapter extends MouseAdapter
@Override
public void mouseDragged(final MouseEvent e)
{
if (SwingUtilities.isLeftMouseButton(e) && (e.isControlDown() || e.isAltDown()))
if (SwingUtilities.isLeftMouseButton(e) && (e.isControlDown() || e.isAltDown()) && dragPointStart != null)
{
IVector2 guiPos = fieldPanel.getFieldPos(e.getX(), e.getY());
IVector2 dragPointEnd = fieldPanel.transformToGlobalCoordinates(guiPos);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment