Skip to content
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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Shuffleboard #3

wants to merge 21 commits into from

Conversation

25krobertson
Copy link
Contributor

This branch contains code for the pitch PD.

Comment on lines 9 to 26
// 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;
Copy link

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?

Comment on lines 28 to 46
// 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]
// }
}
Copy link

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?

Comment on lines 153 to 181


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;
}
Copy link

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?

Comment on lines 232 to 255
//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
*/
Copy link

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?

Comment on lines +279 to +284
/*
@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
}
*/
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants