-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRobotContainer.java
More file actions
44 lines (36 loc) · 1.59 KB
/
Copy pathRobotContainer.java
File metadata and controls
44 lines (36 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package frc.robot;
import edu.wpi.first.wpilibj.XboxController;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.Commands;
import edu.wpi.first.wpilibj2.command.button.JoystickButton;
import frc.robot.commands.Drive;
import frc.robot.commands.Intake;
import frc.robot.commands.Shoot;
import frc.robot.subsystems.Drivetrain;
import frc.robot.subsystems.Feeder;
import frc.robot.subsystems.ShooterAndIntake;
public class RobotContainer {
Drivetrain drivetrain = new Drivetrain();
ShooterAndIntake shooterAndIntake = new ShooterAndIntake();
Feeder feeder = new Feeder();
XboxController driveController = new XboxController(0);
XboxController opController = new XboxController(1);
public RobotContainer() {
drivetrain.setDefaultCommand(new Drive(
drivetrain,
() -> driveController.getRawAxis(1),
() -> -driveController.getRawAxis(4)));
configureBindings();
}
private void configureBindings() {
new JoystickButton(opController, 6).whileTrue(new Shoot(feeder, shooterAndIntake));
new JoystickButton(opController, 5).whileTrue(new Intake(feeder, shooterAndIntake));
//new JoystickButton(driveController, 1).whileTrue(Commands.runEnd(() -> drivetrain.frontLeft.set(0.5), () -> drivetrain.frontLeft.set(0), drivetrain));
}
public Command getAutonomousCommand() {
return Commands.print("No autonomous command configured");
}
}