Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
8d8aeed
Merge pull request #2 from Team708/Sue_Branch_Robot
sueperg Jan 30, 2017
2b827a6
added rs232
jpiergal Jan 31, 2017
246d196
added intake
jpiergal Jan 31, 2017
bdd5c7b
rs232
jpiergal Jan 31, 2017
47b6f6b
rs232 testing
jpiergal Jan 31, 2017
d3f977d
rs232 and trigger mods
jpiergal Feb 4, 2017
2fb19af
removed rs232 bug
jpiergal Feb 4, 2017
284b197
intake gear
jpiergal Feb 4, 2017
bd8de88
added new gear up and down
jpiergal Feb 4, 2017
5df990b
added pivit motor
jpiergal Feb 4, 2017
bced209
pivot workingf
jpiergal Feb 5, 2017
d181802
rs232 working
jpiergal Feb 5, 2017
69d6894
Intake and Pivot on IR sensor
jpiergal Feb 11, 2017
6685d45
hood added
jpiergal Feb 11, 2017
bb61810
added shooter and feeder
jpiergal Feb 11, 2017
987bb20
added loader back in
jpiergal Feb 12, 2017
256ee4a
added loader and hood adjustments
jpiergal Feb 13, 2017
398d3e9
cleaned up baseline before vision merge
jpiergal Feb 15, 2017
6b480b3
after vision merge
jpiergal Feb 15, 2017
cf12fe3
added feeder buttons
jpiergal Feb 16, 2017
e7ee33e
mod
jpiergal Feb 16, 2017
b72dbc1
Updates to Vision
Feb 17, 2017
d512bfd
merge shooter code
jpiergal Feb 17, 2017
bcd5ec4
Merge remote-tracking branch 'origin/master'
jpiergal Feb 17, 2017
8b3d5cd
reverse sensor
jpiergal Feb 17, 2017
b30654c
gyro is back
jpiergal Feb 18, 2017
294e7de
gyro update
jpiergal Feb 18, 2017
d39270b
gryo back in PID
jpiergal Feb 18, 2017
2183982
After initial integration testing
jpiergal Feb 20, 2017
a71a859
merged after testing
jpiergal Feb 21, 2017
80c7d68
after practice driving
jpiergal Feb 21, 2017
f0710a1
after bag
jpiergal Feb 22, 2017
7a18d17
code clean up before vision merge
jpiergal Feb 22, 2017
1ea6ca0
after vision merge
jpiergal Feb 23, 2017
2619160
autos merged
jpiergal Feb 24, 2017
d58f4ee
added autos
jpiergal Feb 27, 2017
47f1c4e
after shooter tuning
jpiergal Feb 28, 2017
4d3e744
debugging
jpiergal Mar 1, 2017
06ad08e
turn to alliance update
jpiergal Mar 1, 2017
7d9a3e2
tunning vision
jpiergal Mar 2, 2017
4494caf
auto guesses before testing
jpiergal Mar 2, 2017
8d848c3
minor mod to drive to gear
jpiergal Mar 3, 2017
8dcc6a3
new 3 gear
jpiergal Mar 4, 2017
7635922
added leds
jpiergal Mar 4, 2017
39053ff
added manual led commands
jpiergal Mar 4, 2017
9165837
trying to fix LEDS
jpiergal Mar 4, 2017
7a91bfa
revert
jpiergal Mar 4, 2017
6f014ee
Revert "new 3 gear"
jpiergal Mar 4, 2017
873f322
Leds fixes
jpiergal Mar 4, 2017
372438f
More Led Fixes
jpiergal Mar 4, 2017
236f524
after week one day2
jpiergal Mar 5, 2017
b782117
after week1
jpiergal Mar 5, 2017
8aab075
auto rewrite
jpiergal Mar 10, 2017
8ba4239
after 1st bag
jpiergal Mar 13, 2017
445cec3
after testing boiler
jpiergal Mar 15, 2017
325515c
boiler
jpiergal Mar 15, 2017
c5fe94a
after bag window
jpiergal Mar 17, 2017
3782686
tuned auto for command group
jpiergal Mar 17, 2017
30a6ef3
added auto gear up
jpiergal Mar 17, 2017
d203f9f
after round 2
jpiergal Mar 22, 2017
59370b6
bag window
jpiergal Mar 22, 2017
467195e
End bag window 3/22
jpiergal Mar 23, 2017
9e5f6b2
after senaca
jpiergal Mar 27, 2017
2f9ffe6
added send and relesae gear
jpiergal Mar 30, 2017
0daf6d9
after day 1 MAR champs
jpiergal Apr 7, 2017
090d343
after champs day2 - no boiler vision
jpiergal Apr 8, 2017
bc10093
before worlds
jpiergal Apr 19, 2017
6394ad6
FIxed Drivetrain Errors
JamesMakovics Jan 11, 2018
d04265e
Revert "FIxed Drivetrain Errors"
JamesMakovics Jan 11, 2018
ec3b592
Changed DriveTrain imports
JamesMakovics Jan 13, 2018
a0868d8
Updated Talons and DriveTrain
JamesMakovics Jan 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .classpath
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
<classpathentry kind="var" path="opencv" sourcepath="opencv.sources"/>
<classpathentry kind="var" path="cscore" sourcepath="cscore.sources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="var" path="USERLIBS_DIR/CTRLib.jar"/>
<classpathentry kind="var" path="USERLIBS_DIR/niVisionWPI.jar"/>
<classpathentry kind="var" path="wpiutil" sourcepath="wpiutil.sources"/>
<classpathentry kind="var" path="USERLIBS_DIR/CTRE_Phoenix-sources.jar"/>
<classpathentry kind="var" path="USERLIBS_DIR/CTRE_Phoenix.jar" sourcepath="/CTRE_Pheonix.sources"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Binary file removed build/jars/CTRLib.jar
Binary file not shown.
Binary file removed build/jars/NetworkTables.jar
Binary file not shown.
Binary file removed build/jars/WPILib.jar
Binary file not shown.
Binary file removed build/jars/cscore.jar
Binary file not shown.
Binary file removed build/jars/niVisionWPI.jar
Binary file not shown.
Binary file removed build/jars/opencv.jar
Binary file not shown.
Binary file modified build/org/usfirst/frc/team708/robot/AutoConstants.class
Binary file not shown.
Binary file modified build/org/usfirst/frc/team708/robot/Constants.class
Binary file not shown.
Binary file modified build/org/usfirst/frc/team708/robot/OI.class
Binary file not shown.
Binary file modified build/org/usfirst/frc/team708/robot/Robot.class
Binary file not shown.
Binary file modified build/org/usfirst/frc/team708/robot/RobotMap.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/org/usfirst/frc/team708/robot/subsystems/Drivetrain.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/org/usfirst/frc/team708/robot/subsystems/Shooter.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified build/org/usfirst/frc/team708/robot/util/Gamepad.class
Binary file not shown.
Binary file modified build/org/usfirst/frc/team708/robot/util/HatterDrive.class
Binary file not shown.
Binary file modified build/org/usfirst/frc/team708/robot/util/Math708.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed dist/FRCUserProgram.jar
Binary file not shown.
84 changes: 79 additions & 5 deletions src/org/usfirst/frc/team708/robot/AutoConstants.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,85 @@
package org.usfirst.frc.team708.robot;

