Skip to content

Commit

Permalink
Merge branch 'mjansen4857:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Ammelll authored Feb 8, 2025
2 parents 554542c + ce94d1e commit a519473
Show file tree
Hide file tree
Showing 113 changed files with 3,921 additions and 1,068 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build-pplib-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
fail-fast: false
matrix:
include:
- container: wpilib/roborio-cross-ubuntu:2024-22.04
- container: wpilib/roborio-cross-ubuntu:2025-22.04
artifact-name: PPLib-Athena
build-options: "-Ponlylinuxathena"
- container: wpilib/ubuntu-base:22.04
artifact-name: PPLib-Linux
build-options: "-Ponlylinuxx86-64"
- container: wpilib/raspbian-cross-ubuntu:bullseye-22.04
- container: wpilib/raspbian-cross-ubuntu:bookworm-22.04
artifact-name: PPLib-Arm32
build-options: "-Ponlylinuxarm32"
- container: wpilib/aarch64-cross-ubuntu:bullseye-22.04
- container: wpilib/aarch64-cross-ubuntu:bookworm-22.04
artifact-name: PPLib-Arm64
build-options: "-Ponlylinuxarm64"
name: "[PPLib] Build - ${{ matrix.artifact-name }}"
Expand Down Expand Up @@ -56,6 +56,8 @@ jobs:
path: pathplannerlib/build/allOutputs

build-host:
env:
MACOSX_DEPLOYMENT_TARGET: 13.3
strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.24.4
flutter-version: 3.27.1
cache: true
cache-path: ${{ runner.tool_cache }}/flutter/linux

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pathplanner-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
required: true

env:
FLUTTER_VERSION: 3.24.4
FLUTTER_VERSION: 3.27.1

jobs:
formatting-analysis:
Expand All @@ -34,15 +34,15 @@ jobs:

- name: Get dependencies
run: flutter pub get

