Package frc.robot.hardware
Class RobotHardware
- java.lang.Object
-
- frc.robot.hardware.RobotHardware
-
public class RobotHardware extends java.lang.ObjectUse this class to control all motors and sensors
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classRobotHardware.GyroclassRobotHardware.MecanumDrivetrainclassRobotHardware.PWMSparkclassRobotHardware.SparkMaxclassRobotHardware.SparkPairclassRobotHardware.SPX
-
Field Summary
Fields Modifier and Type Field Description edu.wpi.first.wpilibj.BuiltInAccelerometerAccelBuilt-in accelerometerRobotHardware.SparkPaircannonSpark CannonRobotHardware.MecanumDrivetraindrivetrainuse this for the provided mecanum driveRobotHardware.SparkMaxfrontLeftFront Left brushless motor (ID: 1)RobotHardware.SparkMaxfrontRightFront Right brushless motor (ID: 3)com.kauailabs.navx.frc.AHRSgyroI^2C GyroRobotHardware.PWMSparkintakeSpark IntakeLimelightlimelightLimelight ControllerRobotHardware.SparkMax[]MotorsRepresents all the drive motorsPneumaticspcmPneumatic Control Moduleedu.wpi.first.wpilibj.PowerDistributionpdpPower Distribution Panel (ID: 5)RobotHardware.SparkMaxrearLeftRear Left brushless motor (ID: 2)RobotHardware.SparkMaxrearRightRear Right brushless motor (ID: 4)RobotHardware.SparkPairshootersSpark Shootersstatic doubletargetVoltageBattery Running Voltage
-
Constructor Summary
Constructors Constructor Description RobotHardware(double period)Use this class to control all motors and sensors See below for changes
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleclip(double value, double min, double max)Clips the value to fit inbetween the minimum and maximum valuesdoublesetSafeCalcuater(double speed, double currentSpeed)Calculates out what your motor speed should be
-
-
-
Field Detail
-
frontLeft
public RobotHardware.SparkMax frontLeft
Front Left brushless motor (ID: 1)
-
rearLeft
public RobotHardware.SparkMax rearLeft
Rear Left brushless motor (ID: 2)
-
frontRight
public RobotHardware.SparkMax frontRight
Front Right brushless motor (ID: 3)
-
rearRight
public RobotHardware.SparkMax rearRight
Rear Right brushless motor (ID: 4)
-
Motors
public RobotHardware.SparkMax[] Motors
Represents all the drive motors
-
drivetrain
public RobotHardware.MecanumDrivetrain drivetrain
use this for the provided mecanum drive
-
shooters
public RobotHardware.SparkPair shooters
Spark Shooters
-
cannon
public RobotHardware.SparkPair cannon
Spark Cannon
-
intake
public RobotHardware.PWMSpark intake
Spark Intake
-
gyro
public com.kauailabs.navx.frc.AHRS gyro
I^2C Gyro
-
Accel
public edu.wpi.first.wpilibj.BuiltInAccelerometer Accel
Built-in accelerometer
-
pdp
public edu.wpi.first.wpilibj.PowerDistribution pdp
Power Distribution Panel (ID: 5)
-
targetVoltage
public static double targetVoltage
Battery Running Voltage
-
pcm
public Pneumatics pcm
Pneumatic Control Module
-
limelight
public Limelight limelight
Limelight Controller
-
-
Method Detail
-
setSafeCalcuater
public double setSafeCalcuater(double speed, double currentSpeed)Calculates out what your motor speed should be- Parameters:
speed- the target speedcurrentSpeed- the current speed- Returns:
- then new speed
-
clip
public double clip(double value, double min, double max)Clips the value to fit inbetween the minimum and maximum values- Parameters:
value- the value to clipmin- the minimum valuemax- the maximum value- Returns:
- the cliped value
-
-