Skip to content

Commit

Permalink
Merge branch 'main' into better-async-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
SamCarlberg committed Sep 9, 2024
2 parents c8bb6b1 + 7c85c33 commit ab8a5e3
Show file tree
Hide file tree
Showing 351 changed files with 16,327 additions and 3,396 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

env:
SCCACHE_WEBDAV_ENDPOINT: "https://frcmaven.wpi.edu/artifactory/wpilib-generic-cache-cmake"

jobs:
build:
strategy:
Expand Down Expand Up @@ -34,20 +37,22 @@ jobs:
run: brew install opencv protobuf@3 ninja
if: runner.os == 'macOS'

- name: Run sccache-cache
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.5

- uses: actions/checkout@v4

- name: configure
run: cmake ${{ matrix.flags }}
env:
SCCACHE_GHA_ENABLED: "true"
SCCACHE_WEBDAV_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}

- name: build
run: cmake --build build-cmake --parallel $(nproc)
env:
SCCACHE_GHA_ENABLED: "true"
SCCACHE_WEBDAV_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}

- name: test
working-directory: build-cmake
Expand Down Expand Up @@ -76,12 +81,14 @@ jobs:
- 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_GHA_ENABLED: "true"
SCCACHE_WEBDAV_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}

- name: build
run: cmake --build build-cmake --parallel $(nproc)
env:
SCCACHE_GHA_ENABLED: "true"
SCCACHE_WEBDAV_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}

- name: test
working-directory: build-cmake
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/command-robotpy-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Comment on PR
if: github.repository == 'wpilibsuite/allwpilib'
uses: actions/github-script@v7
with:
script: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
publish:
name: "Documentation - Publish"
runs-on: ubuntu-22.04
if: github.repository_owner == 'wpilibsuite' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
if: github.repository == 'wpilibsuite/allwpilib' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
concurrency: ci-docs-publish
steps:
- uses: actions/checkout@v4
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:

build-host:
env:
MACOSX_DEPLOYMENT_TARGET: 13
MACOSX_DEPLOYMENT_TARGET: 13.3
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -118,12 +118,12 @@ jobs:
certificate-passphrase: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
keychain-password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
if: |
matrix.artifact-name == 'macOS' && (github.repository_owner == 'wpilibsuite' &&
matrix.artifact-name == 'macOS' && (github.repository == 'wpilibsuite/allwpilib' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')))
- name: Set Keychain Lock Timeout
run: security set-keychain-settings -lut 3600
if: |
matrix.artifact-name == 'macOS' && (github.repository_owner == 'wpilibsuite' &&
matrix.artifact-name == 'macOS' && (github.repository == 'wpilibsuite/allwpilib' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')))
- name: Set release environment variable
run: echo "EXTRA_GRADLE_ARGS=-PreleaseMode" >> $GITHUB_ENV
Expand Down Expand Up @@ -158,7 +158,7 @@ jobs:
- name: Sign Libraries with Developer ID
run: ./gradlew copyAllOutputs --build-cache -PbuildServer -PskipJavaFormat -PdeveloperID=${{ secrets.APPLE_DEVELOPER_ID }} ${{ matrix.build-options }} ${{ env.EXTRA_GRADLE_ARGS }}
if: |
matrix.artifact-name == 'macOS' && (github.repository_owner == 'wpilibsuite' &&
matrix.artifact-name == 'macOS' && (github.repository == 'wpilibsuite/allwpilib' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')))
- name: Check disk free space (Windows)
run: wmic logicaldisk get caption, freespace
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
steps:
- name: Free Disk Space
if: |
github.repository_owner == 'wpilibsuite' &&
github.repository == 'wpilibsuite/allwpilib' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
uses: jlumbroso/free-disk-space@main
with:
Expand All @@ -215,38 +215,38 @@ jobs:
swap-storage: false
- uses: actions/checkout@v4
if: |
github.repository_owner == 'wpilibsuite' &&
github.repository == 'wpilibsuite/allwpilib' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
with:
repository: wpilibsuite/build-tools
- uses: actions/download-artifact@v4
if: |
github.repository_owner == 'wpilibsuite' &&
github.repository == 'wpilibsuite/allwpilib' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
with:
path: combiner/products/build/allOutputs
- name: Flatten Artifacts
if: |
github.repository_owner == 'wpilibsuite' &&
github.repository == 'wpilibsuite/allwpilib' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
run: rsync -a --delete combiner/products/build/allOutputs/*/* combiner/products/build/allOutputs/
- name: Check version number exists
if: |
github.repository_owner == 'wpilibsuite' &&
github.repository == 'wpilibsuite/allwpilib' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
run: |
cat combiner/products/build/allOutputs/version.txt
test -s combiner/products/build/allOutputs/version.txt
- uses: actions/setup-java@v4
if: |
github.repository_owner == 'wpilibsuite' &&
github.repository == 'wpilibsuite/allwpilib' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
with:
distribution: 'temurin'
java-version: 17
- name: Combine (Main)
if: |
github.repository_owner == 'wpilibsuite' &&
github.repository == 'wpilibsuite/allwpilib' &&
github.ref == 'refs/heads/main'
run: cd combiner && ./gradlew publish -Pallwpilib
env:
Expand All @@ -255,7 +255,7 @@ jobs:
ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- name: Combine (Release)
if: |
github.repository_owner == 'wpilibsuite' &&
github.repository == 'wpilibsuite/allwpilib' &&
startsWith(github.ref, 'refs/tags/v')
run: cd combiner && ./gradlew publish -Pallwpilib -PreleaseRepoPublish
env:
Expand All @@ -264,7 +264,7 @@ jobs:
ARTIFACTORY_PUBLISH_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
- uses: actions/upload-artifact@v4
if: |
github.repository_owner == 'wpilibsuite' &&
github.repository == 'wpilibsuite/allwpilib' &&
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
with:
name: Maven
Expand All @@ -280,7 +280,7 @@ jobs:
steps:
- uses: peter-evans/repository-dispatch@v3
if: |
github.repository_owner == 'wpilibsuite' &&
github.repository == 'wpilibsuite/allwpilib' &&
startsWith(github.ref, 'refs/tags/v')
with:
token: ${{ secrets.TOOL_REPO_ACCESS_TOKEN }}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/pregenerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
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
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

env:
SCCACHE_WEBDAV_ENDPOINT: "https://frcmaven.wpi.edu/artifactory/wpilib-generic-cache-cmake"

jobs:
build:
strategy:
Expand All @@ -31,21 +34,23 @@ jobs:
- name: Install Dependencies
run: sudo apt-get update && sudo apt-get install -y libopencv-dev libopencv4.5-java clang-14 libprotobuf-dev protobuf-compiler ninja-build

- name: Run sccache-cache
- name: Install sccache
uses: mozilla-actions/sccache-action@v0.0.5

- uses: actions/checkout@v4

- name: configure
run: mkdir build && cd build && cmake -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/clang-14 -DCMAKE_CXX_COMPILER:FILEPATH=/usr/bin/clang++-14 -DWITH_JAVA=OFF ${{ matrix.cmake-flags }} ..
env:
SCCACHE_GHA_ENABLED: "true"
SCCACHE_WEBDAV_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}

- name: build
working-directory: build
run: cmake --build . --parallel $(nproc)
env:
SCCACHE_GHA_ENABLED: "true"
SCCACHE_WEBDAV_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
SCCACHE_WEBDAV_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}

- name: test
working-directory: build
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void apriltag_detections_destroy(zarray_t *detections);

// Renders the apriltag.
// Caller is responsible for calling image_u8_destroy on the image
image_u8_t *apriltag_to_image(apriltag_family_t *fam, int idx);
image_u8_t *apriltag_to_image(apriltag_family_t *fam, uint32_t idx);

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void estimate_tag_pose_orthogonal_iteration(
apriltag_pose_t* pose1,
double* err2,
apriltag_pose_t* pose2,
int nIters,
int nIters,
double min_improvement_per_iteration);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ matd_t *homography_to_pose(const matd_t *H, double fx, double fy, double cx, dou
// [ 0 0 C D ]
// [ 0 0 -1 0 ]

matd_t *homography_to_model_view(const matd_t *H, double F, double G, double A, double B, double C, double D);
matd_t *homography_to_model_view(const matd_t *H, double F, double G, double A, double B);

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void image_u8x3_destroy(image_u8x3_t *im);
int image_u8x3_write_pnm(const image_u8x3_t *im, const char *path);

// only width 1 supported
void image_u8x3_draw_line(image_u8x3_t *im, float x0, float y0, float x1, float y1, uint8_t rgb[3], int width);
void image_u8x3_draw_line(image_u8x3_t *im, float x0, float y0, float x1, float y1, uint8_t rgb[3]);

#ifdef __cplusplus
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ matd_t *matd_create_scalar(double v);
* Retrieves the cell value for matrix 'm' at the given zero-based row and column index.
* Performs more thorough validation checking than MATD_EL().
*/
double matd_get(const matd_t *m, int row, int col);
double matd_get(const matd_t *m, unsigned int row, unsigned int col);

/**
* Assigns the given value to the matrix cell at the given zero-based row and
* column index. Performs more thorough validation checking than MATD_EL().
*/
void matd_put(matd_t *m, int row, int col, double value);
void matd_put(matd_t *m, unsigned int row, unsigned int col, double value);

/**
* Retrieves the scalar value of the given element ('m' must be a scalar).
Expand Down Expand Up @@ -147,7 +147,7 @@ matd_t *matd_copy(const matd_t *m);
* beyond the number of rows/columns of 'a'. It is the caller's responsibility to
* call matd_destroy() on the returned matrix.
*/
matd_t *matd_select(const matd_t *a, int r0, int r1, int c0, int c1);
matd_t *matd_select(const matd_t *a, unsigned int r0, int r1, unsigned int c0, int c1);

/**
* Prints the supplied matrix 'm' to standard output by applying the supplied
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,31 +27,19 @@ either expressed or implied, of the Regents of The University of Michigan.

#pragma once

#define _USE_MATH_DEFINES
#include <math.h>
#include <float.h>
#include <stdlib.h>
#include <stdint.h>
#include <assert.h>
#include <string.h> // memcpy

#ifdef __cplusplus
extern "C" {
#endif

#ifndef M_TWOPI
# define M_TWOPI 6.2831853071795862319959 /* 2*pi */
#endif

#ifndef M_PI
# define M_PI 3.141592653589793238462643383279502884196
#endif

#define to_radians(x) ( (x) * (M_PI / 180.0 ))
#define to_degrees(x) ( (x) * (180.0 / M_PI ))

#define max(A, B) (A < B ? B : A)
#define min(A, B) (A < B ? A : B)

/* DEPRECATE, threshold meaningless without context.
static inline int dequals(double a, double b)
{
Expand Down Expand Up @@ -111,7 +99,7 @@ static inline int irand(int bound)
/** Map vin to [0, 2*PI) **/
static inline double mod2pi_positive(double vin)
{
return vin - M_TWOPI * floor(vin / M_TWOPI);
return vin - M_2_PI * floor(vin / M_2_PI);
}

/** Map vin to [-PI, PI) **/
Expand Down Expand Up @@ -145,7 +133,7 @@ static inline int mod_positive(int vin, int mod) {
static inline int theta_to_int(double theta, int max)
{
theta = mod2pi_ref(M_PI, theta);
int v = (int) (theta / M_TWOPI * max);
int v = (int) (theta / M_2_PI * max);

if (v == max)
v = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct pam
int depth; // bytes per pixel
int maxval; // maximum value per channel, e.g. 255 for 8bpp

int datalen; // in bytes
size_t datalen; // in bytes
uint8_t *data;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ SOFTWARE.
#include <pthread.h>
#include <sched.h>
#endif
#include <time.h>

#ifdef _WIN32

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ bool str_matches_any(const char *haystack, const char **needles, int num_needles
*
* Note: startidx must be >= endidx
*/
char *str_substring(const char *str, size_t startidx, long endidx);
char *str_substring(const char *str, size_t startidx, size_t endidx);

/**
* Retrieves the zero-based index of the beginning of the supplied substring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ typedef long long suseconds_t;

inline int gettimeofday(struct timeval* tp, void* tzp)
{
(void)tzp;

unsigned long t;
t = time(NULL);
tp->tv_sec = t / 1000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ static inline void zarray_map(zarray_t *za, void (*f)(void*))
*
* void map_function(element_type *element)
*/
void zarray_vmap(zarray_t *za, void (*f)(void*));
void zarray_vmap(zarray_t *za, void (*f)(void *));

/**
* Removes all elements from the array and sets its size to zero. Pointers to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct zmaxheap_iterator {

zmaxheap_t *zmaxheap_create(size_t el_sz);

void zmaxheap_vmap(zmaxheap_t *heap, void (*f)(void*));
void zmaxheap_vmap(zmaxheap_t *heap, void (*f)(void *));

void zmaxheap_destroy(zmaxheap_t *heap);

Expand Down
Loading

0 comments on commit ab8a5e3

Please sign in to comment.