- name: Check formatting
run: dart format -o none --set-exit-if-changed lib/* test/*

- name: Generate mocks
run: dart run build_runner build

- name: Analyze
run: flutter analyze

- name: Check formatting
run: dart format -o none --set-exit-if-changed lib/* test/*

test:
name: "[GUI] Run Tests"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pplib-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,16 @@ jobs:
fail-fast: false
matrix:
include:
- container: wpilib/roborio-cross-ubuntu:2024-22.04
- container: wpilib/roborio-cross-ubuntu:2025-22.04
artifact-name: PPLib-Athena
build-options: "-Ponlylinuxathena"
- container: wpilib/ubuntu-base:22.04
artifact-name: PPLib-Linux
build-options: "-Ponlylinuxx86-64"
- container: wpilib/raspbian-cross-ubuntu:bullseye-22.04
- container: wpilib/raspbian-cross-ubuntu:bookworm-22.04
artifact-name: PPLib-Arm32
build-options: "-Ponlylinuxarm32"
- container: wpilib/aarch64-cross-ubuntu:bullseye-22.04
- container: wpilib/aarch64-cross-ubuntu:bookworm-22.04
artifact-name: PPLib-Arm64
build-options: "-Ponlylinuxarm64"
name: "[PPLib] Build - ${{ matrix.artifact-name }}"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Download from the Microsoft Store to receive auto-updates for stable releases. Manual installs and pre-releases can be found [here](https://github.com/mjansen4857/pathplanner/releases).

## About
![PathPlanner](https://github.com/mjansen4857/pathplanner/assets/9343077/a395bdb4-71f9-4d88-9ff7-55241b26f4de)
![PathPlanner](https://github.com/user-attachments/assets/5b87c1a4-8fdb-4eb9-bf29-71f79a826a82)


PathPlanner is a motion profile generator for FRC robots created by team 3015. The main features of PathPlanner include:
Expand Down
Binary file modified Writerside/images/cover.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/project_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Writerside/images/vendor_dep_manager.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Writerside/topics/Home.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Download from
the [Microsoft Store](https://www.microsoft.com/en-us/p/frc-pathplanner/9nqbkb5dw909?cid=storebadge&ocid=badge&rtc=1&activetab=pivot:overviewtab)
or the [Mac App Store](https://apps.apple.com/us/app/frc-pathplanner/id1593046876) to receive auto-updates. Manual
to receive auto-updates. Manual
installs can be found [here](https://github.com/mjansen4857/pathplanner/releases).

![](cover.png)
Expand Down
2 changes: 1 addition & 1 deletion Writerside/topics/gui-Project-Browser.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Project Browser

![](cover.png)
![](project_page.png)

The project browser is the main screen of PathPlanner and allows you to manage your path/auto files as well as open them
for editing. The project browser is split in two, with paths on the left and autos on the right. The relative sizes of
Expand Down
4 changes: 2 additions & 2 deletions Writerside/topics/pplib-Build-an-Auto.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class SwerveSubsystem(Subsystem):
config = RobotConfig.fromGUISettings()

# Configure the AutoBuilder last
AutoBuilder.configureHolonomic(
AutoBuilder.configure(
self.getPose, # Robot pose supplier
self.resetPose, # Method to reset odometry (will be called if your auto has a starting pose)
self.getRobotRelativeSpeeds, # ChassisSpeeds supplier. MUST BE ROBOT RELATIVE
Expand Down Expand Up @@ -283,7 +283,7 @@ class DriveSubsystem(Subsystem):
config = RobotConfig.fromGUISettings()

# Configure the AutoBuilder last
AutoBuilder.configureHolonomic(
AutoBuilder.configure(
self.getPose, # Robot pose supplier
self.resetPose, # Method to reset odometry (will be called if your auto has a starting pose)
self.getRobotRelativeSpeeds, # ChassisSpeeds supplier. MUST BE ROBOT RELATIVE
Expand Down
31 changes: 14 additions & 17 deletions Writerside/topics/pplib-Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,19 @@
<tabs>
<tab title="Java/C++">

PathPlannerLib can be added to your robot code project using the "Install New Libraries (online)" feature in VSCode
using the following JSON file URL:
The easiest way to install PathPlannerLib is to find and install it via the WPILib Vendor Dependency Manager in VSCode.

> **Note**
>
> The main PathPlannerLib json file will not be updated for beta versions. To use the beta, you will need to use the
> beta json file below. Once PathPlannerLib is fully released after kickoff, you will need to switch back to the main
> vendor json file.
>
{style="note"}
![](vendor_dep_manager.png)

Alternatively, PathPlannerLib can be added to your robot code project using the "Install New Libraries (online)" feature
in VSCode using the following JSON file URL:

<br/>

```text
https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib.json
```

**Beta Version**

To install the beta version of PathPlannerLib, use the following vendor json file

```text
https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib-beta.json
```

**Legacy Versions**

The following legacy PathPlannerLib json files can be used to install the last release from previous years for
Expand Down Expand Up @@ -61,6 +49,15 @@ https://3015rangerrobotics.github.io/pathplannerlib/PathplannerLib2022.json

The Python version is compatible with RobotPy and available to install from PyPI via the `pip` command

> **Warning**
>
> If using a RoboRIO 1, you must disable the NI webserver via `robotpy installer niweb disable` in order to ensure there
> is enough available memory.
>
> If you need to re-image your rio, you will need to re-enable the webserver.
>
{style="warning"}

<br/>

```text
Expand Down
108 changes: 102 additions & 6 deletions Writerside/topics/pplib-Swerve-Setpoint-Generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,8 @@ This improves on the original version in a few ways:
* Friction within the module itself is taken into account, which decreases maximum acceleration but increases maximum
deceleration

> **Note**
>
> This feature is only available in PathPlannerLib Java. If you would like to see this feature in PPLib C++ or Python,
> feel free to open a pull request to translate it to your language.
>
{style="note"}
<tabs group="pplib-language">
<tab title="Java" group-key="java">

```Java
public class SwerveSubsystem extends Subsystem {
Expand Down Expand Up @@ -70,3 +66,103 @@ public class SwerveSubsystem extends Subsystem {
}
}
```

</tab>

<tab title="C++" group-key="cpp">

```C++
#include <pathplanner/lib/config/RobotConfig.h>
#include <pathplanner/lib/util/swerve/SwerveSetpointGenerator.h>
#include <pathplanner/lib/util/swerve/SwerveSetpoint.h>
#include <frc/geometry/Pose2d.h>
#include <frc/kinematics/ChassisSpeeds.h>

using namespace pathplanner;

SwerveSubsystem::SwerveSubsystem(){
// All other subsystem initialization
// ...

// Load the RobotConfig from the GUI settings. You should probably
// store this in your Constants file
RobotConfig config = RobotConfig::fromGUISettings();

setpointGenerator = SwerveSetpointGenerator(
config,
10_rad_per_s
);

// Initialize the previous setpoint to the robot's current speeds & module states
frc::ChassisSpeeds currentSpeeds = getCurrentSpeeds(); // Method to get current robot-relative chassis speeds
std::vector<frc::SwerveModuleState> currentStates = getCurrentModuleStates(); // Method to get the current swerve module states
previousSetpoint = SwerveSetpoint(currentSpeeds, currentStates, DriveFeedforwards::zeros(config.numModules));
}

/**
* This method will take in desired robot-relative chassis speeds,
* generate a swerve setpoint, then set the target state for each module
*
* @param speeds The desired robot-relative speeds
*/
void SwerveSubsystem::driveRobotRelative(frc::ChassisSpeeds speeds) {
// Note: it is important to not discretize speeds before or after
// using the setpoint generator, as it will discretize them for you
previousSetpoint = setpointGenerator.generateSetpoint(
previousSetpoint, // The previous setpoint
speeds, // The desired target speeds
0.02_s // The loop time of the robot code, in seconds
);
setModuleStates(previousSetpoint.moduleStates()); // Method that will drive the robot given target module states
}
```
</tab>
<tab title="Python" group-key="python">
```Python
from pathplannerlib.config import RobotConfig
from pathplannerlib.util import DriveFeedforwards
from pathplannerlib.util.swerve import SwerveSetpoint, SwerveSetpointGenerator
from wpimath.kinematics import ChassisSpeeds
from wpimath.units import rotationsToRadians
class SwerveSubsystem(Subsystem):
def __init__(self):
# All other subsystem initialization
# ...
# Load the RobotConfig from the GUI settings. You should probably
# store this in your Constants file
config = RobotConfig.fromGUISettings()
self.setpointGenerator = SwerveSetpointGenerator(
config, # The robot configuration. This is the same config used for generating trajectories and running path following commands.
rotationsToRadians(10.0) # The max rotation velocity of a swerve module in radians per second. This should probably be stored in your Constants file
)
# Initialize the previous setpoint to the robot's current speeds & module states
currentSpeeds = self.getCurrentSpeeds() # Method to get current robot-relative chassis speeds
currentStates = self.getCurrentModuleStates() # Method to get the current swerve module states
self.previousSetpoint = SwerveSetpoint(currentSpeeds, currentStates, DriveFeedforwards.zeros(config.numModules))
def driveRobotRelative(self, speeds: ChassisSpeeds):
"""
This method will take in desired robot-relative chassis speeds,
generate a swerve setpoint, then set the target state for each module
:param speeds: The desired robot-relative speeds
"""
# Note: it is important to not discretize speeds before or after
# using the setpoint generator, as it will discretize them for you
self.previousSetpoint = self.setpointGenerator.generateSetpoint(
self.previousSetpoint, # The previous setpoint
speeds, # The desired target speeds
0.02, # The loop time of the robot code, in seconds
)
self.setModuleStates(self.previousSetpoint.moduleStates) # Method that will drive the robot given target module states
```

</tab>
</tabs>
2 changes: 1 addition & 1 deletion examples/cpp/.wpilib/wpilib_preferences.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"enableCppIntellisense": true,
"currentLanguage": "cpp",
"projectYear": "2024",
"projectYear": "2025",
"teamNumber": 3015
}
2 changes: 1 addition & 1 deletion examples/cpp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "cpp"
id "google-test-test-suite"
id "edu.wpi.first.GradleRIO" version "2024.3.2"
id "edu.wpi.first.GradleRIO" version "2025.1.1"
}

// Define my targets (RoboRIO) and artifacts (deployable files)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 1.0,
"version": "2025.0",
"command": {
"type": "sequential",
"data": {
Expand Down
10 changes: 6 additions & 4 deletions examples/cpp/src/main/deploy/pathplanner/paths/Pickup.path
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 1.0,
"version": "2025.0",
"waypoints": [
{
"anchor": {
Expand All @@ -9,7 +9,7 @@
"prevControl": null,
"nextControl": {
"x": 3.820494796624656,
"y": 1.2776543621065768
"y": 1.2776543621065766
},
"isLocked": false,
"linkedName": null
Expand All @@ -21,7 +21,7 @@
},
"prevControl": {
"x": 5.891321406971974,
"y": 0.8077125277685265
"y": 0.8077125277685268
},
"nextControl": null,
"isLocked": false,
Expand Down Expand Up @@ -55,7 +55,9 @@
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
Expand Down
6 changes: 4 additions & 2 deletions examples/cpp/src/main/deploy/pathplanner/paths/Score.path
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 1.0,
"version": "2025.0",
"waypoints": [
{
"anchor": {
Expand Down Expand Up @@ -82,7 +82,9 @@
"maxVelocity": 3.0,
"maxAcceleration": 3.0,
"maxAngularVelocity": 540.0,
"maxAngularAcceleration": 720.0
"maxAngularAcceleration": 720.0,
"nominalVoltage": 12.0,
"unlimited": false
},
"goalEndState": {
"velocity": 0,
Expand Down
Loading

0 comments on commit a519473

Please sign in to comment.