---
# System prepended metadata

title: 2025 FRC Robot Code
tags: [FRC 2025, Programming]

---

# 2025 FRC Robot Code

## 架構 (暫定)
    robot
      |— commands
          |— auto
              |— AutoCommand_1.java
              |— ......
          |— IntakeCommand_1.java
          |— ShooterCommand_1.java
          |— ConbinationCommand_1.java       // 組合鍵
          |— ConbinationCommand_2.java
          |— ......
      |— subsystems
          |— Intake.java
          |— Shooter.java
          |— ......
      |— modules
          |— SwerveModule.java
      |— utils
          |— divices
              |— BNO055.java
              |— Limelight.java  
              |— ......
          |— Tools.java           // static
          |— PID.java
          |— ......
      |— Status.java              // static
      |— Main.java
      |— Robot.java
      |— Constants.java
      |— Container.java

## 檔案、物件命名

|資料|命名方法| 
|-|-|
|資料夾|全小寫，空格加 ```_```|
|檔案|單字開頭全大寫|
|變數|全小寫，空格加 ```_```|
|函式名稱|駝峰式命名|
|常數 (Constants.java)|開頭+k、單字開頭全大寫|
|常數 (其他 class)|全小寫，空格加 ```_```|

## class 內部物件規定

### Subsystem
|動作|命名方法(範例)|
|-|-|
|設定馬達速度| ```public void set(double value) ```|
|底盤操作|```public void move(double joystick_x, double joystick_y)```|
|取值|```public 值的型態 getValue()``` "Value" 為目標的名稱|
|設定角度|```public void toAngle(double angle)``` |

|值|命名方法(範例)|
|-|-|
|馬達| ```private CANSparkMax left_motor{0, MotorType.Brushed} ``` |
|值|```private double joystick_x, joystick_y```、``` private double current_angle```|
|工具|```private PID pid = new PID(1, 0, 0)```|

### Command

|值|命名方法(範例)|
|-|-|
|Subsystem| ```private Shooter shooter ```|
|函式物件|```private Supplier<型態> joystick_value```|

建構子(範例):
    
    public ShootWithoutAimming(Shooter shooter, Supplier<Double> joystick_value) {
        this.shooter = shooter;
        this.joystick_value = joystick_value;
        addRequiredment(this.shooter);
    } 

## 2025/01/20~27目標:
- Photon vision 單台&多台
- Swerve 底盤
- Path planner路徑 & 自動