Skip to content

Commit

Permalink
Post-competition commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cocolocomoco21 committed Jun 2, 2017
1 parent c9fab71 commit 8477cd1
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions AI-ROCKS/AI-ROCKS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,13 @@ static void Main(string[] args)
executeTimer.Elapsed += autonomousService.Execute;
executeTimer.Enabled = true;

/*
// Create timer for ObstacleEvent, tied in to autonomousService.DetectObstacleEvent()
Timer obstacleTimer = new Timer(OBSTACLE_INTERVAL_MILLIS);
obstacleTimer.AutoReset = true;
obstacleTimer.Elapsed += autonomousService.DetectObstacleEvent;
obstacleTimer.Enabled = true;
*/

// Execute while not receive an ACK from base station and DriveContext is not complete
while (!autonomousService.IsComplete())
Expand Down
1 change: 0 additions & 1 deletion AI-ROCKS/Drive/DriveStates/GPSDriveState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ public StateType GetNextStateType()
return StateType.VisionState;
}


return StateType.GPSState;
}

Expand Down
6 changes: 4 additions & 2 deletions AI-ROCKS/Drive/DriveStates/VisionDriveState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ private DriveCommand DriveNoBallDetected(TennisBall ball)

break;
}
/*
case 2:
{
// Broaden HSV values, scan
Expand All @@ -366,7 +367,8 @@ private DriveCommand DriveNoBallDetected(TennisBall ball)
break;
}
case 3:
*/
case 2:
{
// Align toward heading (again), drive for 5ish seconds,
StatusHandler.SendDebugAIPacket(Status.AIS_BEGIN_SCAN, "Scan: 2nd 5m scan toward heading. Distance: " + Math.Round(distanceToGate, 2));
Expand All @@ -376,7 +378,7 @@ private DriveCommand DriveNoBallDetected(TennisBall ball)

break;
}
case 4:
case 3:
{
// We've already run 1 scan, 1 5m scan, 1 broaden HSV, 1 more 5m scan, so drive straight to kick back to GPS and do it over again
return DriveCommand.Straight(Speed.VISION);
Expand Down
2 changes: 1 addition & 1 deletion AI-ROCKS/Drive/Models/Camera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Camera
const int FRAME_RATE = 15;

// Circle detection
const int MIN_RADIUS = 5;
const int MIN_RADIUS = 2;

// Gaussian blur
const int GAUSSIAN_KERNELSIZE = 15;
Expand Down
6 changes: 3 additions & 3 deletions AI-ROCKS/Drive/Utils/Speed.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ namespace AI_ROCKS.Drive.Utils
public static class Speed
{
public const byte NORMAL_OPERATION = 50;
public const byte SLOW_OPERATION = 33;
public const byte SLOW_OPERATION = 53;
public const byte CLEAR_OBSTACLE = 40;
public const byte AVOID_OBSTACLE = 30;
public const byte SLOW_TURN = 35;
public const byte VISION = 33;
public const byte SLOW_TURN = 45;
public const byte VISION = 43;
public const byte VISION_SCAN = 30;
public const byte HALT = 0;
}
Expand Down

0 comments on commit 8477cd1

Please sign in to comment.