Added controls and shuffboard
This commit is contained in:
parent
030a9b9773
commit
c1eae1e68b
64
shuffleboard.json
Normal file
64
shuffleboard.json
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
{
|
||||||
|
"tabPane": [
|
||||||
|
{
|
||||||
|
"title": "SmartDashboard",
|
||||||
|
"autoPopulate": true,
|
||||||
|
"autoPopulatePrefix": "SmartDashboard/",
|
||||||
|
"widgetPane": {
|
||||||
|
"gridSize": 128.0,
|
||||||
|
"showGrid": true,
|
||||||
|
"hgap": 16.0,
|
||||||
|
"vgap": 16.0,
|
||||||
|
"titleType": 0,
|
||||||
|
"tiles": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": "LiveWindow",
|
||||||
|
"autoPopulate": true,
|
||||||
|
"autoPopulatePrefix": "LiveWindow/",
|
||||||
|
"widgetPane": {
|
||||||
|
"gridSize": 128.0,
|
||||||
|
"showGrid": true,
|
||||||
|
"hgap": 16.0,
|
||||||
|
"vgap": 16.0,
|
||||||
|
"titleType": 0,
|
||||||
|
"tiles": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"title": " Sensor",
|
||||||
|
"autoPopulate": false,
|
||||||
|
"autoPopulatePrefix": "",
|
||||||
|
"widgetPane": {
|
||||||
|
"gridSize": 128.0,
|
||||||
|
"showGrid": true,
|
||||||
|
"hgap": 16.0,
|
||||||
|
"vgap": 16.0,
|
||||||
|
"titleType": 0,
|
||||||
|
"tiles": {
|
||||||
|
"0,0": {
|
||||||
|
"size": [
|
||||||
|
2,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"content": {
|
||||||
|
"_type": "Boolean Box",
|
||||||
|
"_title": "Frisbee Presence Sensor",
|
||||||
|
"_glyph": 148,
|
||||||
|
"_showGlyph": false,
|
||||||
|
"Colors/Color when true": "#7CFC00FF",
|
||||||
|
"Colors/Color when false": "#8B0000FF"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"windowGeometry": {
|
||||||
|
"x": -7.199999809265137,
|
||||||
|
"y": -7.199999809265137,
|
||||||
|
"width": 1550.4000244140625,
|
||||||
|
"height": 830.4000244140625
|
||||||
|
}
|
||||||
|
}
|
@ -6,15 +6,40 @@ package frc.robot;
|
|||||||
|
|
||||||
import edu.wpi.first.wpilibj2.command.Command;
|
import edu.wpi.first.wpilibj2.command.Command;
|
||||||
import edu.wpi.first.wpilibj2.command.Commands;
|
import edu.wpi.first.wpilibj2.command.Commands;
|
||||||
|
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
|
||||||
|
import frc.robot.constants.OIConstants;
|
||||||
|
import frc.robot.subsystems.Drivetrain;
|
||||||
|
import frc.robot.subsystems.Flicker;
|
||||||
|
|
||||||
|
|
||||||
public class RobotContainer {
|
public class RobotContainer {
|
||||||
|
private Flicker flicker;
|
||||||
|
private Drivetrain drivetrain;
|
||||||
|
private CommandXboxController driver;
|
||||||
|
private CommandXboxController operator;
|
||||||
public RobotContainer() {
|
public RobotContainer() {
|
||||||
|
drivetrain = new Drivetrain();
|
||||||
|
flicker = new Flicker();
|
||||||
|
driver = new CommandXboxController(OIConstants.kDriverUSB);
|
||||||
|
|
||||||
configureBindings();
|
configureBindings();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void configureBindings() {}
|
private void configureBindings() {
|
||||||
|
drivetrain.setDefaultCommand(
|
||||||
|
drivetrain.driveArcade(
|
||||||
|
driver::getLeftY,
|
||||||
|
driver::getLeftX
|
||||||
|
)
|
||||||
|
);
|
||||||
|
flicker.setDefaultCommand(flicker.stop());
|
||||||
|
driver.a().onTrue(flicker.setSpeed(() ->1));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public Command getAutonomousCommand() {
|
public Command getAutonomousCommand() {
|
||||||
return Commands.print("No autonomous command configured");
|
return flicker.setSpeed(() -> 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
8
src/main/java/frc/robot/constants/OIConstants.java
Normal file
8
src/main/java/frc/robot/constants/OIConstants.java
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
package frc.robot.constants;
|
||||||
|
|
||||||
|
public class OIConstants {
|
||||||
|
public static final int kDriverUSB = 0;
|
||||||
|
public static final int kOperatorUSB = 1;
|
||||||
|
|
||||||
|
public static final String kRobotIndicatorsTabName = "Robot Indicators";
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user