Implement new RobotContainer.java and Constants.java Classes

- OI.java has been deprecated and replaced with RobotContainer.java
- RobotMap.java has been deprecated and replaced with Constants.java
- Changes have been made to use the new classes without errors; some of these changes will be changed in the future
This commit is contained in:
Keenan D. Buckley
2020-01-05 17:35:52 -07:00
parent ec2412a31e
commit 6fb373969d
13 changed files with 134 additions and 112 deletions
@@ -0,0 +1,70 @@
/*----------------------------------------------------------------------------*/
/* 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 frc4388.robot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.command.Command;
import edu.wpi.first.wpilibj.command.InstantCommand;
import frc4388.robot.Constants.*;
import frc4388.robot.subsystems.Drive;
import frc4388.robot.subsystems.LED;
import frc4388.utility.controller.IHandController;
import frc4388.utility.controller.XboxController;
/**
* 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 {
/* Subsystems */
public static final Drive m_robotDrive = new Drive();
public static final LED m_robotLED = new LED();
/* Controllers */
XboxController m_driverXbox = new XboxController(OIConstants.XBOX_DRIVER_ID);
XboxController m_operatorXbox = new XboxController(OIConstants.XBOX_OPERATOR_ID);
/**
* The container for the robot. Contains subsystems, OI devices, and commands.
*/
public RobotContainer() {
}
/**
* Use this to pass the autonomous command to the main {@link Robot} class.
*
* @return the command to run in autonomous
*/
public Command getAutonomousCommand() {
// no auto
return new InstantCommand();
}
public IHandController getDriverController() {
return m_driverXbox;
}
public IHandController getOperatorController()
{
return m_operatorXbox;
}
public Joystick getOperatorJoystick()
{
return m_operatorXbox.getJoyStick();
}
public Joystick getDriverJoystick()
{
return m_driverXbox.getJoyStick();
}
}