Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 5 additions & 0 deletions src/main/java/frc/robot/OI.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
public class OI {
public Joystick driverController = new Joystick(RobotMap.OI_DRIVER_CONTROLLER);
public Button hatchExtendButton = new Button(driverController, 5);
//// CREATING BUTTONS
// One type of button is a joystick button which is any button on a
//// joystick.
Expand Down Expand Up @@ -42,4 +43,8 @@ public class OI {
// Start the command when the button is released and let it run the command
// until it is finished as determined by it's isFinished method.
// button.whenReleased(new ExampleCommand());

public OI() {
hatchExtendButton.whenPressed(new RetractHatch());
}
}
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import frc.robot.commands.ExampleCommand;
import frc.robot.subsystems.Drivetrain;
import frc.robot.subsystems.ExampleSubsystem;
import frc.robot.subsystems.HatchSubsystem;

/**
* The VM is configured to automatically run this class, and to call the
Expand All @@ -27,6 +28,7 @@ public class Robot extends TimedRobot {
public static ExampleSubsystem m_subsystem = new ExampleSubsystem();
public static OI m_oi;
public static Drivetrain m_drivetrain = new Drivetrain();
public static HatchSubsystem m_hHatchSubsystem = new HatchSubsystem();

Command m_autonomousCommand;
SendableChooser<Command> m_chooser = new SendableChooser<>();
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/frc/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ public class RobotMap {

public static final int LEFT_TALON_PORT = 0;
public static final int RIGHT_TALON_PORT = 1;

public static final int OI_DRIVER_CONTROLLER = 0;

public static final int HATCH_SOLENOID_PORT1 = 0;
public static final int HATCH_SOLENOID_PORT2 = 1;

}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/DriveArcade.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public DriveArcade() {
@Override
protected void initialize() {

}
}

// Called repeatedly when this Command is scheduled to run
@Override
Expand Down
45 changes: 45 additions & 0 deletions src/main/java/frc/robot/commands/ExtendHatch.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/

package frc.robot.commands;

import edu.wpi.first.wpilibj.command.Command;

public class ExtendHatch extends Command {
public ExtendHatch() {
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}

// Called just before this Command runs the first time
@Override
protected void initialize() {
}

// Called repeatedly when this Command is scheduled to run
@Override
protected void execute() {
}

// Make this return true when this Command no longer needs to run execute()
@Override
protected boolean isFinished() {
return false;
}

// Called once after isFinished returns true
@Override
protected void end() {
}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
@Override
protected void interrupted() {
end();
}
}
30 changes: 30 additions & 0 deletions src/main/java/frc/robot/commands/RetractHatch.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/

package frc.robot.commands;

import edu.wpi.first.wpilibj.command.InstantCommand;

/**
* Add your docs here.
*/
public class RetractHatch extends InstantCommand {
/**
* Add your docs here.
*/
public RetractHatch() {
super();
// Use requires() here to declare subsystem dependencies
// eg. requires(chassis);
}

// Called once when the command executes
@Override
protected void initialize() {
}

}
5 changes: 4 additions & 1 deletion src/main/java/frc/robot/subsystems/Drivetrain.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
import frc.robot.RobotMap;
import frc.robot.commands.DriveArcade;

/**
* Add your docs here.
Expand All @@ -25,7 +26,7 @@ public class Drivetrain extends Subsystem {
@Override
public void initDefaultCommand() {
// Set the default command for a subsystem here.
// setDefaultCommand(new MySpecialCommand());
setDefaultCommand(new DriveArcade());
}

public Drivetrain() {
Expand All @@ -37,5 +38,7 @@ public Drivetrain() {

public void drive(double moveSpeed, double rotateSpeed) {
diffDrive.arcadeDrive(moveSpeed, rotateSpeed);
//diffDrive.tankDrive(leftSpeed, rightSpeed);
//diffDrive.curvatureDrive(moveSpeed, rotateSpeed, quickTurn);
}
}
47 changes: 40 additions & 7 deletions src/main/java/frc/robot/subsystems/HatchSubsystem.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,40 @@
public class HatchSubsystem {
public HatchSubsystem() {
//
//
//
}
}
/*----------------------------------------------------------------------------*/
/* Copyright (c) 2018 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/

package frc.robot.subsystems;

import edu.wpi.first.wpilibj.DoubleSolenoid;
import edu.wpi.first.wpilibj.command.Subsystem;
import frc.robot.RobotMap;

/**
* Add your docs here.
*/
public class HatchSubsystem extends Subsystem {
// Put methods for controlling this subsystem
// here. Call these from Commands.

DoubleSolenoid hatchSolenoid = new DoubleSolenoid(RobotMap.HATCH_SOLENOID_PORT1, RobotMap.HATCH_SOLENOID_PORT2);

@Override
public void initDefaultCommand() {
// Set the default command for a subsystem here.
// setDefaultCommand(new MySpecialCommand());
}

public void extendHatch() {
hatchSolenoid.set(DoubleSolenoid.Value.kForward);
}

public void retractHatch() {
hatchSolenoid.set(DoubleSolenoid.Value.kReverse);
}

public void turnOffHatch() {
hatchSolenoid.set(DoubleSolenoid.Value.kOff);
}
}
135 changes: 135 additions & 0 deletions vendordeps/Phoenix.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"fileName": "Phoenix.json",
"name": "CTRE-Phoenix",
"version": "5.14.1",
"uuid": "ab676553-b602-441f-a38d-f1296eff6537",
"mavenUrls": [
"http://devsite.ctr-electronics.com/maven/release/"
],
"jsonUrl": "http://devsite.ctr-electronics.com/maven/release/com/ctre/phoenix/Phoenix-latest.json",
"javaDependencies": [
{
"groupId": "com.ctre.phoenix",
"artifactId": "api-java",
"version": "5.14.1"
},
{
"groupId": "com.ctre.phoenix",
"artifactId": "wpiapi-java",
"version": "5.14.1"
}
],
"jniDependencies": [
{
"groupId": "com.ctre.phoenix",
"artifactId": "cci",
"version": "5.14.1",
"isJar": false,
"skipInvalidPlatforms": true,
"validPlatforms": [
"linuxathena",
"windowsx86-64",
"linuxx86-64"
]
},
{
"groupId": "com.ctre.phoenix",
"artifactId": "canutils",
"version": "5.14.1",
"isJar": false,
"skipInvalidPlatforms": true,
"validPlatforms": [
"windowsx86-64",
"linuxx86-64"
]
},
{
"groupId": "com.ctre.phoenix",
"artifactId": "platform-stub",
"version": "5.14.1",
"isJar": false,
"skipInvalidPlatforms": true,
"validPlatforms": [
"windowsx86-64",
"linuxx86-64"
]
}
],
"cppDependencies": [
{
"groupId": "com.ctre.phoenix",
"artifactId": "wpiapi-cpp",
"version": "5.14.1",
"libName": "CTRE_Phoenix_WPI",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"linuxathena",
"windowsx86-64",
"linuxx86-64"
]
},
{
"groupId": "com.ctre.phoenix",
"artifactId": "api-cpp",
"version": "5.14.1",
"libName": "CTRE_Phoenix",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"linuxathena",
"windowsx86-64",
"linuxx86-64"
]
},
{
"groupId": "com.ctre.phoenix",
"artifactId": "cci",
"version": "5.14.1",
"libName": "CTRE_PhoenixCCI",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"linuxathena",
"windowsx86-64",
"linuxx86-64"
]
},
{
"groupId": "com.ctre.phoenix",
"artifactId": "canutils",
"version": "5.14.1",
"libName": "CTRE_PhoenixCanutils",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"windowsx86-64",
"linuxx86-64"
]
},
{
"groupId": "com.ctre.phoenix",
"artifactId": "platform-stub",
"version": "5.14.1",
"libName": "CTRE_PhoenixPlatform",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"windowsx86-64",
"linuxx86-64"
]
},
{
"groupId": "com.ctre.phoenix",
"artifactId": "core",
"version": "5.14.1",
"libName": "CTRE_PhoenixCore",
"headerClassifier": "headers"
}
]
}
55 changes: 55 additions & 0 deletions vendordeps/REVRobotics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"fileName": "REVRobotics.json",
"name": "REVRobotics",
"version": "1.1.9",
"uuid": "3f48eb8c-50fe-43a6-9cb7-44c86353c4cb",
"mavenUrls": [
"http://www.revrobotics.com/content/sw/max/sdk/maven/"
],
"jsonUrl": "http://www.revrobotics.com/content/sw/max/sdk/REVRobotics.json",
"javaDependencies": [
{
"groupId": "com.revrobotics.frc",
"artifactId": "SparkMax-java",
"version": "1.1.9"
}
],
"jniDependencies": [
{
"groupId": "com.revrobotics.frc",
"artifactId": "SparkMax-driver",
"version": "1.1.9",
"skipInvalidPlatforms": true,
"isJar": false,
"validPlatforms": [
"linuxathena"
]
}
],
"cppDependencies": [
{
"groupId": "com.revrobotics.frc",
"artifactId": "SparkMax-cpp",
"version": "1.1.9",
"libName": "libSparkMax",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"linuxathena"
]
},
{
"groupId": "com.revrobotics.frc",
"artifactId": "SparkMax-driver",
"version": "1.1.9",
"libName": "libSparkMaxDriver",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"linuxathena"
]
}
]
}