--- /dev/null
+{
+ "version": 1.0,
+ "grid_size": 128,
+ "tabs": [
+ {
+ "name": "Teleoperated",
+ "grid_layout": {
+ "layouts": [],
+ "containers": [
+ {
+ "title": "WON AUTO?",
+ "x": 768.0,
+ "y": 128.0,
+ "width": 256.0,
+ "height": 128.0,
+ "type": "Large Text Display",
+ "properties": {
+ "topic": "/SmartDashboard/WON AUTO?",
+ "period": 0.06,
+ "data_type": "string"
+ }
+ },
+ {
+ "title": "Turret position",
+ "x": 1024.0,
+ "y": 0.0,
+ "width": 384.0,
+ "height": 256.0,
+ "type": "Graph",
+ "properties": {
+ "topic": "/SmartDashboard/Turret position",
+ "period": 0.033,
+ "data_type": "double",
+ "time_displayed": 5.0,
+ "color": 4278238420,
+ "line_width": 2.0
+ }
+ },
+ {
+ "title": "Target Velocity RPS",
+ "x": 512.0,
+ "y": 0.0,
+ "width": 128.0,
+ "height": 128.0,
+ "type": "Text Display",
+ "properties": {
+ "topic": "/SmartDashboard/Target Velocity RPS",
+ "period": 0.06,
+ "data_type": "double",
+ "show_submit_button": false
+ }
+ },
+ {
+ "title": "Intake Calibrated",
+ "x": 256.0,
+ "y": 0.0,
+ "width": 128.0,
+ "height": 128.0,
+ "type": "Boolean Box",
+ "properties": {
+ "topic": "/SmartDashboard/Intake Calibrated",
+ "period": 0.06,
+ "data_type": "boolean",
+ "true_color": 4283215696,
+ "false_color": 4294198070,
+ "true_icon": "None",
+ "false_icon": "None"
+ }
+ },
+ {
+ "title": "Hood Calibrated",
+ "x": 128.0,
+ "y": 0.0,
+ "width": 128.0,
+ "height": 128.0,
+ "type": "Boolean Box",
+ "properties": {
+ "topic": "/SmartDashboard/Hood Calibrated",
+ "period": 0.06,
+ "data_type": "boolean",
+ "true_color": 4283215696,
+ "false_color": 4294198070,
+ "true_icon": "None",
+ "false_icon": "None"
+ }
+ },
+ {
+ "title": "Turret Calibrated",
+ "x": 0.0,
+ "y": 0.0,
+ "width": 128.0,
+ "height": 128.0,
+ "type": "Boolean Box",
+ "properties": {
+ "topic": "/SmartDashboard/Turret Calibrated",
+ "period": 0.06,
+ "data_type": "boolean",
+ "true_color": 4283215696,
+ "false_color": 4294198070,
+ "true_icon": "None",
+ "false_icon": "None"
+ }
+ },
+ {
+ "title": "Climb Calibrated",
+ "x": 384.0,
+ "y": 0.0,
+ "width": 128.0,
+ "height": 128.0,
+ "type": "Boolean Box",
+ "properties": {
+ "topic": "/SmartDashboard/Climb Calibrated",
+ "period": 0.06,
+ "data_type": "boolean",
+ "true_color": 4283215696,
+ "false_color": 4294198070,
+ "true_icon": "None",
+ "false_icon": "None"
+ }
+ },
+ {
+ "title": "Field",
+ "x": 0.0,
+ "y": 128.0,
+ "width": 768.0,
+ "height": 384.0,
+ "type": "Field",
+ "properties": {
+ "topic": "/SmartDashboard/Field",
+ "period": 0.06,
+ "field_game": "Rebuilt",
+ "robot_width": 0.85,
+ "robot_length": 0.85,
+ "show_other_objects": true,
+ "show_trajectories": true,
+ "field_rotation": 0.0,
+ "robot_color": 4294198070,
+ "trajectory_color": 4294967295,
+ "show_robot_outside_widget": true
+ }
+ },
+ {
+ "title": "Hood At Setpoint",
+ "x": 128.0,
+ "y": 512.0,
+ "width": 128.0,
+ "height": 128.0,
+ "type": "Boolean Box",
+ "properties": {
+ "topic": "/SmartDashboard/Hood At Setpoint",
+ "period": 0.06,
+ "data_type": "boolean",
+ "true_color": 4283215696,
+ "false_color": 4294198070,
+ "true_icon": "None",
+ "false_icon": "None"
+ }
+ },
+ {
+ "title": "Turret At Setpoint",
+ "x": 0.0,
+ "y": 512.0,
+ "width": 128.0,
+ "height": 128.0,
+ "type": "Boolean Box",
+ "properties": {
+ "topic": "/SmartDashboard/Turret At Setpoint",
+ "period": 0.06,
+ "data_type": "boolean",
+ "true_color": 4283215696,
+ "false_color": 4294198070,
+ "true_icon": "None",
+ "false_icon": "None"
+ }
+ },
+ {
+ "title": "Intake At Setpoint",
+ "x": 256.0,
+ "y": 512.0,
+ "width": 128.0,
+ "height": 128.0,
+ "type": "Boolean Box",
+ "properties": {
+ "topic": "/SmartDashboard/Intake At Setpoint",
+ "period": 0.06,
+ "data_type": "boolean",
+ "true_color": 4283215696,
+ "false_color": 4294198070,
+ "true_icon": "None",
+ "false_icon": "None"
+ }
+ },
+ {
+ "title": "Voltage",
+ "x": 640.0,
+ "y": 0.0,
+ "width": 384.0,
+ "height": 128.0,
+ "type": "Voltage View",
+ "properties": {
+ "topic": "/AdvantageKit/PowerDistribution/Voltage",
+ "period": 0.06,
+ "data_type": "double",
+ "min_value": 4.0,
+ "max_value": 13.0,
+ "divisions": 5,
+ "inverted": false,
+ "orientation": "horizontal"
+ }
+ },
+ {
+ "title": "RobotID",
+ "x": 768.0,
+ "y": 256.0,
+ "width": 256.0,
+ "height": 128.0,
+ "type": "Text Display",
+ "properties": {
+ "topic": "/SmartDashboard/RobotID",
+ "period": 0.06,
+ "data_type": "string",
+ "show_submit_button": false
+ }
+ }
+ ]
+ }
+ },
+ {
+ "name": "Autonomous",
+ "grid_layout": {
+ "layouts": [],
+ "containers": []
+ }
+ }
+ ]
+}
\ No newline at end of file
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.wpilibj2.command.InstantCommand;
+import frc.robot.commands.LogCommand;
import frc.robot.commands.drive_comm.DefaultDriveCommand;
import frc.robot.commands.gpm.AutoShootCommand;
import frc.robot.commands.gpm.ClimbDriveCommand;
private Intake intake = null;
// this is inside addAuto()
- //private Command auto = new DoNothing();
+ // private Command auto = new DoNothing();
// Controllers are defined here
private BaseDriverConfig driver = null;
driver.configureControls();
operator.configureControls();
-
registerCommands();
PathGroupLoader.loadPathGroups();
-
+
initializeAutoBuilder();
autoChooserInit();
// put the Chooser on the SmartDashboard
SmartDashboard.putData("Auto chooser", autoChooser);
-
-
if (turret != null) {
turret.setDefaultCommand(new Superstructure(turret, drive, hood, shooter, spindexer));
}
+
drive.setDefaultCommand(new DefaultDriveCommand(drive, driver));
break;
}
- if (intake != null && hood != null && turret != null)
- CommandScheduler.getInstance().schedule(new HardstopWarning(hood, intake, turret));
+ if (intake != null && hood != null && turret != null)
+ CommandScheduler.getInstance().schedule(new HardstopWarning(hood, intake, turret));
// This is really annoying so it's disabled
DriverStation.silenceJoystickConnectionWarning(true);
+ CommandScheduler.getInstance().schedule(new LogCommand());
+
// TODO: verify this claim.
// LiveWindow is causing periodic loop overruns
LiveWindow.disableAllTelemetry();
}
- public void addAuto(String name){
- try{
+ public void addAuto(String name) {
+ try {
Command auto = new PathPlannerAuto(name);
autoChooser.addOption(name, auto);
}
// is this the right one??
catch (AutoBuilderException e) {
- e.printStackTrace();
- System.out.println("HELLOOOO AUTO \"" + name + "\" NOT FOUND");
- }
+ e.printStackTrace();
+ System.out.println("HELLOOOO AUTO \"" + name + "\" NOT FOUND");
+ }
}
/**
// add the options to the Chooser
String defaultAuto = "Test default auto";
String leftSideAuto = "Left Week V1";
- String rightSideAuto = "Right Week V1";
+ String rightSideAuto = "Right Week V1";
String shootOnlyAuto = "Shoot Only Left Week V1";
autoChooser.setDefaultOption("Default", new PathPlannerAuto(defaultAuto));
--- /dev/null
+package frc.robot.commands;
+
+import org.littletonrobotics.junction.Logger;
+
+import edu.wpi.first.wpilibj2.command.Command;
+import frc.robot.util.Elastic;
+import frc.robot.util.HubActive;
+import frc.robot.util.ShooterPhysics;
+import frc.robot.util.Elastic.Notification;
+import frc.robot.util.Elastic.NotificationLevel;
+
+public class LogCommand extends Command {
+
+ private boolean hubActive = false;
+
+ public LogCommand() {
+ }
+
+ @Override
+ public void execute() {
+ boolean current = HubActive.isHubActive();
+ Logger.recordOutput("HubActive", current);
+
+ if (current && !hubActive) {
+ Elastic.sendNotification(new Notification(NotificationLevel.INFO, "HUB ACTIVE", ""));
+ } else if (!current && hubActive) {
+ Elastic.sendNotification(new Notification(NotificationLevel.INFO, "HUB DEACTIVATED", ""));
+ }
+
+ int x = 1/0;
+
+ }
+
+ @Override
+ public boolean runsWhenDisabled() {
+ return true;
+ }
+
+ @Override
+ public boolean isFinished() {
+ return false;
+ }
+}