Skip to content

Tank drive#6

Open
tsen991007-bit wants to merge 14 commits intomainfrom
tank_drive
Open

Tank drive#6
tsen991007-bit wants to merge 14 commits intomainfrom
tank_drive

Conversation

@tsen991007-bit
Copy link
Collaborator

No description provided.

@Hannahjjj97
Copy link
Contributor

要不要把 command 和搖桿的程式都補上去,然後完整測試過可以跑再重新開 pr,不然現在只有 subsytem 和 constants 就算 merge 進去 main 也沒有什麼用。

import frc.robot.Constants;

public class DriveSubsystem extends SubsystemBase {
XboxController joy = new XboxController(Constants.ControllerConstants.port);
Copy link
Contributor

Choose a reason for hiding this comment

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

搖桿應該要定義在 RobotContainer 裡面
然後要用 CommandXboxController

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.

須再補上 Command

@Hannahjjj97
Copy link
Contributor

有測試過了嗎?


public class RobotContainer {
CommandXboxController joy = new CommandXboxController(Constants.ControllerConstants.port);

Copy link
Contributor

Choose a reason for hiding this comment

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

這邊是不是少了點程式
有 Command 了,可是沒有讓 Command 執行

Copy link
Contributor

Choose a reason for hiding this comment

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

可以把 DriveCmd 設成 defaultCommand

@tsen991007-bit
Copy link
Collaborator Author

有測試過了嗎?

還沒

add: DriveSubsystem setDefaultCommand

/** Creates a new DriveSubsystem. */
public DriveSubsystem() {
setDefaultCommand(new DriveCmd(DriveSubsystem.this));
Copy link
Contributor

Choose a reason for hiding this comment

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

這行要寫在 RobotContainer 裡面

@Hannahjjj97
Copy link
Contributor

這隻程式有實際跑過了嗎?要實際跑過並可以運行再開 PR 喔


/* You should consider using the more terse Command factories API instead https://docs.wpilib.org/en/stable/docs/software/commandbased/organizing-command-based.html#defining-commands */
public class DriveCmd extends Command {
CommandXboxController joy;
Copy link
Contributor

Choose a reason for hiding this comment

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

類別不是用 Joystick 就不要用 joy 當物件名拉,可以用 mainController controller 之類的

import frc.robot.commands.DriveCmd;

public class RobotContainer {
CommandXboxController joy = new CommandXboxController(Constants.ControllerConstants.port);
Copy link
Contributor

Choose a reason for hiding this comment

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

類別不是用 Joystick 就不要用 joy 當物件名拉,可以用 mainController controller 之類的

"edu.wpi.first.math.**.struct.*",
]
],
"java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx2G -Xms100m -Xlog:disable"
Copy link
Contributor

Choose a reason for hiding this comment

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

這啥啊 為什麼會需要改這個?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

因為上次開的時候有紅線

Copy link
Contributor

Choose a reason for hiding this comment

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

喔~原來是這樣 錯誤訊息寫了什麼ㄚ

Copy link
Contributor

Choose a reason for hiding this comment

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

啊怎麼刪掉了ㄚ

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

呃刪掉好像也沒事,之前測的時候也沒那些東西

build.gradle Outdated
annotationProcessor wpi.java.deps.wpilibAnnotations()
implementation wpi.java.deps.wpilib()
implementation wpi.java.vendor.java()
implementation 'com.ctre.phoenix:api-java'
Copy link
Contributor

Choose a reason for hiding this comment

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

這個又是什麼啊?為什麼要加?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

因為上次開的時候有紅線

Copy link
Contributor

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 Jan 4, 2026

Choose a reason for hiding this comment

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

誒這個好像也刪了 但我還是想確認一下當初加的時候是什麼錯誤訊息啊 還是已經忘了

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

忘了

@Hannahjjj97
Copy link
Contributor

星期三遇到的 package 問題,我剛剛在我電腦把 DriveSubsystem 加回 frc.robot.subsystems ,是可以編譯的欸,要不要再試試看

@Hannahjjj97
Copy link
Contributor

星期三遇到的 package 問題,我剛剛在我電腦把 DriveSubsystem 加回 frc.robot.subsystems ,是可以編譯的欸,要不要再試試看

這個現在在你電腦上跑是好的嗎

@Hannahjjj97
Copy link
Contributor

星期三遇到的 package 問題,我剛剛在我電腦把 DriveSubsystem 加回 frc.robot.subsystems ,是可以編譯的欸,要不要再試試看

這個現在在你電腦上跑是好的嗎

是的話才改喔 不然就維持原狀 找到問題之後再改

@tsen991007-bit
Copy link
Collaborator Author

星期三遇到的 package 問題,我剛剛在我電腦把 DriveSubsystem 加回 frc.robot.subsystems ,是可以編譯的欸,要不要再試試看

這個現在在你電腦上跑是好的嗎

可以編譯

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.

2 participants