public final class AutoConstants {


// Threshold Constants
public static final double DISTANCE_TARGET_THRESHOLD = 0; //5; // threshold for determining the distance to stop in front of the lift
public static final double X_THRESHOLD_CENTER = 10; //20; // threshold for determining center of the target
public static final double X_THRESHOLD_HAS_TARGET_MIN = 1; // threshold for determining min value for whether the robot sees the target
public static final double X_THRESHOLD_HAS_TARGET_MAX = 320; // threshold for determining max value for whether the robot sees the target
public static final double Y_HEIGHT_THRESHOLD = 5; // threshold for determining the stop location of height

// Sweep Constants
public static final int SWEEP1_MIN = 0;
public static final int SWEEP1_MAX = 100;
public static final int SWEEP2_MIN = 101;
public static final int SWEEP2_MAX = 200;
public static final int SWEEP3_MIN = 201;
public static final int SWEEP3_MAX = 300;
public static final int SWEEP_DIRECTION_LEFT = -1;
public static final int SWEEP_DIRECTION_RIGHT = 1;
public static final double SWEEP_ROTATE = .3;

public static final double Y_TARGET = 190;
public static final double Y_THRESHOLD = 5;
public static final double X_THRESHOLD = 20;
// Drivetrain Constants
public static final double DRIVE_ROTATE_MIN = .3;
public static final double DRIVE_ROTATE_MAX = .5;
public static final double DRIVE_MOVE_MIN = .3;
public static final double DRIVE_MOVE_MAX = .5;

// Lift Constants (Field)
public static final int LIFT_TARGET_HEIGHT = 5;
public static final int LIFT_TARGET_WIDTH = 10;
public static final int DISTANCE_TO_LIFT_TARGET = 18; //was 18, Distance to stop at to place gear on lift peg


// Boiler Constants (Field)
public static final double X_THRESHOLD_CENTER_BOILER = 1.0;
public static final double BOILER_ROTATE_SPEED = .25;

public static final double DISTANCE_TO_GEAR = 60;
public static final double DISTANCE_TO_HOPPER = 140;
public static final int BOILER_TARGET_HEIGHT = 10;
public static final int BOILER_TARGET_WIDTH = 14;
public static final double DISTANCE_TO_BOILER_LOCATION1 = 54; // A distance to stop at and shoot for high goal in inches
public static final double DISTANCE_TO_BOILER_LOCATION2 = 108; // A distance to stop at and shoot for high goal in inches (9')

public static final double STOP_AT_BOILER_HEIGHT = 10; //60//100; // y value when the robot is about 108" from boiler

// Gear Constants (Game piece)
public static final double DISTANCE_TO_GEAR = 14;
public static final int GEAR_TARGET_HEIGHT = 4;
public static final int GEAR_TARGET_WIDTH = 10;


// Hopper Constants (Field)
public static final double DISTANCE_TO_HOPPER = 140;



// Axis Camera constants
public static final double AXIS_FOV_DEGREES = 43.5; // Field of View of the AXIS Camera
public static final int AXIS_IMG_WIDTH = 320; // width of the AXIS image - resolution
public static final int AXIS_IMG_HEIGHT = 240; // height of the AXIS image - resolution

// USB Camera Constants
public static final double USB_FOV_DEGREES = 75; // Field of View of the USB Camera
public static final int USB_IMG_WIDTH = 320; // width of the USB image - resolution
public static final int USB_IMG_HEIGHT = 240; // height of the USB image - resolution


// USB Lift Camera Constants
public static final double USB_LIFT_FOV_DEGREES = 43.5; // Field of View of the AXIS Camera
public static final int USB_LIFT_IMG_WIDTH = 320; // width of the USB image - resolution
public static final int USB_LIFT_IMG_HEIGHT = 240; // height of the USB image - resolution


// AXIS Camera Constants
public static final double USB_BOILER_FOV_DEGREES = 47.5; // Field of View of the AXIS Camera - from RoboRealm
public static final int USB_BOILER_IMG_WIDTH = 320; // width of the USB image - resolution
public static final int USB_BOILER_IMG_HEIGHT = 240; // height of the USB image - resolution

public static final String AXIS_IP_ADDRESS = "10.7.8.12"; // lift -practice - 10.7.8.2
public static final String AXIS_CAMERA_ID = "cam3"; // lift - practice - cam1 comp - 3
public static final String USB_CAMERA_ID = "cam0"; // boiler - practice - cam3 comp - 2
public static final int USB_VIDEO_PORT = 0; // boiler - practice - 0

}
129 changes: 101 additions & 28 deletions src/org/usfirst/frc/team708/robot/Constants.java
Original file line number Diff line number Diff line change
@@ -1,74 +1,147 @@
package org.usfirst.frc.team708.robot;


