Skip to content

Intake subsystem#7

Open
j110396-arch wants to merge 17 commits intomainfrom
intake-subsystem
Open

Intake subsystem#7
j110396-arch wants to merge 17 commits intomainfrom
intake-subsystem

Conversation

@j110396-arch
Copy link

pr測試

Copy link
Contributor

@Hannahjjj97 Hannahjjj97 left a comment

Choose a reason for hiding this comment

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

請修正

  • 不該出現在 Subsystem 的搖桿程式需刪除
  • 多餘不會用到的 Vendor 檔也需刪除
  • Phoenix 的 Vendor 要改成沒有 replay 的版本

/** Creates a new IntakeSubsystem. */
SparkMax intakeMotor = new SparkMax(10, MotorType.kBrushless);
SparkMaxConfig config = new SparkMaxConfig();
Joystick driverJoystick = new Joystick(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Subsystem 裡面不該出現搖桿,如果不太懂的話,你什麼時候去實驗室啊?我可以找人教你

Copy link
Author

Choose a reason for hiding this comment

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

應該是可以解決

Comment on lines 55 to 74
if (driverJoystick.getRawButton(2)) {
rotateUp();
}
else if (driverJoystick.getRawButton(3)) {
rotateDown();
}
else {
stopRotate();

//
if (driverJoystick.getRawButton(4)) {
intake();
}
else if (driverJoystick.getRawButton(5)) {
reverseIntake();
}
else {
stopIntake();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

這些東西也不該出現在 Subsystem 裡面,一樣如果沒懂的話,看你什麼時候去實驗室,我找人教你

@Hannahjjj97
Copy link
Contributor

Checks 沒通過要去看為什麼沒通過並修正喔

@Hannahjjj97
Copy link
Contributor

@Hannahjjj97
Copy link
Contributor

Hannahjjj97 commented Jan 30, 2026

你如果改完需要再 review 一次的話要再 request review 一次喔

@j110396-arch
Copy link
Author

Merging is blocked

@j110396-arch
Copy link
Author

螢幕擷取畫面 2026-01-30 141559

@Hannahjjj97
Copy link
Contributor

螢幕擷取畫面 2026-01-30 141559

Merge is blocked 是因為還沒審過喔😀
所以你如果修改好要我再看一次,要再 request review 一次嘿,然後我會叫你改東西,改完,我審過,才可以 merge 嘿

Copy link
Contributor

@Hannahjjj97 Hannahjjj97 left a comment

Choose a reason for hiding this comment

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

總共要有三個馬達喔

Copy link
Contributor

@Hannahjjj97 Hannahjjj97 left a comment

Choose a reason for hiding this comment

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

調仰角的地方有裝 encoder,可以補一下

Copy link
Contributor

@Hannahjjj97 Hannahjjj97 left a comment

Choose a reason for hiding this comment

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

Encoder 要用 DutyCycleEncoder 這個類別喔,你可以自己新增 method,可以一次伸出來跟一次收進去的 method

Copy link
Member

@kennhung kennhung left a comment

Choose a reason for hiding this comment

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

我有留一個建議,可以看看要不要改

private final SparkMax pivotLeft = new SparkMax(11, MotorType.kBrushless);
private final SparkMax pivotRight = new SparkMax(12, MotorType.kBrushless);
private final DutyCycleEncoder pivotEncoder = new DutyCycleEncoder(4);
private final SparkMaxConfig config = new SparkMaxConfig();
Copy link
Member

Choose a reason for hiding this comment

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

這個 config 只是用來設定 SparkMax,建議可以直接在 constructor 裡面定義就好。

@BrianHu0925
Copy link

AmLib-2026.0.1.json 這個 vendordrop 好像沒用到?我看前面也有提到 不會用到的話記得刪掉

@j110396-arch j110396-arch requested a review from kennhung January 31, 2026 15:19
Copy link
Contributor

@Hannahjjj97 Hannahjjj97 left a comment

Choose a reason for hiding this comment

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

要把 vendor 刪掉然後從 main merge 進來喔

@Hannahjjj97
Copy link
Contributor

你什麼時候會去實驗室呀

@BrianHu0925
Copy link

BrianHu0925 commented Feb 1, 2026

你在 configure 的地方用的是已經 deprecated 的 method 喔 記得修掉

Comment on lines +77 to +78
SmartDashboard.putNumber("Pivot Absolute Pos", getPivotAbsolutePosition());
SmartDashboard.putBoolean("Pivot Encoder Connected", pivotEncoder.isConnected());

Choose a reason for hiding this comment

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

DashBoard 的命名方式確定了記得更改一下喔


private void intake() {

intakeMotor.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters);
Copy link
Member

Choose a reason for hiding this comment

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

這個縮排問題要記得修正喔


intakeMotor.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters);
pivotLeft.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters);
pivotRight.configure(config, SparkMax.ResetMode.kResetSafeParameters, SparkMax.PersistMode.kPersistParameters);
Copy link
Member

Choose a reason for hiding this comment

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

@BrianHu0925 說過的,configure 已經被標注為 depercated,代表這個 API 即將被刪除。(他的 warning 訊息中有說明)

The method configure(SparkBaseConfig, SparkBase.ResetMode, SparkBase.PersistMode) from the type SparkMax has been deprecated since version 2026 and marked for removal.

Comment on lines 21 to 44
private void configureBindings() {

// 按住A鍵吸球放開停止
driverController.a().whileTrue(
new RunCommand(() -> intakeSubsystem.intake(), intakeSubsystem)
).onFalse(new InstantCommand(() -> intakeSubsystem.stopIntake(), intakeSubsystem));

// 按住B鍵反轉放開停止
driverController.b().whileTrue(
new RunCommand(() -> intakeSubsystem.reverseIntake(), intakeSubsystem)
).onFalse(new InstantCommand(() -> intakeSubsystem.stopIntake(), intakeSubsystem));

// ------------------- Pivot 角度控制 -------------------

// 按住 Y 鍵抬起放開停止
driverController.y().whileTrue(
new RunCommand(() -> intakeSubsystem.rotateUp(), intakeSubsystem)
).onFalse(new InstantCommand(() -> intakeSubsystem.stopRotate(), intakeSubsystem));

// 按住 X鍵放下放開停止
driverController.x().whileTrue(
new RunCommand(() -> intakeSubsystem.rotateDown(), intakeSubsystem)
).onFalse(new InstantCommand(() -> intakeSubsystem.stopRotate(), intakeSubsystem));
}

Choose a reason for hiding this comment

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

這是你自己寫的嗎?我們正式不會這樣寫喔,會使用簡易 command。然後請先處理尚未解決的問題

@BrianHu0925
Copy link

deprecated 的 method 記得修掉喔

Copy link
Member

@kennhung kennhung left a comment

Choose a reason for hiding this comment

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

請修正有留言的問題,RobotContainer 不應該在這個分支被修改(現在多了一個空行)

public class Constants {

public final class Constants {
public static final class IntakeConstants {
Copy link
Member

Choose a reason for hiding this comment

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

請修正這邊的縮排問題

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.

4 participants