10390 FRC Programming
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.

      Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

      Explore these features while you wait
      Complete general settings
      Bookmark and like published notes
      Write a few more notes
      Complete general settings
      Write a few more notes
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note No publishing access yet

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.

    Your account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Your team account was recently created. Publishing will be available soon, allowing you to share notes on your public page and in search results.

    Explore these features while you wait
    Complete general settings
    Bookmark and like published notes
    Write a few more notes
    Complete general settings
    Write a few more notes
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # FRC PathPlanner > PathPlanner 是一套圖形化軌跡規劃工具,搭配 WPILib 可讓你的機器人在 Autonomous 模式下精確行走預先規劃的路徑。 --- ## PathPlanner 是什麼? PathPlanner 是 FRC 社群開發的軟體,可讓你: - 透過 GUI 畫出機器人移動路徑 - 自動處理機器人加減速、曲線、旋轉角度 - 支援 *Event markers* (標記比賽影片或即時控制流程中的關鍵事件(如得分、犯規、物件拾取),方便賽後回顧與分析)、*Choreo* (進階路徑規劃工具) 整合、Alliance Flipping (自動將路徑或座標依據紅藍方進行鏡像轉換,確保相同程式碼在不同聯盟中也能正確運行,減少重複開發與錯誤風險) 等功能 - 與 WPILib 完美整合,支援 Swerve、Tank驅動 --- ## 安裝與使用 ### 安裝 PathPlanner - 前往 GitHub Release (或microsoft store) 下載最新版: [https://github.com/mjansen4857/pathplanner/releases](https://github.com/mjansen4857/pathplanner/releases) - 解壓縮後打開 `PathPlanner.exe`(Windows)或執行對應平台的檔案 --- ### 基本操作教學 - **新增路徑**:點選左側 `New Path` - **控制點(Waypoint)**:點選畫面新增,拖曳調整位置 - **機器人朝向**:控制點上的綠色箭頭為面朝方向,可拖動調整 - **事件標記(Event Marker)**:可用於自動執行指定命令(例如吸入、射出等) - **儲存路徑**:路徑會儲存在 `/src/main/deploy/pathplanner` 資料夾下(JSON) --- ## Java 專案整合教學(2025 WPILib) ### `build.gradle` 加入 PathPlanner Library #### 確認 `build.gradle` 有包含以下依賴 ( 通常會自動有 ): ```groovy dependencies { implementation 'com.pathplanner.lib:pathplanner-lib:2024.2.2' // 確認為最新版 } ``` 然後重新同步 Gradle。 #### 新增路徑與事件命令 - 路徑載入 ```java import com.pathplanner.lib.auto.AutoBuilder; import com.pathplanner.lib.path.PathPlannerPath; import com.pathplanner.lib.commands.PathPlannerAuto; // 單一路徑 PathPlannerPath path = PathPlannerPath.fromPathFile("TestPath"); Command followPath = AutoBuilder.followPath(path); ``` - 多段 + 事件點(推薦使用 AutoBuilder) ```java // 將 GUI 中指定的事件名稱與 Command 連結起來 AutoBuilder.configureEventCommands(Map.of( "Shoot", new ShootCommand(), "Intake", new IntakeCommand() ), /* requireAll */ true); // 從路徑名稱建立完整 Autonomous Command Command auto = new PathPlannerAuto("Center4NoteAuto"); auto.schedule(); ``` ## AutoBuilder 快速整合 Swerve(以 SwerveDrivePoseEstimator 為例) ```java AutoBuilder.configureHolonomic( this::getPose, // 回傳目前機器人 Pose2d this::resetPose, // 設定 Pose2d this::getSpeeds, // 回傳 ChassisSpeeds this::drive, // 控制輸出 ChassisSpeeds new HolonomicPathFollowerConfig( new PIDConstants(5.0, 0.0, 0.0), // Translation PID new PIDConstants(3.0, 0.0, 0.0), // Rotation PID 4.5, // Max module speed (m/s) 0.5, // Drive base radius (m) ReplanningConfig.defaultConfig() ), () -> DriverStation.getAlliance().orElse(Alliance.Red) == Alliance.Red, this ); ``` --- ## 檔案位置與命名規則 - 路徑通常在:`src/main/deploy/pathplanner/<your-path>.path`(為自動創建的) - 自動模式名稱建議:以 XNoteAuto、Left3Piece 等命名清楚表示功能 - 路徑名稱建議:依照官方/自訂的場地/遊戲物件代號命名,例如CoralStation_ReefK (CS_RK) - 不需手動加進 Java 專案,PathPlannerAuto 會自動讀取 --- ## 實作範例(Swerve) ```java @Override public void autonomousInit() { Command auto = new PathPlannerAuto("Center4NoteAuto"); if (auto != null) auto.schedule(); } ``` 或搭配 Shuffleboard 選擇面板: ```java SendableChooser<Command> autoChooser = AutoBuilder.buildAutoChooser(); SmartDashboard.putData("Auto Mode", autoChooser); ``` --- ### 學習資源與教學 #### 官方: Pathplanner Doc: https://pathplanner.dev/home.html #### YouTube: PathPlanner AutoBuilder 教學: https://www.youtube.com/watch?v=8dF20oKuVJo --- ### 常見錯誤排除 |問題 |解法| |----|----| |無法讀取路徑| 確認 JSON 檔放在 src/main/deploy/pathplanner| |機器人位置不準 |確保使用 Pose Estimation + 正確 IMU/Encoder 數據| 自動指令沒執行 |檢查 Event Marker 名稱拼寫是否與程式對應| 移動異常抖動| PID 設定過高、模組最大速度填錯或電池電壓不足| --- ### <font color="#f50"> ! 都看完了,我要回家 ! </font> ## [好](https://hackmd.io/ACI3uWclSO6rAX9mMNIxcQ)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password
    or
    Sign in via Facebook Sign in via X(Twitter) Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    By signing in, you agree to our terms of service.

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully