Skip to content

Commit

Permalink
3rd place. Fuck YEAHHH! BYE
Browse files Browse the repository at this point in the history
  • Loading branch information
emrazil committed Apr 4, 2014
1 parent 1faa02c commit d82a2c6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
Binary file modified trunk/PC/PCControl/settings
Binary file not shown.
11 changes: 6 additions & 5 deletions trunk/PC/PCControl/src/sdp/pc/robot/pilot/Robot.java
Expand Up @@ -251,7 +251,7 @@ public void closeConnection() {
* coordinate by going forwards or backwards.
*/
public void defendBall() throws Exception {
if (assertPerpendicular(3 * SAFE_ANGLE_EPSILON)) {
if (assertPerpendicular(2 * SAFE_ANGLE_EPSILON)) {

// Get predicted ball stop point
// TODO: Needs test
Expand Down Expand Up @@ -320,7 +320,7 @@ public void defendWeightedGoalLine(double weight) throws Exception {
*/
public void defendRobot(int team, int robot) throws Exception {

if (assertPerpendicular(3 * SAFE_ANGLE_EPSILON)) {
if (assertPerpendicular(2 * SAFE_ANGLE_EPSILON)) {
// Get my location
Point2 robotPos = state.getRobotPosition(myTeam, myIdentifier);

Expand All @@ -336,7 +336,7 @@ public void defendRobot(int team, int robot) throws Exception {

// If that position exists, defend it, otherwise just defend the
// ball
if (!predictedBallPos.equals(Point2.EMPTY)) {
if (!predictedBallPos.equals(Point2.EMPTY) && FutureBall.pitchContains(predictedBallPos)) {
if (defendToY(predictedBallPos.getY(), DEFEND_EPSILON_DISTANCE)) {
driver.stop();
}
Expand Down Expand Up @@ -618,7 +618,7 @@ public void kickBallToPoint(Point2 where, boolean justGrab)
// If close to ball, grab
if (goTo(
// Main pitch - 20.0; Side pitch - 18.0
ball.offset(18.0, ball.angleTo(pos)), 10.0)) {
ball.offset(20.0, ball.angleTo(pos)), 10.0)) {

driver.stop();
driver.grab();
Expand All @@ -632,7 +632,7 @@ public void kickBallToPoint(Point2 where, boolean justGrab)
if (kickSubState < 0)
kickSubState = 0;
// Main pitch - 22.0; Side pitch - 20.0
if (goTo(ball.offset(20.0, ball.angleTo(pos)), 10.0)) {
if (goTo(ball.offset(22.0, ball.angleTo(pos)), 10.0)) {
driver.stop();
driver.grab();
kickSubState = 1;
Expand Down Expand Up @@ -1230,6 +1230,7 @@ private boolean defendToY(int y, double eps) throws Exception {
}
}


Point2 botPosition = state.getRobotPosition(myTeam, myIdentifier);
double botFacing = state.getRobotFacing(myTeam, myIdentifier);
if (botPosition.y - y > DEFEND_EPSILON_DISTANCE) {
Expand Down
4 changes: 2 additions & 2 deletions trunk/PC/PCControl/src/sdp/pc/robot/pilot/StrategyThread.java
Expand Up @@ -93,8 +93,8 @@ private void updateStates() throws Exception {
int quad = state.getBallQuadrant();
boolean aQ, dQ = false;
if (attacker.getState() == Robot.State.RESET) {
aQ = attacker.nearBoundary(HULL_OFFSET+10);
dQ = defender.nearBoundary(HULL_OFFSET+10);
aQ = attacker.nearBoundary(HULL_OFFSET+15);
dQ = defender.nearBoundary(HULL_OFFSET+15);
} else {
aQ = attacker.nearBoundary(HULL_OFFSET);
dQ = defender.nearBoundary(HULL_OFFSET);
Expand Down
4 changes: 2 additions & 2 deletions trunk/PC/PCControl/src/sdp/pc/vision/WorldStateUpdater.java
Expand Up @@ -427,7 +427,7 @@ private void processPixel(Point2 p, BufferedImage img, Color[][] cRgbs,
cHsb = cHsbs[p.x][p.y];

Color.RGBtoHSB(cRgb.getRed(), cRgb.getGreen(), cRgb.getBlue(), cHsb);
/*


// scale HSB
float br = cHsb[2];
Expand All @@ -442,7 +442,7 @@ private void processPixel(Point2 p, BufferedImage img, Color[][] cRgbs,
// save RGB
cRgb = new Color(Color.HSBtoRGB(cHsb[0], cHsb[1],
cHsb[2]));
*/

cRgbs[p.x][p.y] = cRgb;


Expand Down
Expand Up @@ -45,6 +45,13 @@ public void mouseWheelMoved(MouseWheelEvent e) {
public void mousePressed(MouseEvent e) {
Point2 p = getMousePosition();


if(e.getButton() == 2) {
System.out.printf("rightclick\n");
SettingsManager.defaultSettings.setFisheyeCenter(p);
return;
}

// If the system is waiting for a boundary set it
if (!SettingsManager.defaultSettings.hasBoundary()) {
SettingsManager.defaultSettings.addBoundary(p);
Expand All @@ -71,7 +78,7 @@ public void mousePressed(MouseEvent e) {
min[1] = cRgb.getGreen();
min[2] = cRgb.getBlue();
}
else {
else if (cRgb != null) {
min[0] = Math.max(0, cRgb.getRed() - 10);
min[1] = Math.max(0, cRgb.getGreen() - 10);
min[2] = Math.max(0, cRgb.getBlue() - 10);
Expand Down

0 comments on commit d82a2c6

Please sign in to comment.