Skip to content

Commit

Permalink
Merge branch 'wpilibsuite:main' into FFUnits
Browse files Browse the repository at this point in the history
  • Loading branch information
narmstro2020 committed Sep 21, 2024
2 parents 7ce45a1 + f93bacc commit 70639b9
Show file tree
Hide file tree
Showing 576 changed files with 8,188 additions and 616 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/comment-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
distribution: 'temurin'
java-version: 17
- name: Install wpiformat
run: pip3 install wpiformat==2024.40
run: pip3 install wpiformat==2024.41
- name: Run wpiformat
run: wpiformat
- name: Run spotlessApply
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
python-version: '3.10'
- name: Install wpiformat
run: pip3 install wpiformat==2024.40
run: pip3 install wpiformat==2024.41
- name: Run
run: wpiformat
- name: Check output
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
with:
python-version: '3.10'
- name: Install wpiformat
run: pip3 install wpiformat==2024.40
run: pip3 install wpiformat==2024.41
- name: Create compile_commands.json
run: |
./gradlew generateCompileCommands -Ptoolchain-optional-roboRio
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/upstream-utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,26 @@ jobs:
cd upstream_utils
./apriltag.py clone
./apriltag.py copy-src
- name: Run argparse_lib.py
run: |
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
./eigen.py clone
./eigen.py copy-src
- name: Run expected.py
run: |
cd upstream_utils
./expected.py clone
./expected.py copy-src
- name: Run fmt.py
run: |
cd upstream_utils
Expand Down
3 changes: 2 additions & 1 deletion .styleguide
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ includeOtherLibs {
^cameraserver/
^cscore
^fmt/
^gtest/
^glass/
^google/
^gtest/
^hal/
^imgui
^implot
Expand Down
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ option(WITH_EXAMPLES "Build examples" OFF)
option(WITH_TESTS "Build unit tests (requires internet connection)" ON)
option(WITH_GUI "Build GUI items" ON)
option(WITH_SIMULATION_MODULES "Build simulation modules" ON)
option(WITH_PROTOBUF "Build protobuf support" ON)

# Options for using a package manager (e.g., vcpkg) for certain dependencies.
option(USE_SYSTEM_FMTLIB "Use system fmtlib" OFF)
Expand Down Expand Up @@ -128,12 +129,14 @@ else()
find_package(Java REQUIRED COMPONENTS Runtime)
endif()

find_package(LIBSSH 0.7.1)
find_package(LIBSSH CONFIG 0.7.1)

set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
set(protobuf_MODULE_COMPATIBLE ON CACHE BOOL "" FORCE)
find_package(Protobuf REQUIRED)
find_program(PROTOC_COMPILER protoc REQUIRED)
if(WITH_PROTOBUF)
set(protobuf_MODULE_COMPATIBLE ON CACHE BOOL "" FORCE)
find_package(Protobuf REQUIRED)
find_program(PROTOC_COMPILER protoc REQUIRED)
endif()
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG OFF)

get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
Expand Down
2 changes: 1 addition & 1 deletion apriltag/src/main/native/cpp/AprilTagDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "frc/apriltag/AprilTagDetector.h"

#include <cmath>
#include <numbers>
#include <utility>

#ifdef _WIN32
#pragma warning(disable : 4200)
Expand Down
10 changes: 5 additions & 5 deletions apriltag/src/main/native/cpp/AprilTagFieldLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "frc/apriltag/AprilTagFieldLayout.h"

#include <system_error>
#include <utility>
#include <vector>

#include <units/angle.h>
#include <units/length.h>
Expand All @@ -15,14 +17,12 @@
using namespace frc;

AprilTagFieldLayout::AprilTagFieldLayout(std::string_view path) {
std::error_code ec;
std::unique_ptr<wpi::MemoryBuffer> fileBuffer =
wpi::MemoryBuffer::GetFile(path, ec);
if (fileBuffer == nullptr || ec) {
auto fileBuffer = wpi::MemoryBuffer::GetFile(path);
if (!fileBuffer) {
throw std::runtime_error(fmt::format("Cannot open file: {}", path));
}

wpi::json json = wpi::json::parse(fileBuffer->GetCharBuffer());
wpi::json json = wpi::json::parse(fileBuffer.value()->GetCharBuffer());

for (const auto& tag : json.at("tags").get<std::vector<AprilTag>>()) {
m_apriltags[tag.ID] = tag;
Expand Down
2 changes: 2 additions & 0 deletions apriltag/src/test/native/cpp/LoadConfigTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ repositories {
}
}
dependencies {
implementation "edu.wpi.first:native-utils:2025.2.0"
implementation "edu.wpi.first:native-utils:2025.3.0"
}
12 changes: 6 additions & 6 deletions cameraserver/multiCameraServer/src/main/native/cpp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <string>
#include <string_view>
#include <thread>
#include <utility>
#include <vector>

#include <networktables/NetworkTableInstance.h>
Expand Down Expand Up @@ -94,18 +95,17 @@ bool ReadCameraConfig(const wpi::json& config) {

bool ReadConfig() {
// open config file
std::error_code ec;
std::unique_ptr<wpi::MemoryBuffer> fileBuffer =
wpi::MemoryBuffer::GetFile(configFile, ec);
if (fileBuffer == nullptr || ec) {
wpi::print(stderr, "could not open '{}': {}\n", configFile, ec.message());
auto fileBuffer = wpi::MemoryBuffer::GetFile(configFile);
if (!fileBuffer) {
wpi::print(stderr, "could not open '{}': {}\n", configFile,
fileBuffer.error().message());
return false;
}

// parse file
wpi::json j;
try {
j = wpi::json::parse(fileBuffer->GetCharBuffer());
j = wpi::json::parse(fileBuffer.value()->GetCharBuffer());
} catch (const wpi::json::parse_error& e) {
wpi::print(stderr, "config error in '{}': byte {}: {}\n", configFile,
e.byte, e.what());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#include "cameraserver/CameraServer.h"

#include <atomic>
#include <memory>
#include <string>
#include <utility>
#include <vector>

#include <fmt/format.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "cameraserver/CameraServerShared.h"

#include <memory>
#include <utility>

#include <wpi/mutex.h>

namespace {
Expand Down
1 change: 1 addition & 0 deletions cameraserver/src/main/native/cpp/vision/VisionRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include "vision/VisionRunner.h"

#include <memory>
#include <thread>

#include <opencv2/core/mat.hpp>
Expand Down
3 changes: 3 additions & 0 deletions cmake/modules/AddTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ include(CompileWarnings)

macro(wpilib_add_test name srcdir)
file(GLOB_RECURSE test_src ${srcdir}/*.cpp)
if(NOT WITH_PROTOBUF)
list(FILTER test_src EXCLUDE REGEX "/proto/")
endif()
add_executable(${name}_test ${test_src})
set_property(TARGET ${name}_test PROPERTY FOLDER "tests")
wpilib_target_warnings(${name}_test)
Expand Down
143 changes: 0 additions & 143 deletions cmake/modules/FindLIBSSH.cmake

This file was deleted.

1 change: 1 addition & 0 deletions crossConnIntegrationTests/src/main/native/cpp/PWMTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <atomic>
#include <thread>
#include <utility>

#include <gtest/gtest.h>
#include <hal/DMA.h>
Expand Down
4 changes: 3 additions & 1 deletion cscore/src/main/native/cpp/ConfigurableSourceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit 70639b9

Please sign in to comment.