Compare commits

...

65 Commits

Author SHA1 Message Date
Peter Johnson
4023cdc80a [ntcore] Fix EALREADY errors by tracking read state (#7202) 2024-10-13 00:14:16 -07:00
Gold856
12885015ed [cscore,hal] Remove VS 2019 16.4.0 workaround (#7201) 2024-10-11 22:18:12 -07:00
Gold856
f23bece791 [sysid] Remove unused dependency on libglassnt (#7200)
Also remove stale libuv references.
2024-10-11 22:05:32 -07:00
Gold856
7ebd45ef4d [sysid] Fix crash when all data is filtered out during analysis (#7199) 2024-10-11 21:51:56 -07:00
Peter Johnson
25c2e26ef8 [ntcore] Fix UID collisions between subscribers and multi-sub (#7198)
The changes in #7189 caused an ambiguity between multi-subscribers and
normal subscribers, because the handle type no longer is sent to the network.

Multi-subscribers now go to the network with negative UIDs, normal
subscribers are positive UIDs.  UID 0 is never used.
2024-10-11 21:39:55 -07:00
PJ Reiniger
f1e032f5e6 [examples] Fix cross project import (#7197) 2024-10-11 21:17:57 -07:00
Gold856
22a04bf470 [commands] Deprecate control commands and subsystems (#7143) 2024-10-11 19:48:47 -07:00
Peter Johnson
77ee9bdd30 [ntcore] Client: only connect to IPv4 addresses (#7195)
The server only binds to IPv6, so connection attempts to that are useless.
2024-10-11 17:05:09 -07:00
Peter Johnson
c6d801d2d6 [wpinet] ParallelTcpConnector: Add option to resolve only IPv4 addresses (#7194) 2024-10-11 16:42:59 -07:00
Peter Johnson
768fa5f973 [wpinet] libuv: Change GetAddrInfo hints parameter to optional (#7196)
This is clearer than passing a pointer.
2024-10-11 16:42:42 -07:00
Peter Johnson
a621cebbd6 [ntcore] Server round robin message processing (#7191)
Each client has an incoming queue of ClientMessage.

In the read callback:
- Parse and process only ping messages and a limited number of messages;
  anything else will get put into the queue and not processed
- If we queued some messages, we tell the network we stopped reading; this will
  result in back-pressure if we are reading too slowly.  We also start an idle
  handle to process the queued messages.

In the idle handle callback:
- For each client, process just a few pending messages.  This is performed in
  round-robin fashion across all clients with pending messages
- When a client's queue becomes empty, we re-enable the network read
- When all client queues are empty, we stop the idle handle (so we don't spin)

For local client processing, we use round-robin processing for most cases (including FlushLocal),
but still do batch processing of all local changes for explicit network Flush() calls.
2024-10-11 16:26:56 -07:00
Peter Johnson
8870d98f80 [upstream_utils] Revert upgrade to libuv 1.49.0
This reverts commit eab93f4fdc (#7129).

There's broken behavior in getaddrinfo.
2024-10-11 16:13:15 -07:00
Peter Johnson
2d6f02d15b [glass] Check for struct descriptor size 0 (#7192)
This avoids a potential divide by 0.
2024-10-11 16:09:32 -07:00
Peter Johnson
96f0b2482c [ntcore] Unify NetworkInterface and MessageHandler (#7190) 2024-10-11 14:38:02 -07:00
Peter Johnson
8ca99c7cb7 [ntcore] Change internal interfaces and messages to use UIDs (#7189)
Also make Handle functions constexpr.
2024-10-11 10:57:36 -07:00
Peter Johnson
59bc53b9b8 [ntcore] Add StopRead/StartRead to WireConnection (#7188) 2024-10-11 10:51:12 -07:00
Peter Johnson
94c62ed3ec [wpiutil] Add FastQueue (#7075)
This is a heavily modified version of https://github.com/cameron314/readerwriterqueue that removes
all atomics and barriers.
2024-10-11 10:49:29 -07:00
Gold856
28cb7cf757 [examples] Add ProfiledPID command to RapidReactCommandBot (#7030) 2024-10-11 08:43:24 -07:00
Peter Johnson
dcf5f55a30 [upstream_utils] Remove ConcurrentQueue (#7183)
It appears to be broken under stress testing (dropped/duplicate values).

This reverts commit 97c6c86f3b (#7066).
2024-10-10 23:41:41 -07:00
Peter Johnson
f65f9ed693 [wpiutil] Add rotated_span (#7111) 2024-10-10 23:36:26 -07:00
Jade
8f57e4c566 [documentation] Remove more outdated commands examples (#7054)
There are still some examples we'd like to remove here (eg Hatchbot
traditional) but this is a good start with not too many changes required
in frc-docs.
2024-10-10 23:09:11 -07:00
Gold856
37e7bfe4f9 [build] Add docs for generated files (#6878) 2024-10-10 22:20:45 -07:00
Jade
679892e8e1 [commands, documentation] Remove controller replaceme commands (#7053) 2024-10-10 22:12:02 -07:00
Nicholas Armstrong
4adfa8bf64 [wpimath] Fully discretized ElevatorFF and ArmFF (#7024)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2024-10-10 22:10:45 -07:00
Nicholas Armstrong
5d9a553104 [wpilib] DCMotorSim cleanup/enhancement (#7021)
Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2024-10-10 22:09:22 -07:00
Nicholas Armstrong
5acb4109ff [examples] Fix flaky ArmSimulationTest (#7170)
Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
2024-10-10 22:07:52 -07:00
Ryan Blue
fc83d4868c [hal] Fix CAN ID validation and reporting for CTRE and REV devices (#7178)
REV: 1-63, 63 devices
CTRE: 0-62, 63 devices
2024-10-10 22:06:53 -07:00
Ryan Blue
a65f6b94ee [hal] Radio LED: Properly close files and improve error messages (#7181) 2024-10-10 22:06:19 -07:00
Bryce Roethel
d97a749d84 [wpimath] SwerveDrivePoseEstimator: Fix stationary module emitting error when calculating angle in ToSwerveModuleStates (#7175) 2024-10-10 22:05:49 -07:00
Sam Carlberg
2085ab3d47 [wpilib] Allow LED pattern gradients to be discontinuous (#7174) 2024-10-10 22:05:33 -07:00
Peter Johnson
0cfff31439 [ntcore] Fix use-after-free on connection termination (#7177)
The stream can close (e.g. due to an error) while in the middle of writing. The close callback would immediately destroy the connection object, resulting in the writing code having a use-after-free. Fix this by deferring the deletion to the loop main using a single-shot timer.
2024-10-10 22:03:55 -07:00
Thad House
a71cee1112 [build] Update to 2025 beta NI Libraries (#7182) 2024-10-10 22:03:29 -07:00
Nicholas Armstrong
968bdf0d06 [commands] Add deadband trigger methods to CommandGenericHID (#7085)
Co-authored-by: Joseph Eng <91924258+KangarooKoala@users.noreply.github.com>
2024-10-10 22:03:01 -07:00
Gold856
f150b36108 [wpiutil] Fix FileLogger behavior and performance (#7150)
Co-authored-by: Ryan Blue <ryanzblue@gmail.com>
2024-10-08 12:55:16 -06:00
Ryan Blue
f856c05a08 [ci] Add no-cache build workflow to detect potential false-positive cache hits (#7027)
Duplicate of gradle.yml without docs, caching, and release configurations.
It's set up to run off-peak weekly.
2024-10-04 18:24:23 -07:00
Ryan Blue
09a93b86dc [wpilibc] Add RadioLEDState docs to C++ (NFC) (#7158)
Add RadioLEDState docs for consistency with Java.
2024-10-04 18:22:31 -07:00
Tyler Veness
8102516300 [ci] Upgrade to wpiformat 2024.42 (#7165) 2024-10-04 13:55:10 -06:00
Ryan Blue
b541174255 [wpilib] Alert: fix incorrect set docs (NFC) (#7163)
Console printing was removed when Alerts were added to wpilib.
2024-10-03 23:20:53 -06:00
Sam Carlberg
9a7710ebd3 [wpiunits] Make Velocity.mult(Time) return Measure<D> (#7162)
Update code generator to allow arbitrary implementations of multiplication methods.
2024-10-03 23:19:36 -06:00
Ryan Blue
bc6553cd2b [ci] Fix cmake CI (#7159) 2024-10-03 18:22:39 -06:00
Jade
dced751a72 [ci] Merge Windows into CMake matrix (#7153) 2024-10-03 14:26:49 -06:00
Ryan Blue
83615c6024 [wpiutil] DataLogBackgroundWriter: Normalize empty path name (#7151)
An empty path isn't valid on it's own, so fs::space always returns an error. This results in UINT_MAX bytes being used instead of the actual free space, which means a default constructed DataLogBackgroundWriter won't stop for low space.

Using "." instead makes the directory path the current working directory, which is the desired behavior
2024-10-03 13:32:09 -06:00
Jade
a8a5d1609b [build] Name CMake presets more consistently (#7154) 2024-10-03 13:29:27 -06:00
Gold856
f82e1c9d48 [build] CMake: fix Windows build when WITH_PROTOBUF is false (#7147) 2024-10-02 10:20:43 -06:00
Jade
466a4a52fa [wpilibc] Fix missing symbols on Windows (#7140)
Windows doesn't support direct static variable access across library boundaries in a mixed static/shared environment, so change to accessor functions.
2024-10-01 08:46:06 -06:00
Nicholas Armstrong
fe80d72fba [wpimath] Add cosineScale method to SwerveModuleState and instance optimize (#7114) 2024-09-30 13:23:30 -06:00
Peter Johnson
fde264b041 [thirdparty] Add Roboto fonts (#7138) 2024-09-28 10:58:47 -07:00
Peter Johnson
95da92db04 [wpigui] Add "deep dark" style (#7133) 2024-09-28 10:58:29 -07:00
Peter Johnson
d389317c3a [thirdparty] Upgrade imgui fonts to latest versions (#7137) 2024-09-28 10:35:16 -07:00
Peter Johnson
50db16c0c0 [wpigui] Add font selector (#7134) 2024-09-28 10:34:59 -07:00
Benjamin Hall
6b1e656659 [wpimath] Add DCMotor.getCurrent() overload accepting torque (#7132) 2024-09-28 09:33:15 -07:00
Tyler Veness
eab93f4fdc [upstream_utils] Upgrade to libuv 1.49.0 (#7129) 2024-09-27 12:00:54 -07:00
Gold856
f0a1955fd7 Move generated files to more consistent locations (#6906)
Java templates always go under src/generate/main/java. JSON files go to src/generate.
2024-09-24 22:13:49 -07:00
Ryan Blue
b8ff3fcee2 [upstream_utils] StringMap: fix structured bindings with move-only types (#7127) 2024-09-24 22:11:41 -07:00
Gold856
69af7785f6 [gitignore] Add .clangd file to gitignore (#7122) 2024-09-24 09:20:21 -07:00
Nicholas Armstrong
6281ec0810 [wpimath] PIDController: Update field and method names for error and errorDerivative (#7088) 2024-09-23 11:57:20 -06:00
Gold856
64e5e6db59 [ci] Use one script to pregenerate everything (#7121)
A pregen_all Python script was added that calls all the other pregen scripts. This prevents the generated file checks and pregen command from falling out of sync. This is meant to only run in CI, since the script is not portable across platforms.
2024-09-23 11:54:59 -06:00
oh-yes-0-fps
180349bd06 [commands] Improve isScheduled to be more performant when checking a single command (#7096) 2024-09-23 11:54:37 -06:00
Gold856
22f086aba8 Fix app icons on Windows (#7116)
The SysId icon has a bunch of weird artifacting and it's not transparent on Windows. Some of the other icons have issues as well and all of them are inconsistent. GIMP was used to regenerate all the icons from the PNGs, using PNG compression on all the layers.
2024-09-22 23:54:23 -07:00
Gold856
84075997c6 [cscore] Fix Java VideoSink class doc (NFC) (#7120) 2024-09-22 22:12:36 -07:00
Gold856
ba1b97cd78 [wpilib] ADIS IMUs: Add back null checks (#7117)
* Revert "Move creation of objects to ctor"

This reverts commit b1d8001652.

* [wpilib] ADIS IMUs: Add back null checks
2024-09-22 18:05:09 -07:00
Tyler Veness
f93bacc5c5 [upstream_utils] Remove unused clone_repo() function (#7091) 2024-09-20 20:12:48 -07:00
Tyler Veness
38e246c34f [ci] Upgrade to wpiformat 2024.41 (#7112) 2024-09-20 18:41:33 -07:00
sciencewhiz
a884863f19 [ci] Fix RobotBuilder tools build (#7107)
Build more dependencies added by GradleRIO 2025 Alpha 2
2024-09-20 17:44:22 -07:00
Tyler Veness
554024767e Fix errors from new cpplint.py (#7105) 2024-09-20 17:43:39 -07:00
847 changed files with 42472 additions and 18875 deletions

View File

@@ -19,12 +19,16 @@ jobs:
- os: ubuntu-22.04
name: Linux
container: wpilib/roborio-cross-ubuntu:2024-22.04
flags: "--preset with-java-sccache -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON"
flags: "--preset with-java-and-sccache -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON"
- os: macOS-14
name: macOS
container: ""
env: "PATH=\"/opt/homebrew/opt/protobuf@3/bin:$PATH\""
flags: "--preset sccache -DCMAKE_BUILD_TYPE=Release -DWITH_JAVA=OFF -DWITH_EXAMPLES=ON -DCMAKE_LIBRARY_PATH=/opt/homebrew/opt/protobuf@3/lib -DProtobuf_INCLUDE_DIR=/opt/homebrew/opt/protobuf@3/include -DProtobuf_PROTOC_EXECUTABLE=/opt/homebrew/opt/protobuf@3/bin/protoc"
flags: "--preset with-sccache -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DCMAKE_LIBRARY_PATH=/opt/homebrew/opt/protobuf@3/lib -DProtobuf_INCLUDE_DIR=/opt/homebrew/opt/protobuf@3/include -DProtobuf_PROTOC_EXECUTABLE=/opt/homebrew/opt/protobuf@3/bin/protoc"
- os: windows-2022
name: Windows
container: ""
flags: '--preset with-sccache -DCMAKE_BUILD_TYPE=Release -DWITH_EXAMPLES=ON -DUSE_SYSTEM_FMTLIB=ON -DUSE_SYSTEM_LIBUV=ON -DUSE_SYSTEM_EIGEN=OFF -DCMAKE_TOOLCHAIN_FILE="$Env:RUNNER_WORKSPACE/vcpkg/scripts/buildsystems/vcpkg.cmake" -DVCPKG_INSTALL_OPTIONS=--clean-after-build -DVCPKG_TARGET_TRIPLET=x64-windows-release -DVCPKG_HOST_TRIPLET=x64-windows-release'
name: "Build - ${{ matrix.name }}"
runs-on: ${{ matrix.os }}
@@ -35,14 +39,28 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y libopencv-dev libopencv4.5-java libprotobuf-dev protobuf-compiler ninja-build
- name: Install dependencies (macOS)
run: brew install opencv protobuf@3 ninja
if: runner.os == 'macOS'
run: brew install opencv protobuf@3 ninja
- uses: ilammy/msvc-dev-cmd@v1.13.0
if: runner.os == 'Windows'
- name: Install CMake (Windows only)
if: runner.os == 'Windows'
uses: lukka/get-cmake@v3.29.3
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.5
- uses: actions/checkout@v4
- name: Run vcpkg (Windows only)
if: runner.os == 'Windows'
uses: lukka/run-vcpkg@v11.5
with:
vcpkgDirectory: ${{ runner.workspace }}/vcpkg
vcpkgGitCommitId: 37c3e63a1306562f7f59c4c3c8892ddd50fdf992 # HEAD on 2024-02-24
- name: configure
run: cmake ${{ matrix.flags }}
env:
@@ -56,42 +74,12 @@ jobs:
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: test
if: runner.os != 'Windows'
working-directory: build-cmake
run: ctest --output-on-failure
build-windows:
name: "Build - Windows"
runs-on: windows-2022
steps:
- uses: ilammy/msvc-dev-cmd@v1.13.0
- name: Install CMake
uses: lukka/get-cmake@v3.29.3
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.5
- uses: actions/checkout@v4
- name: Run vcpkg
uses: lukka/run-vcpkg@v11.5
with:
vcpkgDirectory: ${{ runner.workspace }}/vcpkg
vcpkgGitCommitId: 37c3e63a1306562f7f59c4c3c8892ddd50fdf992 # HEAD on 2024-02-24
- name: configure
run: cmake --preset sccache -DCMAKE_BUILD_TYPE=Release -DWITH_JAVA=OFF -DWITH_EXAMPLES=ON -DUSE_SYSTEM_FMTLIB=ON -DUSE_SYSTEM_LIBUV=ON -DUSE_SYSTEM_EIGEN=OFF -DCMAKE_TOOLCHAIN_FILE=${{ runner.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_INSTALL_OPTIONS=--clean-after-build -DVCPKG_TARGET_TRIPLET=x64-windows-release -DVCPKG_HOST_TRIPLET=x64-windows-release
env:
SCCACHE_WEBDAV_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: build
run: cmake --build build-cmake --parallel $(nproc)
env:
SCCACHE_WEBDAV_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: test
- name: test (windows)
if: runner.os == 'Windows'
working-directory: build-cmake
# UnitTest_test segfaults on exit occasionally
run: ctest --output-on-failure -E 'UnitTest'

View File

@@ -43,7 +43,7 @@ jobs:
distribution: 'temurin'
java-version: 17
- name: Install wpiformat
run: pip3 install wpiformat==2024.40
run: pip3 install wpiformat==2024.42
- name: Run wpiformat
run: wpiformat
- name: Run spotlessApply
@@ -89,20 +89,8 @@ jobs:
run: python -m pip install jinja2
- name: Install protobuf dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler && wget https://github.com/HebiRobotics/QuickBuffers/releases/download/1.3.3/protoc-gen-quickbuf-1.3.3-linux-x86_64.exe && chmod +x protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
- name: Run hal
run: ./hal/generate_usage_reporting.py
- name: Run ntcore
run: ./ntcore/generate_topics.py
- name: Run wpimath
run: ./wpimath/generate_numbers.py && ./wpimath/generate_quickbuf.py --quickbuf_plugin=protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
- name: Run HIDs
run: ./wpilibj/generate_hids.py && ./wpilibc/generate_hids.py && ./wpilibNewCommands/generate_hids.py
- name: Run PWM Controllers
run: ./wpilibj/generate_pwm_motor_controllers.py && ./wpilibc/generate_pwm_motor_controllers.py
- name: Run imgui gl3w
run: ./thirdparty/imgui_suite/generate_gl3w.py
- name: Run imgui fonts
run: ./thirdparty/imgui_suite/generate_fonts.sh
- name: Regenerate all
run: ./.github/workflows/pregen_all.py --quickbuf_plugin=protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
- name: Commit
run: |
# Set credentials

View File

@@ -27,7 +27,7 @@ jobs:
with:
python-version: '3.10'
- name: Install wpiformat
run: pip3 install wpiformat==2024.40
run: pip3 install wpiformat==2024.42
- name: Run
run: wpiformat
- name: Check output
@@ -66,7 +66,7 @@ jobs:
with:
python-version: '3.10'
- name: Install wpiformat
run: pip3 install wpiformat==2024.40
run: pip3 install wpiformat==2024.42
- name: Create compile_commands.json
run: |
./gradlew generateCompileCommands -Ptoolchain-optional-roboRio

40
.github/workflows/pregen_all.py vendored Executable file
View File

@@ -0,0 +1,40 @@
#!/usr/bin/env python3
import argparse
import subprocess
import sys
from pathlib import Path
def main(argv):
script_path = Path(__file__).resolve()
REPO_ROOT = script_path.parent.parent.parent
parser = argparse.ArgumentParser()
parser.add_argument(
"--quickbuf_plugin",
help="Path to the quickbuf protoc plugin",
required=True,
)
args = parser.parse_args(argv)
subprocess.run(["python", f"{REPO_ROOT}/hal/generate_usage_reporting.py"])
subprocess.run(["python", f"{REPO_ROOT}/ntcore/generate_topics.py"])
subprocess.run(["python", f"{REPO_ROOT}/wpimath/generate_numbers.py"])
subprocess.run(
[
"python",
f"{REPO_ROOT}/wpimath/generate_quickbuf.py",
f"--quickbuf_plugin={args.quickbuf_plugin}",
]
)
subprocess.run(["python", f"{REPO_ROOT}/wpiunits/generate_units.py"])
subprocess.run(["python", f"{REPO_ROOT}/wpilibc/generate_hids.py"])
subprocess.run(["python", f"{REPO_ROOT}/wpilibj/generate_hids.py"])
subprocess.run(["python", f"{REPO_ROOT}/wpilibNewCommands/generate_hids.py"])
subprocess.run(["python", f"{REPO_ROOT}/wpilibc/generate_pwm_motor_controllers.py"])
subprocess.run(["python", f"{REPO_ROOT}/wpilibj/generate_pwm_motor_controllers.py"])
subprocess.run(["python", f"{REPO_ROOT}/thirdparty/imgui_suite/generate_gl3w.py"])
subprocess.run(f"{REPO_ROOT}/thirdparty/imgui_suite/generate_fonts.sh")
if __name__ == "__main__":
main(sys.argv[1:])

View File

@@ -26,22 +26,8 @@ jobs:
run: python -m pip install jinja2
- name: Install protobuf dependencies
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler && wget https://github.com/HebiRobotics/QuickBuffers/releases/download/1.3.3/protoc-gen-quickbuf-1.3.3-linux-x86_64.exe && chmod +x protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
- name: Run hal
run: ./hal/generate_usage_reporting.py
- name: Run ntcore
run: ./ntcore/generate_topics.py
- name: Run wpimath
run: ./wpimath/generate_numbers.py && ./wpimath/generate_quickbuf.py --quickbuf_plugin=protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
- name: Run wpiunits
run: ./wpiunits/generate_units.py
- name: Run HIDs
run: ./wpilibj/generate_hids.py && ./wpilibc/generate_hids.py && ./wpilibNewCommands/generate_hids.py
- name: Run PWM Controllers
run: ./wpilibj/generate_pwm_motor_controllers.py && ./wpilibc/generate_pwm_motor_controllers.py
- name: Run imgui gl3w
run: ./thirdparty/imgui_suite/generate_gl3w.py
- name: Run imgui fonts
run: ./thirdparty/imgui_suite/generate_fonts.sh
- name: Regenerate all
run: python ./.github/workflows/pregen_all.py --quickbuf_plugin protoc-gen-quickbuf-1.3.3-linux-x86_64.exe
- name: Add untracked files to index so they count as changes
run: git add -A
- name: Check output

161
.github/workflows/sentinel-build.yml vendored Normal file
View File

@@ -0,0 +1,161 @@
name: Sentinel Build (No Cache)
on:
workflow_dispatch:
schedule:
- cron: "15 3 * * Sat" # 11:15PM EST every Friday
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-docker:
if: (github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main') || github.event_name != 'schedule'
strategy:
fail-fast: false
matrix:
include:
- container: wpilib/roborio-cross-ubuntu:2024-22.04
artifact-name: Athena
build-options: "-Ponlylinuxathena"
- container: wpilib/raspbian-cross-ubuntu:bullseye-22.04
artifact-name: Arm32
build-options: "-Ponlylinuxarm32"
- container: wpilib/aarch64-cross-ubuntu:bullseye-22.04
artifact-name: Arm64
build-options: "-Ponlylinuxarm64"
- container: wpilib/ubuntu-base:22.04
artifact-name: Linux
build-options: "-Ponlylinuxx86-64"
name: "Build - ${{ matrix.artifact-name }}"
runs-on: ubuntu-22.04
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: false
docker-images: false
swap-storage: false
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build with Gradle
uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.container }}
options: -v ${{ github.workspace }}:/work -w /work -e GITHUB_REF -e CI
run: df . && rm -f semicolon_delimited_script && echo $GITHUB_REF && ./gradlew build -PbuildServer -PskipJavaFormat ${{ matrix.build-options }}
- name: Check free disk space
run: df .
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: build/allOutputs
build-host:
if: (github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main') || github.event_name != 'schedule'
env:
MACOSX_DEPLOYMENT_TARGET: 13.3
strategy:
fail-fast: false
matrix:
include:
- os: windows-2022
artifact-name: Win64Debug
architecture: x64
task: "build"
build-options: "-PciDebugOnly"
outputs: "build/allOutputs"
- os: windows-2022
artifact-name: Win64Release
architecture: x64
build-options: "-PciReleaseOnly"
task: "copyAllOutputs"
outputs: "build/allOutputs"
- os: windows-2022
artifact-name: WinArm64Debug
architecture: x64
task: "build"
build-options: "-PciDebugOnly -Pbuildwinarm64 -Ponlywindowsarm64"
outputs: "build/allOutputs"
- os: windows-2022
artifact-name: WinArm64Release
architecture: x64
build-options: "-PciReleaseOnly -Pbuildwinarm64 -Ponlywindowsarm64"
task: "copyAllOutputs"
outputs: "build/allOutputs"
- os: macOS-14
artifact-name: macOS
architecture: aarch64
task: "build"
outputs: "build/allOutputs"
- os: windows-2022
artifact-name: Win32
architecture: x86
task: ":ntcoreffi:build"
outputs: "ntcoreffi/build/outputs"
name: "Build - ${{ matrix.artifact-name }}"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
architecture: ${{ matrix.architecture }}
- name: Import Developer ID Certificate
uses: wpilibsuite/import-signing-certificate@v2
with:
certificate-data: ${{ secrets.APPLE_CERTIFICATE_DATA }}
certificate-passphrase: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
keychain-password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
if: |
matrix.artifact-name == 'macOS' && (github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main')
- name: Set Keychain Lock Timeout
run: security set-keychain-settings -lut 3600
if: |
matrix.artifact-name == 'macOS' && (github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main')
- name: Set Java Heap Size
run: sed -i 's/-Xmx2g/-Xmx1g/g' gradle.properties
if: matrix.artifact-name == 'Win32'
- name: Check disk free space (Windows)
run: wmic logicaldisk get caption, freespace
if: matrix.os == 'windows-2022'
- name: Check disk free space pre-cleanup (macOS)
run: df -h .
if: matrix.os == 'macOS-14'
- name: Cleanup disk space
# CodeQL: 5G
# go: 748M
# Android: 12G
run: |
rm -rf /Users/runner/hostedtoolcache/CodeQL
rm -rf /Users/runner/hostedtoolcache/go
rm -rf /Users/runner/Library/Android
if: matrix.os == 'macOS-14'
- name: Check disk free space post-cleanup (macOS)
run: df -h .
if: matrix.os == 'macOS-14'
- name: Build with Gradle
run: ./gradlew ${{ matrix.task }} -PbuildServer -PskipJavaFormat ${{ matrix.build-options }}
- name: Sign Libraries with Developer ID
run: ./gradlew copyAllOutputs -PbuildServer -PskipJavaFormat -PdeveloperID=${{ secrets.APPLE_DEVELOPER_ID }} ${{ matrix.build-options }}
if: |
matrix.artifact-name == 'macOS' && (github.repository_owner == 'wpilibsuite' && github.ref == 'refs/heads/main')
- name: Check disk free space (Windows)
run: wmic logicaldisk get caption, freespace
if: matrix.os == 'windows-2022'
- name: Check disk free space (macOS)
run: df -h .
if: matrix.os == 'macOS-14'
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: ${{ matrix.outputs }}

View File

@@ -34,7 +34,7 @@ jobs:
with:
image: wpilib/roborio-cross-ubuntu:2024-22.04
options: -v ${{ github.workspace }}:/work -w /work -e GITHUB_REF -e CI -e DISPLAY
run: df . && rm -f semicolon_delimited_script && ./gradlew :wpilibc:publish :wpilibj:publish :wpilibNewCommands:publish :hal:publish :cameraserver:publish :ntcore:publish :cscore:publish :wpimath:publish :wpinet:publish :wpiutil:publish :apriltag:publish :wpiunits:publish :simulation:halsim_gui:publish :simulation:halsim_ds_socket:publish :fieldImages:publish -x test -x Javadoc -x doxygen --build-cache && cp -r /root/releases/maven/development /work
run: df . && rm -f semicolon_delimited_script && ./gradlew :wpilibc:publish :wpilibj:publish :wpilibNewCommands:publish :hal:publish :cameraserver:publish :ntcore:publish :cscore:publish :wpimath:publish :wpinet:publish :wpiutil:publish :apriltag:publish :wpiunits:publish :simulation:halsim_gui:publish :simulation:halsim_ds_socket:publish :fieldImages:publish :epilogue-processor:publish :epilogue-runtime:publish :thirdparty:googletest:publish -x test -x Javadoc -x doxygen --build-cache && cp -r /root/releases/maven/development /work
- uses: actions/upload-artifact@v4
with:
name: MavenArtifacts

View File

@@ -40,11 +40,6 @@ jobs:
cd upstream_utils
./argparse_lib.py clone
./argparse_lib.py copy-src
- name: Run concurrentqueue.py
run: |
cd upstream_utils
./concurrentqueue.py clone
./concurrentqueue.py copy-src
- name: Run eigen.py
run: |
cd upstream_utils

2
.gitignore vendored
View File

@@ -239,7 +239,7 @@ compile_commands.json
# clang configuration and clangd cache
.clang
.clangd/
.clangd
.cache/
imgui.ini

View File

@@ -33,8 +33,9 @@ includeOtherLibs {
^cameraserver/
^cscore
^fmt/
^gtest/
^glass/
^google/
^gtest/
^hal/
^imgui
^implot

View File

@@ -15,7 +15,7 @@
"cacheVariables": {}
},
{
"name": "sccache",
"name": "with-sccache",
"displayName": "",
"description": "Ninja config with sccache",
"generator": "Ninja",
@@ -36,11 +36,11 @@
}
},
{
"name": "with-java-sccache",
"name": "with-java-and-sccache",
"displayName": "",
"description": "Ninja config with Java and sccache",
"generator": "Ninja",
"inherits": "sccache",
"inherits": "with-sccache",
"binaryDir": "build-cmake",
"cacheVariables": {
"WITH_JAVA": "ON"

25
GeneratedFiles.md Normal file
View File

@@ -0,0 +1,25 @@
# Maintaining Generated Files
WPILib extensively uses [metaprogramming](https://en.wikipedia.org/wiki/Metaprogramming#Code_generation) to generate code that would otherwise be tedious and error-prone to maintain. We use [Jinja](https://jinja.palletsprojects.com), a templating engine with a Python API, alongside JSON files that contain data to generate code. This document explains how to maintain these generated files and create new ones.
## File hierarchy
The Python script used to generate a subproject's files will always be located in the subproject's directory, e.g. wpilibc. It will always be called `generate_<thing>.py` where `<thing>` is the name for what you're generating.
The templates will be located under `subproject/src/generate/main`, and generated files will be located under `subproject/src/generated/main`.
If the generated file is for C++, the hierarchy should be symmetrical, so if a generated header is located under `subproject/src/generated/main/native/include/frc/header.h`, the template to generate it should be located under `subproject/src/generate/main/native/include/frc/template.h.jinja`. You should pretend like `subproject/src/generate/main` is just like `subproject/src/main`, in that the file hierarchy must make sense if the files weren't generated, e.g, headers that would go in `subproject/src/main/native/include/blah` should be in `subproject/src/generated/main/native/include/blah`.
If the generated file is for Java, templates should be located under `subproject/src/generate/main/java`, and the hierarchy for output files should reflect the declared package of the output Java files. For example, a Jinja template at `subproject/src/main/java/template.java.jinja` with the package `edu.wpi.first.wpilibj` would be used to generate Java files located at `subproject/src/generated/main/java/edu/wpi/first/wpilibj`
The JSON files live under `subproject/src/generate` since they apply to both languages. One unique case is JSON files that are used by multiple subprojects, currently only JSON files shared by wpilibc and wpilibj. In that specific case, the JSON files will always be located in wpilibj since Java is the most used language.
## Using code generation
If you've identified a set of files which are extremely similar, one file with lots of repetitive code, or both, you can create Jinja templates, a JSON file, and a Python script to automatically generate the code instead.
### Preparing files for codegen
Once you've identified the files you want to codegen, you will need to identify parts of code that are similar, and extract the data that's different. Code needs to go into your Jinja template, while data that will be used to fill in the template goes into a JSON file. Using game controllers as an example, they have lots of similar methods to read the value of a button, check if a button has been pressed since the last check, and check if a button has been released since the last check. Those methods are code that goes in a Jinja template, with the specific button replaced with a Jinja expression. The buttons, both the name and value, go into a JSON file.
### Writing a Python script
To maintain consistency with other Python scripts, copy an existing `generate_*.py` script. [generate_pwm_motor_controllers.py](./wpilibj/generate_pwm_motor_controllers.py) is a good start, since it's relatively basic. Modify the script to reference your templates and JSON file, modify the paths so the files end up in the right place, and rename the functions so they match what you're generating. An important part of the script is to give the files the correct name. Depending on files you're generating, this could be the name of the template itself (see [ntcore/generate_topics.py](./ntcore/generate_topics.py)) or it could be part of the data in the JSON file.
### (Re)Generating files and committing them
Once your Python script is complete, you can run `python generate_<thing>.py` to generate the files. Once you're finished with your files, commit these files to Git. If you regenerated the files and Git indicates the files have changed, but the diff doesn't show any changes, only the line endings have changed. If you expected changes to the generated code, you didn't correctly make changes. If you didn't expect changes, you can ignore this and discard the changes. Also ensure that you've marked the Python script as executable, since this is necessary for CI workflows to run your scripts. To add your script to the CI workflows, edit [.github/workflows/pregen_all.py](.github/workflows/pregen_all.py), and add your script alongside the rest of the scripts.

View File

@@ -145,7 +145,7 @@ If you only want to run the Java autoformatter, run `./gradlew spotlessApply`.
### Generated files
Several files within WPILib are generated using Jinja. If a PR is opened that modifies these templates then the files can be generated through CI by commenting `/pregen` on the PR. A new commit will be pushed with the regenerated files.
Several files within WPILib are generated using Jinja. If a PR is opened that modifies these templates then the files can be generated through CI by commenting `/pregen` on the PR. A new commit will be pushed with the regenerated files. See [GeneratedFiles.md](GeneratedFiles.md) for more information.
### CMake

View File

@@ -5,7 +5,7 @@
#include "frc/apriltag/AprilTagDetector.h"
#include <cmath>
#include <numbers>
#include <utility>
#ifdef _WIN32
#pragma warning(disable : 4200)

View File

@@ -5,6 +5,8 @@
#include "frc/apriltag/AprilTagFieldLayout.h"
#include <system_error>
#include <utility>
#include <vector>
#include <units/angle.h>
#include <units/length.h>

View File

@@ -2,6 +2,8 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include <vector>
#include <gtest/gtest.h>
#include "frc/apriltag/AprilTagFieldLayout.h"

View File

@@ -6,6 +6,7 @@
#include <string>
#include <string_view>
#include <thread>
#include <utility>
#include <vector>
#include <networktables/NetworkTableInstance.h>

View File

@@ -5,6 +5,9 @@
#include "cameraserver/CameraServer.h"
#include <atomic>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <fmt/format.h>

View File

@@ -4,6 +4,9 @@
#include "cameraserver/CameraServerShared.h"
#include <memory>
#include <utility>
#include <wpi/mutex.h>
namespace {

View File

@@ -4,6 +4,7 @@
#include "vision/VisionRunner.h"
#include <memory>
#include <thread>
#include <opencv2/core/mat.hpp>

View File

@@ -4,6 +4,7 @@
#include <atomic>
#include <thread>
#include <utility>
#include <gtest/gtest.h>
#include <hal/DMA.h>

View File

@@ -5,7 +5,7 @@
package edu.wpi.first.cscore;
/**
* A source for video that provides a sequence of frames. Each frame may consist of multiple images
* A sink for video that accepts a sequence of frames. Each frame may consist of multiple images
* (e.g. from a stereo or depth camera); these are called channels.
*/
public class VideoSink implements AutoCloseable {

View File

@@ -4,11 +4,13 @@
#include "ConfigurableSourceImpl.h"
#include <memory>
#include <string>
#include <wpi/timestamp.h>
#include "Handle.h"
#include "Instance.h"
#include "Log.h"
#include "Notifier.h"
using namespace cs;

View File

@@ -5,13 +5,13 @@
#include "Frame.h"
#include <cstdlib>
#include <memory>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "Instance.h"
#include "Log.h"
#include "SourceImpl.h"
using namespace cs;

View File

@@ -4,12 +4,16 @@
#include "HttpCameraImpl.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <wpi/MemAlloc.h>
#include <wpi/StringExtras.h>
#include <wpi/timestamp.h>
#include <wpinet/TCPConnector.h>
#include "Handle.h"
#include "Instance.h"
#include "JpegUtil.h"
#include "Log.h"
@@ -454,11 +458,7 @@ std::unique_ptr<PropertyImpl> HttpCameraImpl::CreateEmptyProperty(
}
bool HttpCameraImpl::CacheProperties(CS_Status* status) const {
#ifdef _MSC_VER // work around VS2019 16.4.0 bug
std::scoped_lock<wpi::mutex> lock(m_mutex);
#else
std::scoped_lock lock(m_mutex);
#endif
// Pretty typical set of video modes
m_videoModes.clear();

View File

@@ -4,7 +4,9 @@
#include "Instance.h"
#include <memory>
#include <string_view>
#include <utility>
#include <fmt/format.h>
#include <wpi/fs.h>
@@ -30,6 +32,7 @@ static void def_log_func(unsigned int level, const char* file,
return;
}
wpi::print(stderr, "CS: {}: {} ({}:{})\n", levelmsg, msg,
// NOLINTNEXTLINE(build/include_what_you_use)
fs::path{file}.filename().string(), line);
}

View File

@@ -4,6 +4,8 @@
#include "JpegUtil.h"
#include <string>
#include <wpi/StringExtras.h>
#include <wpi/raw_istream.h>

View File

@@ -5,6 +5,9 @@
#include "MjpegServerImpl.h"
#include <chrono>
#include <memory>
#include <string>
#include <utility>
#include <wpi/SmallString.h>
#include <wpi/StringExtras.h>
@@ -15,7 +18,6 @@
#include <wpinet/raw_socket_istream.h>
#include <wpinet/raw_socket_ostream.h>
#include "Handle.h"
#include "Instance.h"
#include "JpegUtil.h"
#include "Log.h"

View File

@@ -4,9 +4,7 @@
#include "Notifier.h"
#include <queue>
#include <utility>
#include <vector>
#include "Handle.h"
#include "Instance.h"

View File

@@ -4,6 +4,10 @@
#include "PropertyContainer.h"
#include <memory>
#include <string>
#include <vector>
#include <wpi/Logger.h>
#include <wpi/SmallString.h>
#include <wpi/SmallVector.h>

View File

@@ -4,8 +4,10 @@
#include "RawSinkImpl.h"
#include <algorithm>
#include <memory>
#include "Instance.h"
#include "cscore.h"
#include "cscore_raw.h"
using namespace cs;

View File

@@ -4,11 +4,11 @@
#include "RawSourceImpl.h"
#include <memory>
#include <wpi/timestamp.h>
#include "Handle.h"
#include "Instance.h"
#include "Log.h"
#include "Notifier.h"
#include "cscore_raw.h"

View File

@@ -4,6 +4,8 @@
#include "SinkImpl.h"
#include <string>
#include <wpi/SmallString.h>
#include <wpi/json.h>

View File

@@ -7,6 +7,9 @@
#include <algorithm>
#include <cstring>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <wpi/StringExtras.h>
#include <wpi/json.h>

View File

@@ -5,7 +5,7 @@
#include "Telemetry.h"
#include <chrono>
#include <limits>
#include <utility>
#include <wpi/DenseMap.h>
#include <wpi/timestamp.h>
@@ -14,7 +14,6 @@
#include "Instance.h"
#include "Notifier.h"
#include "SourceImpl.h"
#include "cscore_cpp.h"
using namespace cs;

View File

@@ -75,11 +75,7 @@ template <typename THandle, typename TStruct, int typeValue, typename TMutex>
template <typename... Args>
THandle UnlimitedHandleResource<THandle, TStruct, typeValue, TMutex>::Allocate(
Args&&... args) {
#ifdef _MSC_VER // work around VS2019 16.4.0 bug
std::scoped_lock<TMutex> lock(m_handleMutex);
#else
std::scoped_lock sync(m_handleMutex);
#endif
size_t i;
for (i = 0; i < m_structures.size(); i++) {
if (m_structures[i] == nullptr) {

View File

@@ -4,15 +4,17 @@
#include "cscore_c.h"
#include <algorithm>
#include <cstddef>
#include <cstdlib>
#include <utility>
#include <vector>
#include <wpi/MemAlloc.h>
#include <wpi/SmallString.h>
#include "c_util.h"
#include "cscore_cpp.h"
#include "cscore_raw.h"
static CS_Event ConvertToC(const cs::RawEvent& rawEvent) {
CS_Event event;

View File

@@ -4,13 +4,16 @@
#include "cscore_cpp.h"
#include <memory>
#include <string>
#include <vector>
#include <wpi/SmallString.h>
#include <wpi/json.h>
#include <wpinet/hostname.h>
#include "Handle.h"
#include "Instance.h"
#include "Log.h"
#include "NetworkListener.h"
#include "Notifier.h"
#include "PropertyContainer.h"

View File

@@ -4,6 +4,9 @@
#include "cscore_oo.h"
#include <string>
#include <vector>
#include <fmt/format.h>
#include <wpi/json.h>

View File

@@ -2,8 +2,9 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include <exception>
#include <memory>
#include <span>
#include <string>
#include <fmt/format.h>

View File

@@ -13,6 +13,7 @@
#include <sys/types.h>
#include <unistd.h>
#include <algorithm>
#include <cerrno>
#include <wpi/SafeThread.h>

View File

@@ -9,6 +9,9 @@
#include <sys/types.h>
#include <unistd.h>
#include <string>
#include <vector>
namespace cs {
std::vector<std::string> GetNetworkInterfaces() {

View File

@@ -21,6 +21,9 @@
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <fmt/format.h>
#include <wpi/MemAlloc.h>
@@ -30,7 +33,6 @@
#include <wpi/raw_ostream.h>
#include <wpi/timestamp.h>
#include "Handle.h"
#include "Instance.h"
#include "JpegUtil.h"
#include "Log.h"

View File

@@ -4,6 +4,8 @@
#include "UsbCameraListener.h"
#include <memory>
#include <wpi/StringExtras.h>
#include <wpinet/EventLoopRunner.h>
#include <wpinet/uv/FsEvent.h>

View File

@@ -4,6 +4,10 @@
#include "UsbCameraProperty.h"
#include <memory>
#include <string>
#include <utility>
#include <fmt/format.h>
#include <wpi/SmallString.h>
#include <wpi/StringExtras.h>

View File

@@ -8,6 +8,8 @@
#include <libgen.h>
#include <sys/ioctl.h>
#include <string>
#include <fmt/format.h>
#include <wpi/SmallString.h>
#include <wpi/StringExtras.h>
@@ -16,7 +18,6 @@
#include <wpi/raw_ostream.h>
#include "Instance.h"
#include "Log.h"
namespace cs {

View File

@@ -2,6 +2,9 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include <string>
#include <vector>
#include "cscore_cpp.h"
namespace cs {

View File

@@ -13,13 +13,13 @@
// https://github.com/opencv/opencv/blob/master/modules/videoio/src/cap_msmf.cpp
#include <mfidl.h>
#include <mfapi.h>
#include <Dbt.h>
#include <ks.h>
#include <ksmedia.h>
#include <mfreadwrite.h>
#include <memory>
#include "COMCreators.h"
#include "ComPtr.h"

View File

@@ -5,6 +5,9 @@
#include <uv.h>
#include <ws2tcpip.h>
#include <string>
#include <vector>
#include "cscore_cpp.h"
#pragma comment(lib, "Ws2_32.lib")

View File

@@ -16,6 +16,7 @@
#include <cmath>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <Dbt.h>

View File

@@ -9,6 +9,8 @@
#include <dbt.h> // NOLINT(build/include_order)
#include <memory>
#define IDT_TIMER1 1001
using namespace cs;

View File

@@ -13,6 +13,9 @@
#include <algorithm>
#include <filesystem>
#include <memory>
#include <string>
#include <vector>
#include <fmt/format.h>
#include <glass/Storage.h>

View File

@@ -6,12 +6,14 @@
#include <atomic>
#include <ctime>
#include <functional>
#include <future>
#include <map>
#include <memory>
#include <set>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <fmt/chrono.h>

View File

@@ -4,6 +4,10 @@
#include "Sftp.h"
#include <string>
#include <utility>
#include <vector>
#include <fmt/format.h>
using namespace sftp;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 KiB

After

Width:  |  Height:  |  Size: 105 KiB

View File

@@ -161,6 +161,7 @@ model {
if (OperatingSystem.current().isWindows()) {
rc.source {
srcDirs 'src/app/native/win'
include '*.rc'
}
}
}

View File

@@ -3,6 +3,7 @@
// the WPILib BSD license file in the root directory of this project.
#include <memory>
#include <string>
#include <GLFW/glfw3.h>
#include <fmt/format.h>
@@ -14,7 +15,6 @@
#include "glass/Context.h"
#include "glass/MainMenuBar.h"
#include "glass/Model.h"
#include "glass/Storage.h"
#include "glass/View.h"
#include "glass/networktables/NetworkTables.h"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -4,9 +4,10 @@
#include "glass/Context.h"
#include <algorithm>
#include <cinttypes>
#include <filesystem>
#include <memory>
#include <string>
#include <utility>
#include <fmt/format.h>
#include <imgui.h>

View File

@@ -4,6 +4,9 @@
#include "glass/MainMenuBar.h"
#include <memory>
#include <utility>
#include <imgui.h>
#include <wpi/StringExtras.h>
#include <wpigui.h>

View File

@@ -5,6 +5,10 @@
#include "glass/Storage.h"
#include <concepts>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <imgui.h>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,9 @@
#include "glass/View.h"
#include <memory>
#include <utility>
using namespace glass;
namespace {

View File

@@ -6,6 +6,8 @@
#include <algorithm>
#include <cstdio>
#include <memory>
#include <utility>
#include <fmt/format.h>
#include <wpi/print.h>

View File

@@ -4,6 +4,8 @@
#include "glass/hardware/AnalogInput.h"
#include <string>
#include <imgui.h>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/hardware/AnalogOutput.h"
#include <string>
#include <wpi/StringExtras.h>
#include "glass/Context.h"

View File

@@ -4,6 +4,8 @@
#include "glass/hardware/Encoder.h"
#include <string>
#include <fmt/format.h>
#include <imgui.h>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/hardware/LEDDisplay.h"
#include <vector>
#include <wpi/SmallVector.h>
#include "glass/Context.h"

View File

@@ -4,6 +4,8 @@
#include "glass/hardware/PWM.h"
#include <string>
#include <imgui.h>
#include <wpi/StringExtras.h>

View File

@@ -6,6 +6,7 @@
#include <cstdio>
#include <cstring>
#include <string>
#include <imgui.h>
#include <wpi/SmallVector.h>

View File

@@ -4,6 +4,8 @@
#include "glass/hardware/Relay.h"
#include <string>
#include <imgui.h>
#include "glass/Context.h"

View File

@@ -5,6 +5,7 @@
#include "glass/other/DeviceTree.h"
#include <cinttypes>
#include <string>
#include <imgui.h>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/other/FMS.h"
#include <string>
#include <imgui.h>
#include <imgui_stdlib.h>
#include <wpi/SmallString.h>

View File

@@ -8,8 +8,10 @@
#include <cmath>
#include <cstdio>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <fields/fields.h>
#include <frc/geometry/Pose2d.h>

View File

@@ -4,6 +4,8 @@
#include "glass/other/Log.h"
#include <string>
#include <imgui.h>
using namespace glass;

View File

@@ -8,8 +8,10 @@
#include <cmath>
#include <cstdio>
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <frc/geometry/Pose2d.h>
#include <frc/geometry/Rotation2d.h>

View File

@@ -12,6 +12,7 @@
#include <memory>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <fmt/format.h>
@@ -29,7 +30,6 @@
#include <wpi/Signal.h>
#include <wpi/SmallString.h>
#include <wpi/SmallVector.h>
#include <wpi/StringExtras.h>
#include <wpi/timestamp.h>
#include "glass/Context.h"

View File

@@ -4,10 +4,9 @@
#include "glass/other/Subsystem.h"
#include <imgui.h>
#include <string>
#include "glass/Context.h"
#include "glass/DataSource.h"
#include <imgui.h>
using namespace glass;

View File

@@ -4,6 +4,7 @@
#include "glass/support/DataLogReaderThread.h"
#include <string>
#include <utility>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/support/EnumSetting.h"
#include <string>
#include <imgui.h>
using namespace glass;

View File

@@ -6,6 +6,7 @@
#include <cmath>
#include <stack>
#include <string>
#include <type_traits>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/networktables/NTCommandScheduler.h"
#include <utility>
#include <fmt/format.h>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/networktables/NTCommandSelector.h"
#include <utility>
#include <fmt/format.h>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/networktables/NTDifferentialDrive.h"
#include <utility>
#include <fmt/format.h>
#include <imgui.h>
#include <wpi/MathExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/networktables/NTDigitalInput.h"
#include <utility>
#include <fmt/format.h>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/networktables/NTDigitalOutput.h"
#include <utility>
#include <fmt/format.h>
using namespace glass;

View File

@@ -5,6 +5,9 @@
#include "glass/networktables/NTField2D.h"
#include <algorithm>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include <fmt/format.h>

View File

@@ -4,6 +4,8 @@
#include "glass/networktables/NTGyro.h"
#include <utility>
#include <fmt/format.h>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/networktables/NTMecanumDrive.h"
#include <utility>
#include <fmt/format.h>
#include <imgui.h>
#include <wpi/MathExtras.h>

View File

@@ -5,6 +5,8 @@
#include "glass/networktables/NTMechanism2D.h"
#include <algorithm>
#include <memory>
#include <string>
#include <string_view>
#include <vector>

View File

@@ -4,6 +4,8 @@
#include "glass/networktables/NTMotorController.h"
#include <utility>
#include <fmt/format.h>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/networktables/NTPIDController.h"
#include <utility>
#include <fmt/format.h>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/networktables/NTProfiledPIDController.h"
#include <utility>
#include <fmt/format.h>
#include <wpi/StringExtras.h>

View File

@@ -4,6 +4,8 @@
#include "glass/networktables/NTStringChooser.h"
#include <utility>
#include <fmt/format.h>
#include <wpi/json.h>

View File

@@ -4,6 +4,8 @@
#include "glass/networktables/NTSubsystem.h"
#include <utility>
#include <fmt/format.h>
using namespace glass;

View File

@@ -4,13 +4,18 @@
#include "glass/networktables/NetworkTables.h"
#include <algorithm>
#include <cinttypes>
#include <concepts>
#include <cstring>
#include <functional>
#include <initializer_list>
#include <map>
#include <memory>
#include <span>
#include <string>
#include <string_view>
#include <utility>
#include <vector>
#include <fmt/format.h>
@@ -740,7 +745,7 @@ void NetworkTablesModel::ValueSource::UpdateFromValue(
structName = *withoutArray;
}
auto desc = model.m_structDb.Find(structName);
if (desc && desc->IsValid()) {
if (desc && desc->IsValid() && desc->GetSize() != 0) {
if (isArray) {
// array of struct at top level
if (valueChildrenMap) {

View File

@@ -5,6 +5,8 @@
#include "glass/networktables/NetworkTablesProvider.h"
#include <algorithm>
#include <memory>
#include <utility>
#include <fmt/format.h>
#include <ntcore_cpp.h>

View File

@@ -7,6 +7,7 @@
#include <optional>
#include <string_view>
#include <utility>
#include <vector>
#include <imgui.h>
#include <imgui_stdlib.h>

View File

@@ -2,6 +2,8 @@
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include <memory>
#include "glass/networktables/NTCommandScheduler.h"
#include "glass/networktables/NTCommandSelector.h"
#include "glass/networktables/NTDifferentialDrive.h"

View File

@@ -5,6 +5,7 @@
#include "hal/AddressableLED.h"
#include <cstring>
#include <memory>
#include <fmt/format.h>

View File

@@ -5,6 +5,7 @@
#include "AnalogInternal.h"
#include <atomic>
#include <memory>
#include <wpi/mutex.h>

Some files were not shown because too many files have changed in this diff Show More