Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
FRC-Robot/RobotContainer.java /
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
59 lines (52 sloc)
2.4 KB
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
| /*----------------------------------------------------------------------------*/ | |
| /* Copyright (c) 2018-2019 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; | |
| import edu.wpi.first.wpilibj.GenericHID; | |
| import edu.wpi.first.wpilibj.XboxController; | |
| import frc.robot.commands.ExampleCommand; | |
| import frc.robot.subsystems.Drivesubsystem; | |
| import frc.robot.subsystems.ExampleSubsystem; | |
| import edu.wpi.first.wpilibj2.command.Command; | |
| import edu.wpi.first.wpilibj2.command.RunCommand; | |
| /** | |
| * This class is where the bulk of the robot should be declared. Since | |
| * Command-based is a "declarative" paradigm, very little robot logic should | |
| * actually be handled in the {@link Robot} periodic methods (other than the | |
| * scheduler calls). Instead, the structure of the robot (including subsystems, | |
| * commands, and button mappings) should be declared here. | |
| */ | |
| public class RobotContainer { | |
| private ExampleSubsystem m_exampleSubsystem; | |
| private final ExampleCommand m_autoCommand = new ExampleCommand(m_exampleSubsystem); | |
| public static Drivesubsystem DriveSub = new Drivesubsystem(); | |
| public static XboxController joy = new XboxController(0); | |
| /** | |
| * The container for the robot. Contains subsystems, OI devices, and commands. | |
| */ | |
| public RobotContainer() { | |
| DriveSub.setDefaultCommand(new RunCommand(() -> Drivesubsystem.TankDrive(joy.getRawAxis(1), joy.getRawAxis(5)), DriveSub)); | |
| // Configure the button bindings | |
| configureButtonBindings(); | |
| } | |
| /** | |
| * Use this method to define your button->command mappings. Buttons can be created by | |
| * instantiating a {@link GenericHID} or one of its subclasses ({@link | |
| * edu.wpi.first.wpilibj.Joystick} or {@link XboxController}), and then passing it to a | |
| * {@link edu.wpi.first.wpilibj2.command.button.JoystickButton}. | |
| */ | |
| private void configureButtonBindings() { | |
| } | |
| /** | |
| * Use this to pass the autonomous command to the main {@link Robot} class. | |
| * | |
| * @return the command to run in autonomous | |
| */ | |
| public Command getAutonomousCommand() { | |
| // An ExampleCommand will run in autonomous | |
| return (Command) m_autoCommand; | |
| } | |
| } |