UHSRobotics / FRC-2020

UHS Robotics, Team 7721's code for the 2020 season
GNU General Public License v3.0
0 stars 1 forks source link

Instructions for testing robot base and flywheel #4

Closed C0W0 closed 4 years ago

C0W0 commented 4 years ago

Instructions for the robot base (4x Falcon 500) Go to src/main/java/frc/robot/subsystems/TalonFXDriveSubsystem.java and assign the respective device numbers at declarations of the motors:

    private final TalonFX m_leftMotor = new TalonFX(<id 1>);

    private final TalonFX m_rightMotor = new TalonFX(<id 2>);

    private final TalonFX m_leftFollowMotor = new TalonFX(<id 3>);

    private final TalonFX m_rightFollowMotor = new TalonFX(<id 4>);

The names should be self-explanatory. Things that should be tested: Manual Drive: Go to src/main/java/frc/robot/subsystems/TalonFXDriveSubsystem.java and search for "//ManualDrive" Uncomment the 3 lines after "//ManualDrive". That is:

    m_driveSubsystem.setDefaultCommand(new ArcadeDrive(m_driveSubsystem,
    () -> m_driverController.getYMapped(Hand.kLeft), () ->
    m_driverController.getXMapped(Hand.kRight) * 0.75, () -> m_driverController.getCrossButton()));

Now deploy the code, and test it with the joystick.

Motion Profile Drive:

Go to src/main/java/frc/robot/subsystems/TalonFXDriveSubsystem.java and search for "//MotionProfileDrive" Uncomment the 2 lines after "//MotionProfileDrive". That is:

   new JoystickButton(m_driverController, Button.kTrig.value)
        .whenPressed(new PIDDrive(m_driveSubsystem, () -> m_driverController.getTrigButtonPressed(), 4000 * 5));

Now deploy the code. Press the trig button on the joystick and you should see some motor actions

After testing you should re-comment out any code that you uncommented for testing

Edge7481 commented 4 years ago

Go to src/main/java/frc/robot/subsystems/TalonFXDriveSubsystem.java

RobotContainer.java, not TalonFXDriveSubsystem.java

Edge7481 commented 4 years ago

For the flywheel, we need to configure the Spark Max motor controllers (I only configured 1 of them and I haven't tested it)

For wiring, follow http://www.revrobotics.com/sparkmax-quickstart/ For software, follow http://www.revrobotics.com/sparkmax-software/

Give each motor controller an ID/device number and use the correct device number in /src/main/java/frc/robot/subsystems/FlywheelSingleSubsystem.java at

private final CANSparkMax m_motor = new CANSparkMax(<id>, MotorType.kBrushless);