Skip to content

Intake#17

Open
AnshulBompada wants to merge 13 commits intoproductionfrom
intake
Open

Intake#17
AnshulBompada wants to merge 13 commits intoproductionfrom
intake

Conversation

@AnshulBompada
Copy link
Copy Markdown
Contributor

No description provided.

INTAKE(12.0, 6.0),
OUTTAKE(-12.0, -12.0),
AMP(4.0, 4.0),
STOP(0.0, 0.0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add custom set point with logged tunable number (E.g. CUSTOM(new LoggedTunableNumber("Intake/Motor1", 0.0), new LoggedTunableNumber("Intake/Motor2", 0.0);)

motorConfig.Voltage.PeakForwardVoltage = 12.0;
motorConfig.Voltage.PeakReverseVoltage = -12.0;
motorConfig.MotorOutput.NeutralMode = NeutralModeValue.Coast;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configuration values need to be moved to the subsystem's constants file

@@ -0,0 +1,20 @@
package frc.robot.subsystems.intake;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleanup all constants (set them to 0 or default values)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indexer/Intake uses IDs 56-59

intakeSim.update(Constants.kLoopPeriod);

inputs.isIntakeConnected = true;
inputs.intakeMPS = (intakeSim.getAngularVelocityRadPerSec() / kIntakeGearing) * kWheelCircumference;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not be calling the simulation's angular velocity in rotations and not radians and then divide by the gear ratio?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't the radians 2*pi for the full circumference? To get the true MPS you'd need (AngleRad / gearing) * (WheelCirc / 2*PI) ?


// Define subsystems
// ex: private final LEDSubsystem LEDs;
// private final IndexerIntake robotIntake;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go ahead and uncomment the newly added lines. The goal with the templates is that the functionality just slots in on merge.


private void configureButtonBindings() {

// driverController.a()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's have examples for intake and outake, and put them on the same control bindings that will likely be used in competition.

intakeSim.update(Constants.kLoopPeriod);

inputs.isIntakeConnected = true;
inputs.intakeMPS = (intakeSim.getAngularVelocityRadPerSec() / kIntakeGearing) * kWheelCircumference;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't the radians 2*pi for the full circumference? To get the true MPS you'd need (AngleRad / gearing) * (WheelCirc / 2*PI) ?

// Checks for spike in amperage, and if greater than the value
// Then the intake motor probbaly has the note
// Note currently used in code, but left for implementation
motorCurrentDetectedNote = ampFilter.calculate(inputs.intakeStatorCurrentAmps[0]) > 35;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be in constants, and called out in comments as a tunable number.


Logger.recordOutput("IndexerIntake/StoppedByIR", false);
if(goal != null) {
if(goal == IndexerIntakeVoltageGoal.INTAKE && inputs.intakeHasNote) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's replace "Note" with "GamePiece"

@@ -0,0 +1,20 @@
package frc.robot.subsystems.intake;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indexer/Intake uses IDs 56-59

NOTE Code does not work in its current state, am currently in process of refactoring
TODO Review configurations and confirm sensor actually works well
Use proper constants and add comments
Adding implementation since we are using a neo 550 for testing
NOTE This implementation is only for testing and should be rewritten if it is to be used on compbot
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.

3 participants