-
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
Changes to Intake also Juicy 3 #4
base: main
Are you sure you want to change the base?
Changes from 3 commits
56a60da
e1a2fd3
4f8eab7
a92e5f6
093cd98
c2b48e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
package org.usfirst.frc4904.robot; | ||
|
||
import edu.wpi.first.wpilibj.PneumaticsModuleType; | ||
import edu.wpi.first.wpilibj2.command.Subsystem; | ||
|
||
import org.usfirst.frc4904.standard.custom.PCMPort; | ||
import org.usfirst.frc4904.standard.custom.controllers.CustomJoystick; | ||
import org.usfirst.frc4904.standard.custom.controllers.CustomXbox; | ||
import org.usfirst.frc4904.standard.custom.motioncontrollers.CANTalonFX; | ||
import org.usfirst.frc4904.standard.custom.motioncontrollers.CANTalonSRX; | ||
import org.usfirst.frc4904.standard.subsystems.SolenoidSubsystem.SolenoidState; | ||
import org.usfirst.frc4904.standard.subsystems.SolenoidSubsystem; | ||
import org.usfirst.frc4904.standard.subsystems.motor.Motor; | ||
import org.usfirst.frc4904.robot.subsystems.Intake; | ||
|
||
|
||
public class RobotMap { | ||
public static class Port { | ||
|
@@ -12,6 +22,7 @@ public static class HumanInput { | |
} | ||
|
||
public static class CANMotor { | ||
public static final int AXLE_INTAKE_MOTOR = -1; //TODO: set port for axel intake motor | ||
} | ||
|
||
public static class PWM { | ||
|
@@ -21,6 +32,7 @@ public static class CAN { | |
} | ||
|
||
public static class Pneumatics { | ||
public static final PCMPort DRAWBRIDGE_INTAKE_SOLENOID = new PCMPort(-1, PneumaticsModuleType.CTREPCM, -1, -1); //TODO: set port for drawbridge intake motor | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer a motor (in the comment) :) |
||
} | ||
|
||
public static class Digital { | ||
|
@@ -51,6 +63,9 @@ public static class Turn { | |
} | ||
|
||
public static class Component { | ||
public static Intake intake; | ||
public static Motor intakeAxleMotor; | ||
public static SolenoidSubsystem intakeDrawbridgeSolenoid; | ||
} | ||
|
||
public static class Input { | ||
|
@@ -70,5 +85,7 @@ public RobotMap() { | |
HumanInput.Driver.xbox = new CustomXbox(Port.HumanInput.xboxController); | ||
HumanInput.Operator.joystick = new CustomJoystick(Port.HumanInput.joystick); | ||
|
||
Component.intakeDrawbridgeSolenoid = new SolenoidSubsystem("Intake Drawbridge Solenoid", false, SolenoidState.RETRACT, Port.Pneumatics.DRAWBRIDGE_INTAKE_SOLENOID.buildDoubleSolenoid()); //TODO: check if CANTalonFX or SRX | ||
Component.intakeAxleMotor = new Motor("Intake Motor", false, new CANTalonFX(Port.CANMotor.AXLE_INTAKE_MOTOR)); //TODO: check if CANTalonFX or SRX | ||
b-cho marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also this is a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.usfirst.frc4904.robot.commands.intake; | ||
|
||
import org.usfirst.frc4904.robot.RobotMap; | ||
import org.usfirst.frc4904.standard.commands.motor.MotorIdle; | ||
|
||
public class AxleIntakeOff extends MotorIdle { | ||
public AxleIntakeOff() { | ||
super("Stop Axle Intake", RobotMap.Component.intakeAxleMotor); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally the |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.usfirst.frc4904.robot.commands.intake; | ||
|
||
import org.usfirst.frc4904.robot.RobotMap; | ||
import org.usfirst.frc4904.standard.commands.motor.MotorConstant; | ||
|
||
public class AxleIntakeOn extends MotorConstant { | ||
public AxleIntakeOn() { | ||
super("Axel Intake On", RobotMap.Component.intakeAxleMotor, 0.5); // todo: needs motor speed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generally the |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.usfirst.frc4904.robot.commands.intake; | ||
|
||
import org.usfirst.frc4904.robot.RobotMap; | ||
import org.usfirst.frc4904.standard.commands.solenoid.SolenoidExtend; | ||
|
||
public class ExtendIntake extends SolenoidExtend { //It extends the drawbridge which has the intake mechanism attached to it. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Comments probably should go above the first line of the class, like this // It extends the drawbridge which has the intake mechanism attached to it.
public class ExtendIntake extends SolenoidExtend {
... |
||
public ExtendIntake() { | ||
super("Extend Intake Drawbridge", RobotMap.Component.intakeDrawbridgeSolenoid); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Name argument should be in camel caps without spaces. |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.usfirst.frc4904.robot.commands.intake; | ||
|
||
import org.usfirst.frc4904.robot.RobotMap; | ||
import org.usfirst.frc4904.standard.commands.solenoid.SolenoidRetract; | ||
|
||
public class RetractIntake extends SolenoidRetract { //It extends the drawbridge which has the intake mechanism attached to it. | ||
public RetractIntake() { | ||
super("Retract Intake Drawbridge", RobotMap.Component.intakeDrawbridgeSolenoid); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as before—the |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.usfirst.frc4904.robot.subsystems; | ||
import org.usfirst.frc4904.standard.subsystems.SolenoidSubsystem; | ||
import org.usfirst.frc4904.standard.subsystems.motor.Motor; | ||
|
||
public class Intake { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't this extend There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes—all subsystems should extend |
||
public final static double DEFAULT_INTAKE_MOTOR_SPEED = 0.0; //needs value | ||
// public final static double DEFAULT_DRAWBRIDGE_MOTOR_SPEED = 0.0; //needs value | ||
public final static double DEFAULT_OFF_SPEED = 0.0; | ||
|
||
public final SolenoidSubsystem drawbridgeSolenoid; | ||
public final Motor axelMotor; | ||
|
||
public Intake(Motor axelMotor, SolenoidSubsystem drawbridgeSolenoid) { | ||
this.axelMotor = axelMotor; | ||
this.drawbridgeSolenoid = drawbridgeSolenoid; | ||
} | ||
} |
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.
Make sure that this matches the version on the driver station—probably leave it as
2022.1.1
for now.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.
Don't worry about changing this at the moment, though.