//GEAR Camera is 20.5" from the floor
//Boiler camera is 33.75" from the floor


public final class Constants {

/*
* Motor Controllers
*/
public static final double INTAKE_FORWARD = 1.0;
public static final double INTAKE_REVERSE = -1.0;
public static final double INTAKE_REVERSE = -1.0;
public static final double INTAKE_OFF = 0.0;

public static final double CLIMB_FORWARD = 1.0;
public static final double CLIMB_REVERSE = -1.0;
public static final double CLIMB_OFF = 0.0;

public static final double GEAR_UP = 0.4;
public static final double GEAR_DOWN = -0.4;
public static final double GEAR_OFF = 0.0;
public static final double GEAR_IN = 1.0;
public static final double GEAR_OUT = -1.0;


public static final int PIVOT_GEAR_ENCODER_COUNT = 1024;
public static final int PIVOT_GEAR_ENCODER_HIGH = 0; //20; //35;
public static final int PIVOT_GEAR_ENCODER_LOW = -35; //-19; // 5;


public static final double MOTOR_FORWARD = 1.0;
public static final double MOTOR_REVERSE = -1.0;
public static final double MOTOR_OFF = 0.0;

public static final double DRIVE_MOTOR_MAX_SPEED = 1.0;
public static final double ROTATE_MOTOR_MAX_SPEED = 1.0;

public static final double VISION_ROTATE_MOTOR_SPEED = 0.8;
public static final double VISION_ROTATE_MOTOR_SPEED = 0.8;

public static final double LOADER_MOTOR_FORWARD = 1.0;
public static final double LOADER_MOTOR_REVERSE = -1.0;
public static final double LOADER_OFF = 0.0;
public static final double FEEDER_MOTOR_FORWARD = 0.5; //1.0;
public static final double FEEDER_MOTOR_REVERSE = -0.5; //-1.0;
public static final double FEEDER_OFF = 0.0;

// public static final double LOADER_MOTOR_FORWARD = 1.0;
// public static final double LOADER_MOTOR_REVERSE = -1.0;
// public static final double LOADER_OFF = 0.0;
//
public static final double SHOOTER_MOTOR_FORWARD = 1.0;
public static final double SHOOTER_MOTOR_OFF = 0.0;
public static final double SHOOTER_MOTOR_BACKWARD = -1.0;
public static final double SHOOTER_MOTOR_SPEED_LOW = 5200;
public static final double SHOOTER_MOTOR_SPEED_HIGH = 5200;
public static final double SHOOTER_F_HIGH = .17126;
public static final double SHOOTER_F_LOW = .2398;

public static final int SHOOTER_MOTOR_SPEED_BOILER = 2050;
public static final int SHOOTER_MOTOR_SPEED_LEVER = 2700;

// public static final int SHOOTER_MOTOR_SPEED_MID = 2700;
public static final int SHOOTER_CLOSE_SHOT = 20; //encoder value for bumper


public static final double SHOOTER_PEAK_POS = 12.0;
public static final double SHOOTER_PEAK_NEG = -12.0;

public static final int HOOD_MIN = 30;
public static final int HOOD_MAX = 2050;
public static final int HOOD_BOILER = 400;
public static final int HOOD_MID = 300;
public static final int HOOD_LEVER = 30 ; //330;

public static final int SHOOTER_ENCODER_PULSES = 12;

public static final double SHOOTER_P = 40.0;//1.5;
public static final double SHOOTER_I = 0.0;//0.005;
public static final double SHOOTER_D = 0.0;//10.0;
public static final double SHOOTER_F = 2.3;
public static final int SHOOTER_IZONE = 00;
public static final double SHOOTER_RAMPRATE = 0.0;
public static final int SHOOTER_PROFILE = 0;

public static final int HOOD_CALIBRATION = 10;

public static final double AXIS_DEAD_ZONE = 0.3;

/*
* Smart Dashboard
*/
public static final double SEND_STATS_INTERVAL = .5; // Interval for reporting in seconds
public static final boolean DEBUG = true;

public static final double SEND_STATS_INTERVAL = .1; // Interval for reporting in seconds
public static final boolean DEBUG = true;
public static final boolean LIFT_DEBUG = true;
public static final boolean BOILER_DEBUG = true;
public static final boolean GEAR_DEBUG = false;
public static final boolean LIFT_CAMERA_OUTPUT_DEBUG = false;
public static final boolean BOILER_CAMERA_OUTPUT_DEBUG = false;

/*
* Sensors
*/
public static final double SONAR_CLOSE = 30.0;
public static final double SONAR_FAR = 80.0;
public static final double IR_HAS_GEAR_DISTANCE = 4.0;
public static final double ENCODER_BOTTOM_POSITION = 0.0;
public static final double GRAYHILL_ENCODER_PULSES_PER_REVOLUTION = 128.0;
public static final double SONAR_CLOSE = 30.0;
public static final double SONAR_FAR = 80.0;
public static final double IR_AT_LEVERDISTANCE = 4.0;
public static final double ENCODER_BOTTOM_POSITION = 0.0;

// public static final double GRAYHILL_ENCODER_PULSES_PER_REVOLUTION = 1024.0;


/*
* Drivetrain
*/
public static final double TANK_STICK_TOLERANCE = .30;
public static final double DRIVETRAIN_WHEEL_DIAMETER = 4.0;
public static final double DRIVETRAIN_ENCODER_PULSES_PER_REV = 128.0;
public static final double DRIVETRAIN_WHEEL_DIAMETER = 4.0;
public static final int DRIVETRAIN_ENCODER_PULSES_PER_REV = 5704; //encoder 1024 * gear ratio 5.57
public static final boolean DRIVE_USE_SQUARED_INPUT = false;
public static final boolean DRIVETRAIN_USE_LEFT_ENCODER = true; // variable to determine which side encoder is on
public static final double PEAK_POS = 4.0;
public static final double PEAK_NEG = -4.0;
public static final double NOMINAL_POS = 0.0;
public static final double NOMINAL_NEG = -0.0;


// PID Tuning parameters
public static final double Kp = 0.0; // Proportional gain
public static final double Ki = 0.0; // Integral gain
public static final double Kd = 0.0; // Derivative gain
public static final double pid_tolerance = 1;

// PID Tuning parameters
public static final double Kp = 0.0; // Proportional gain
public static final double Ki = 0.0; // Integral gain
public static final double Kd = 0.0; // Derivative gain

public static final double pid_tolerance = 1;
public static final int CLOCKWISE = 1;
public static final int COUNTERCLOCKWISE = -1;

// LED CONTROLS

public static final byte SET_ALLIANCE_INVALID = 0x00; // blinky white
public static final byte SET_ALLIANCE_RED = 0x01; // knight rider red
public static final byte SET_ALLIANCE_BLUE = 0x02; // knight rider blue
public static final byte SET_TARGETING = 0x03; // blinky red J
public static final byte SET_TARGET_FOUND = 0x04; // solid red
public static final byte SET_HAS_GEAR = 0x05; // solid green
public static final byte SET_HAS_GEAR_TARGETING = 0x06; // ???? blank?? blinky green
// public static final byte = 0x07;
// public static final byte = 0x08;
public static final byte SET_OFF = 0x09; // off
public static final byte MAX_LED_CODE = 0x10;

/*
* Vision Processor
*/
// public static final double ;
public static final int ALLIANCE_RED = 1;
public static final int ALLIANCE_BLUE = -1;

}
Loading