-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shuffleboard #3
base: main
Are you sure you want to change the base?
Shuffleboard #3
Conversation
… auto periodic now
src/main/java/frc/robot/OI.java
Outdated
// public double intakeOn, intakeOff; | ||
|
||
public static final XboxController m_controller = new XboxController(0);//buttons/co-driver controller | ||
public static final XboxController m_controller_two = new XboxController(1);//main driver/driving controller | ||
|
||
//public static Button armExtended = Button.kY;//button to fully extend to 90 degrees | ||
//public static Button armControl = Button.kLeftStick;//stick to control arm length (any length from fully retracted to extended) | ||
public static Button pitchPD = Button.kLeftBumper;//pitch pd for charge station | ||
public static Button stop = Button.kRightBumper;//stop drive bumper | ||
//public static Trigger leftTrigger = Trigger.; | ||
// //public static Button armExtended = Button.kY;//button to fully extend to 90 degrees | ||
// //public static Button armControl = Button.kLeftStick;//stick to control arm length (any length from fully retracted to extended) | ||
// public static Button pitchPD = Button.kLeftBumper;//pitch pd for charge station | ||
// public static Button stop = Button.kRightBumper;//stop drive bumper | ||
// //public static Trigger leftTrigger = Trigger.; | ||
|
||
public static Button lowShelf = Button.kX; // low shelf height combo of elevator and arm angle | ||
public static Button midShelf = Button.kA; // mid shelf | ||
public static Button highShelf = Button.kB; // high shelf | ||
public static Button turnNorth = Button.kY;//button to turn to true north | ||
// public static Button lowShelf = Button.kX; // low shelf height combo of elevator and arm angle | ||
// public static Button midShelf = Button.kA; // mid shelf | ||
// public static Button highShelf = Button.kB; // high shelf | ||
// public static Button turnNorth = Button.kY;//button to turn to true north | ||
|
||
|
||
public static Button outtake = Button.kA; | ||
// public static Button outtake = Button.kA; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are these commented out? do we still need them?
src/main/java/frc/robot/OI.java
Outdated
// intakeOn = triggerThreshold (m_controller.getLeftTriggerAxis()); | ||
// intakeOff = triggerThreshold (m_controller.getRightTriggerAxis()); | ||
// } | ||
// /*two total xbox controllers, one for driver, one for co-driver. 4 buttons on each, 2 joysticks, 2 triggers, 2 bumbers, 2 additional buttons at the back of the contoller, and possibly 4 directional arrow keys. All can be programmed for different settings as desired. | ||
// * buttons/joysticks to be coded: | ||
// * - make joystick for driving robot | ||
// * - outtake button | ||
// */ | ||
|
||
// public static double triggerThreshold(double tValue) { | ||
// if (Math.abs(tValue) < 0.1) { //change this value to be more specific if wanted | ||
// return 0; | ||
// } else { | ||
// return 1 * tValue; | ||
// } | ||
// //trigger axis is bound by the range [0,1] not [-1,1] | ||
// } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here - why is it commented out?
src/main/java/frc/robot/Robot.java
Outdated
|
||
|
||
autonomousBasePD.init(); | ||
/* | ||
m_autoSelected = m_chooser.getSelected(); | ||
m_autoSelected = SmartDashboard.getString("Auto Selector", kDefaultAuto); | ||
System.out.println("Auto selected: " + m_autoSelected); | ||
|
||
*/ | ||
|
||
m_autoSelected = m_chooser.getSelected(); | ||
m_autoSelected.init(); | ||
|
||
} | ||
|
||
/** This function is called periodically during autonomous. */ | ||
@Override | ||
public void autonomousPeriodic() { | ||
|
||
/* | ||
switch (m_autoSelected) { | ||
case kCustomAuto: | ||
// Put custom auto code here | ||
break; | ||
case kDefaultAuto: | ||
default: | ||
// Put default auto code here | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this all commented out?
src/main/java/frc/robot/Robot.java
Outdated
//following code via https://docs.wpilib.org/en/stable/docs/software/dashboards/shuffleboard/layouts-with-code/organizing-widgets.html | ||
ShuffleboardLayout turnPID = pidTab.getLayout("Turn PID", BuiltInLayouts.kList)//change this layout to support input | ||
.withSize(2, 2); | ||
turnPID.add(new ElevatorDownCommand());//what should we put here instead of the commands? i think this is where we should write the info and ask user for input? | ||
turnPID.add(new ElevatorUpCommand()); | ||
|
||
ShuffleboardLayout drivePID = pidTab.getLayout("Drive PID", BuiltInLayouts.kList)//change this layout to support input | ||
.withSize(2, 2); | ||
drivePID.add(new ElevatorDownCommand());//what should we put here instead of the commands? i think this is where we should write the info and ask user for input? | ||
drivePID.add(new ElevatorUpCommand()); | ||
|
||
ShuffleboardLayout pitchPID = pidTab.getLayout("Pitch PID", BuiltInLayouts.kList)//change this layout to support input | ||
.withSize(2, 2);riodic | ||
pitchPID.add(new ElevatorDownCommand());//what should we put here instead of the commands? i think this is where we should write the info and ask user for input? | ||
pitchPID.add(new ElevatorUpCommand()); | ||
|
||
ShuffleboardLayout veloPID = pidTab.getLayout("Velocity PID", BuiltInLayouts.kList)//change this layout to support input | ||
.withSize(2, 2); | ||
pitchPID.add(new ElevatorDownCommand());//what should we put here instead of the commands? i think this is where we should write the info and ask user for input? | ||
pitchPID.add(new ElevatorUpCommand()); | ||
|
||
//following code via https://docs.wpilib.org/en/stable/docs/software/dashboards/shuffleboard/advanced-usage/shuffleboard-tuning-pid.html | ||
//NetworkTableEntry turnWidget = pidTab.add("Turn PID", 1).getEntry();//NOTE: i think this is an alternative way to create a widget as opposed to what's shown above | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this commented out?
/* | ||
@Override | ||
public void initSendable(SendableBuilder builder){ //via https://docs.wpilib.org/en/stable/docs/software/telemetry/writing-sendable-classes.html | ||
builder.addDoubleProperty("turnPIDk", this::getSetpoint, this::setSetpoint);//TODO finish adding these, and verify that this works | ||
} | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this not be commented out?
This branch contains code for the pitch PD.