-
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?
Conversation
What does the extend intake command do? |
Lines 19 and 23 of Intake.java, I suggest using |
Lines 10 and 11 of Intake, should be |
Lines 37-39 of Intake.java, the comment is unnecessary. |
|
It extends the drawbridge which has the intake mechanism attached to it. |
public final static double DEFAULT_DRAWBRIDGE_MOTOR_SPEED = 0.0; //needs value | ||
public final static double DEFAULT_OFF_SPEED = 0.0; | ||
|
||
public Motor drawbridgeMotor; |
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.
add final
public final static double DEFAULT_OFF_SPEED = 0.0; | ||
|
||
public Motor drawbridgeMotor; | ||
public Motor axelMotor; |
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.
add final
} | ||
|
||
public void setAxelIntakeSpeed(double speed) { | ||
axelMotor.set(speed); |
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.
add this.
} | ||
|
||
public void setDrawBridgeSpeed(double speed) { | ||
drawbridgeMotor.set(speed); |
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.
add this.
public void stop() { | ||
setSpeed(DEFAULT_OFF_SPEED, DEFAULT_OFF_SPEED); //maybe retract drawbridge? | ||
} | ||
// public void retractDrawBridge(double speed) { |
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.
delete comment
|
||
import org.usfirst.frc4904.standard.subsystems.motor.Motor; | ||
|
||
public class Intake { |
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.
Shouldn't this extend SubsystemBase
?
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.
Yes—all subsystems should extend SubsystemBase
.
public ExtendIntake(Intake intake, double targetSpeed) { | ||
super(); | ||
this.intake = intake; | ||
this.targetSpeed = targetSpeed; |
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.
You declare a variable targetSpeed
, but you don't actually do anything with it. You need to call intake's setSpeed
.
@@ -0,0 +1,16 @@ | |||
package org.usfirst.frc4904.robot.commands; |
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.
Preferably put this command in a subfolder of commands named "Intake".
public class ExtendIntake extends CommandBase { | ||
protected final Intake intake; | ||
protected double targetSpeed; | ||
public ExtendIntake(Intake intake, double targetSpeed) { |
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.
The intake should not be a parameter of the constructor. Instead, use this.intake = RobotMap.Component.intake;
. Additionally, for this to work, add the line addRequirements(RobotMap.Component.intake);
as the last line of the constructor. You can checkout to the turret branch and look at the command TurnTurret
as an example.
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.
Left some comments—please address and I can take another look.
build.gradle
Outdated
@@ -2,7 +2,7 @@ import edu.wpi.first.gradlerio.deploy.roborio.RoboRIO | |||
|
|||
plugins { | |||
id "java" | |||
id "edu.wpi.first.GradleRIO" version "2022.1.1" | |||
id "edu.wpi.first.GradleRIO" version "2022.2.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.
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.
@@ -21,6 +32,7 @@ | |||
} | |||
|
|||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
No longer a motor (in the comment) :)
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Generally the name
argument should be in camel caps without spaces.
|
||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Generally the name
argument should be in camel caps without spaces (see other).
|
||
public class ExtendIntake extends SolenoidExtend { //It extends the drawbridge which has the intake mechanism attached to it. | ||
public ExtendIntake() { | ||
super("Extend Intake Drawbridge", RobotMap.Component.intakeDrawbridgeSolenoid); |
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.
Name argument should be in camel caps without spaces.
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 comment
The 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 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before—the name
argument should be in camel caps without spaces.
|
||
import org.usfirst.frc4904.standard.subsystems.motor.Motor; | ||
|
||
public class Intake { |
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.
Yes—all subsystems should extend SubsystemBase
.
@@ -70,5 +83,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()); | |||
Component.intakeAxleMotor = new Motor("Intake Motor", false, new CANTalonFX(Port.CANMotor.AXLE_INTAKE_MOTOR)); //TODO: check if CANTalonFX or SRX |
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.
Also this is a CANTalonFX
—confirmed with the intake people on design.
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.
great
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.
Looks good for now—leaving an approval here ✅
* Rotates the axle to intake the ball | ||
*/ | ||
public class AxleIntakeOn extends MotorConstant { | ||
public final static double DEFAULT_INTAKE_MOTOR_SPEED = 0.5; //TODO: needs value |
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.
Remember to add value
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.
Looks good for now. We'll make sure to adjust constants and then after design review we should be able to merge this.
Intake code to control the motor that the compliant wheels are on as well as the drawbridge motor.