Skip to content

Commit

Permalink
Merge branch 'main' into editing-paths-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
shueja authored Jan 1, 2025
2 parents 2ed39f3 + f9d4ca4 commit d61afa7
Show file tree
Hide file tree
Showing 65 changed files with 643 additions and 513 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/choreo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}

- uses: pnpm/action-setup@v4
with:
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/choreolib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
with:
submodules: true
fetch-depth: 0
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}

- name: Fetch all history and metadata
run: |
Expand Down Expand Up @@ -87,6 +89,8 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}

- name: Fetch all history and metadata
run: git fetch --prune --unshallow
Expand Down Expand Up @@ -128,6 +132,9 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}

- uses: actions/upload-artifact@v4
with:
Expand All @@ -142,11 +149,39 @@ jobs:
- uses: actions/checkout@v4
with:
repository: wpilibsuite/build-tools
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}

- uses: actions/download-artifact@v4
with:
path: combiner/products/build/allOutputs

- name: Generate a token
if: startsWith(github.ref, 'refs/tags/v')
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CHOREOLIB_RELEASE_APP_ID }}
private-key: ${{ secrets.CHOREOLIB_RELEASE_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: Checkout ChoreoLib repository
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/checkout@v4
with:
repository: SleipnirGroup/ChoreoLib
path: ChoreoLib
token: ${{ steps.generate-token.outputs.token }}
persist-credentials: false

- name: Copy ChoreoLib JSON
if: startsWith(github.ref, 'refs/tags/v')
run: |
cp combiner/products/build/allOutputs/ChoreoLib-json/ChoreoLib2025Beta.json ChoreoLib/dep/ChoreoLib2025Beta.json
- name: Remove JSON Artifact From Download
run: rm combiner/products/build/allOutputs/ChoreoLib-json/ChoreoLib2025Beta.json

- name: Flatten Artifacts
run: rsync -a --delete combiner/products/build/allOutputs/*/* combiner/products/build/allOutputs

Expand All @@ -158,6 +193,22 @@ jobs:
- name: Combine
run: ./gradlew publish -Pthirdparty
working-directory: combiner

- name: Transfer ChoreoLib Artifacts
if: startsWith(github.ref, 'refs/tags/v')
run: cp -r ~/releases/maven/development/choreo/* ChoreoLib/dep/choreo

- name: Create Pull Request
if: startsWith(github.ref, 'refs/tags/v')
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
path: ./ChoreoLib
title: Add ChoreoLib ${{github.ref_name}}
commit-message: Add ChoreoLib ${{github.ref_name}}
body:
branch: publish-${{github.ref_name}}

- uses: actions/upload-artifact@v4
with:
name: ChoreoLib-Maven
Expand All @@ -170,6 +221,8 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}

- uses: actions/setup-python@v5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
restore-keys: |
mkdocs-material-
- run: pip install mkdocs-material
- run: pip install -r docs/requirements.txt

- name: Install Doxygen
run: |
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}

- name: Fetch all history and metadata
run: |
Expand Down Expand Up @@ -54,7 +56,7 @@ jobs:
with:
python-version: 3.12

- run: pip3 install wpiformat==2024.50
- run: pip3 install wpiformat==2024.51

- run: pnpm run fmt

Expand Down Expand Up @@ -86,7 +88,9 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

with:
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}
- uses: pnpm/action-setup@v4
with:
version: 9
Expand All @@ -105,6 +109,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}
fetch-depth: 0

- name: Fetch all history and metadata
Expand All @@ -117,7 +123,7 @@ jobs:
with:
python-version: 3.12

- run: pip3 install wpiformat==2024.50
- run: pip3 install wpiformat==2024.51

- name: Create compile_commands.json
working-directory: choreolib
Expand All @@ -144,6 +150,8 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}
fetch-depth: 0

- name: Fetch all history and metadata
Expand All @@ -167,7 +175,7 @@ jobs:
echo "CXX=clang++" >> $GITHUB_ENV
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
- run: pip3 install wpiformat==2024.50
- run: pip3 install wpiformat==2024.51

- name: Create compile_commands.json
run: cmake -B build -S . -DCMAKE_EXPORT_COMPILE_COMMANDS=YES
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@ jobs:
runs-on: ubuntu-22.04
container: ${{ matrix.container }}
steps:
- name: Generate a token
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.CHOREOLIB_RELEASE_APP_ID }}
private-key: ${{ secrets.CHOREOLIB_RELEASE_APP_PRIVATE_KEY }}

- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
token: ${{ secrets.CHOREO_RELEASE_PAT }}
token: ${{ steps.generate-token.outputs.token }}

- name: Install Python dependencies
run: pip install tomlkit

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/trajoptlib-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}

- name: Install dependencies (Windows)
uses: lukka/[email protected]
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/trajoptlib-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}

- name: Install dependencies (Windows)
uses: lukka/[email protected]
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/trajoptlib-sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
token: ${{secrets.GITHUB_TOKEN}}

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y ninja-build
Expand Down
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions choreolib/ChoreoLib2025Beta.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"fileName": "ChoreoLib2025Beta.json",
"name": "ChoreoLib",
"version": "2025.0.0-beta-7",
"version": "2025.0.0-beta-9",
"uuid": "b5e23f0a-dac9-4ad2-8dd6-02767c520aca",
"frcYear": "2025",
"mavenUrls": [
Expand All @@ -13,7 +13,7 @@
{
"groupId": "choreo",
"artifactId": "ChoreoLib-java",
"version": "2025.0.0-beta-7"
"version": "2025.0.0-beta-9"
},
{
"groupId": "com.google.code.gson",
Expand All @@ -26,7 +26,7 @@
{
"groupId": "choreo",
"artifactId": "ChoreoLib-cpp",
"version": "2025.0.0-beta-7",
"version": "2025.0.0-beta-9",
"libName": "ChoreoLib",
"headerClassifier": "headers",
"sharedLibrary": false,
Expand Down
4 changes: 1 addition & 3 deletions choreolib/config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ nativeUtils.withCrossLinuxArm64()
nativeUtils {
wpi {
configureDependencies {
// TODO: Revert once WPILib releases 2025.1.1-beta-3
wpiVersion = "2025.1.1-beta-2-36-g882233b"
// wpiVersion = "2025.+"
wpiVersion = "2025.+"
niLibVersion = "2025.0.0"
}
}
Expand Down
4 changes: 1 addition & 3 deletions choreolib/py/choreo/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
from enum import Enum
from typing import *

from choreo.util.field_dimensions import FIELD_LENGTH, FIELD_WIDTH
from wpimath.geometry import Pose2d

FIELD_LENGTH = 16.5811
FIELD_WIDTH = 8.19912


class FlipperType(Enum):
MIRRORED = 0
Expand Down
3 changes: 3 additions & 0 deletions choreolib/py/choreo/util/field_dimensions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Auto-generated by update_field_dimensions.py
FIELD_LENGTH = 16.5811
FIELD_WIDTH = 8.19912
27 changes: 24 additions & 3 deletions choreolib/src/main/java/choreo/Choreo.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@ static void setChoreoDir(File choreoDir) {
* Trajectory}, {@link Boolean})->void, where the function consumes a trajectory and a boolean
* indicating whether the trajectory is starting or finishing.
*
* @param <SampleType> DifferentialSample or SwerveSample.
* @param <ST> {@link choreo.trajectory.DifferentialSample} or {@link
* choreo.trajectory.SwerveSample}
*/
public interface TrajectoryLogger<SampleType extends TrajectorySample<SampleType>>
extends BiConsumer<Trajectory<SampleType>, Boolean> {}
public interface TrajectoryLogger<ST extends TrajectorySample<ST>>
extends BiConsumer<Trajectory<ST>, Boolean> {}

/** Default constructor. */
private Choreo() {
Expand Down Expand Up @@ -106,6 +107,26 @@ Optional<Trajectory<SampleType>> loadTrajectory(String trajectoryName) {
return Optional.empty();
}

/**
* Fetches the names of all available trajectories in the deploy directory.
*
* @return A list of all available trajectory names.
*/
public static String[] availableTrajectories() {
List<String> trajectories = new ArrayList<>();
File[] files = CHOREO_DIR.listFiles();
if (files != null) {
for (File file : files) {
if (file.getName().endsWith(TRAJECTORY_FILE_EXTENSION)) {
trajectories.add(
file.getName()
.substring(0, file.getName().length() - TRAJECTORY_FILE_EXTENSION.length()));
}
}
}
return trajectories.toArray(new String[0]);
}

/**
* Load a trajectory from a string.
*
Expand Down
Loading

0 comments on commit d61afa7

Please sign in to comment.