-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from ThePinkAlliance/develop
- Loading branch information
Showing
5 changed files
with
147 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97 changes: 96 additions & 1 deletion
97
src/main/java/com/ThePinkAlliance/core/limelight/LimelightConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,98 @@ | ||
package com.ThePinkAlliance.core.limelight; | ||
|
||
public class LimelightConstants {} | ||
import com.ThePinkAlliance.core.limelight.Limelight.GAME_TARGET_HEIGHTS; | ||
|
||
/** | ||
* This store's information about the limelight and it's target. | ||
*/ | ||
public class LimelightConstants { | ||
private double HEIGHT_FROM_FLOOR; | ||
private double MOUNTED_ANGLE; | ||
private double REFLECTED_TAPE_HEIGHT; | ||
private double HORIZONTAL_OFFSET; | ||
|
||
/** | ||
* @param HEIGHT_FROM_FLOOR The limelight lens height from the floor in | ||
* inches. | ||
* @param MOUNTED_ANGLE The current pitch angle of the limelight on its | ||
* mount. | ||
* @param REFLECTED_TAPE_HEIGHT The height of the reflective tape we are | ||
* tracking. | ||
*/ | ||
public LimelightConstants(double HEIGHT_FROM_FLOOR, double MOUNTED_ANGLE, double REFLECTED_TAPE_HEIGHT) { | ||
this.HEIGHT_FROM_FLOOR = HEIGHT_FROM_FLOOR; | ||
this.MOUNTED_ANGLE = MOUNTED_ANGLE; | ||
this.REFLECTED_TAPE_HEIGHT = REFLECTED_TAPE_HEIGHT; | ||
this.HORIZONTAL_OFFSET = 0; | ||
} | ||
|
||
/** | ||
* @param HEIGHT_FROM_FLOOR The limelight lens height from the floor in | ||
* inches. | ||
* @param MOUNTED_ANGLE The current pitch angle of the limelight on its | ||
* mount. | ||
* @param REFLECTED_TAPE_HEIGHT The height of the reflective tape we are | ||
* tracking. | ||
* @param HORIZONTAL_OFFSET The angluar offset of the limelight from the | ||
* center | ||
* of the robot. | ||
*/ | ||
public LimelightConstants(double HEIGHT_FROM_FLOOR, double MOUNTED_ANGLE, double REFLECTED_TAPE_HEIGHT, | ||
double HORIZONTAL_OFFSET) { | ||
this.HEIGHT_FROM_FLOOR = HEIGHT_FROM_FLOOR; | ||
this.MOUNTED_ANGLE = MOUNTED_ANGLE; | ||
this.HORIZONTAL_OFFSET = HORIZONTAL_OFFSET; | ||
this.REFLECTED_TAPE_HEIGHT = REFLECTED_TAPE_HEIGHT; | ||
} | ||
|
||
/** | ||
* @param HEIGHT_FROM_FLOOR The limelight lens height from the floor in | ||
* inches. | ||
* @param MOUNTED_ANGLE The current pitch angle of the limelight on its | ||
* mount. | ||
* @param TARGET The reflective tape target we are | ||
* tracking. | ||
*/ | ||
public LimelightConstants(double HEIGHT_FROM_FLOOR, double MOUNTED_ANGLE, GAME_TARGET_HEIGHTS TARGET) { | ||
this.HEIGHT_FROM_FLOOR = HEIGHT_FROM_FLOOR; | ||
this.MOUNTED_ANGLE = MOUNTED_ANGLE; | ||
this.HORIZONTAL_OFFSET = 0; | ||
this.REFLECTED_TAPE_HEIGHT = TARGET.get(); | ||
} | ||
|
||
/** | ||
* @param HEIGHT_FROM_FLOOR The limelight lens height from the floor in | ||
* inches. | ||
* @param MOUNTED_ANGLE The current pitch angle of the limelight on its | ||
* mount. | ||
* @param TARGET The reflective tape target we are | ||
* tracking. | ||
* @param HORIZONTAL_OFFSET The angluar offset of the | ||
* limelight from the | ||
* center | ||
* of the robot. | ||
*/ | ||
public LimelightConstants(double HEIGHT_FROM_FLOOR, double MOUNTED_ANGLE, GAME_TARGET_HEIGHTS TARGET, | ||
double HORIZONTAL_OFFSET) { | ||
this.HEIGHT_FROM_FLOOR = HEIGHT_FROM_FLOOR; | ||
this.MOUNTED_ANGLE = MOUNTED_ANGLE; | ||
this.HORIZONTAL_OFFSET = HORIZONTAL_OFFSET; | ||
this.REFLECTED_TAPE_HEIGHT = TARGET.get(); | ||
} | ||
|
||
public double getHeightFromFloor() { | ||
return this.HEIGHT_FROM_FLOOR; | ||
} | ||
|
||
public double getMountedAngle() { | ||
return this.MOUNTED_ANGLE; | ||
} | ||
|
||
public double getTargetHeight() { | ||
return this.REFLECTED_TAPE_HEIGHT; | ||
} | ||
|
||
public double getHorizontalOffset() { | ||
return this.HORIZONTAL_OFFSET; | ||
} | ||
} |