Commit Graph

63 Commits

Author SHA1 Message Date
PJ Reiniger
013a238994 HAND FIXES: Update maven info 2025-11-07 23:09:21 -08:00
PJ Reiniger
c48b722dac SCRIPT: Spotless Apply 2025-11-07 23:09:21 -08:00
PJ Reiniger
e0320a942a HAND FIX - Fixup pregen files 2025-11-07 23:09:21 -08:00
PJ Reiniger
6b69aab44e HAND FIX - Fixup bazel files 2025-11-07 23:09:21 -08:00
PJ Reiniger
f0a3c64121 SCRIPT Run java package replacements 2025-11-07 23:09:21 -08:00
PJ Reiniger
c350c5f112 SCRIPT Move java files 2025-11-07 23:09:21 -08:00
Peter Johnson
7ff312bb69 Merge branch 'main' into 2027 2025-10-06 19:43:02 -07:00
Gold856
0277759d44 [wpiunits] Remove redundant if statement and inaccurate comment (#8262) 2025-09-28 16:00:35 -07:00
Sam Carlberg
909f8a1dc4 [build] Remove PMD.RedundantFieldInitializer rule (#8184)
Code readability is much more important than saving three bytes per redundantly-initialized field.
2025-09-08 21:19:00 -07:00
Peter Johnson
3e4e9c9b01 Merge branch 'main' into 2027 2025-08-09 00:55:26 -07:00
Tyler Veness
9ac7e286f5 [build] Upgrade Gradle plugins (#8166)
I upgraded all plugins I could see except org.ysb33r.doxygen. 2.0 made
breaking changes, and I couldn't figure out how to migrate.

Most of the changes are for suppressing new linter purification rites.
2025-08-08 23:04:02 -07:00
Sam Carlberg
8d36df671b [wpiunits] Make Java units immutable only (#8115)
Remove mutable implementations, as systemcore doesn't need mutability to keep performance under control.
2025-07-26 14:48:35 -07:00
PJ Reiniger
c78bd942bb [bazel] Make publishers for c++ hdr / srcs, and java (#8114) 2025-07-24 09:11:09 -04:00
PJ Reiniger
e13d237390 [bazel] Create better static libraries and add basic publishing (#8029) 2025-06-27 16:36:12 -07:00
PJ Reiniger
fbbc4bc53c [bazel] Clean up bazel scripts (#7984) 2025-06-13 20:53:09 -07:00
PJ Reiniger
6e3f48daeb [bazel] Add scripts to validate pregeneration tools (#7690) 2025-05-13 22:01:47 -07:00
Peter Johnson
dd6c830768 Revert "Added parity with C++ units. (#7965)" (#7968)
This reverts commit 3dee19a435.

This was merged without sufficient review or discussion as to whether these units are value-add for the Java units library.
2025-05-11 15:08:31 -07:00
T Grinch
3dee19a435 Added parity with C++ units. (#7965)
* Added parity with C++ units.

* Update Units.java

* Update Units.java

* Formatting

* Fixed formatting

---------

Co-authored-by: thenetworkgrinch <thenetworkgrinch@users.noreply.github.com>
2025-05-10 21:04:17 -04:00
Peter Johnson
36811211be Merge branch 'main' into 2027 2025-04-25 23:45:43 -07:00
Wispy
07192285f6 [wpiunits] Add InchesPerSecondPerSecond (#7905) 2025-04-17 19:00:14 -07:00
Peter Johnson
98f933eca5 Merge branch 'main' into 2027 2025-02-20 00:26:23 -08:00
PJ Reiniger
3b345fe218 [bazel] Add macros to build jni code and java tests (#7693) 2025-01-26 16:52:33 -08:00
Sam Carlberg
e52f400687 [wpiunits] Add Measure.per overloads for all known unit types (#7699)
Instead of only providing per(TimeUnit)

Useful for making conversion factors easier, eg `Inches.of(10).per(Rotation)` vs `Inches.of(10).per(Rotation.one())`

Update VelocityUnit.one() and VelocityUnit.zero() to return Velocity objects instead of generic Measure<? extends VelocityUnit<D>>; VelocityUnit is final, so the wildcard generic is unnecessary, and this makes the generated `per` functions possible for this type
2025-01-16 23:24:11 -08:00
Falon
f9b3efb712 [wpiunits] Refactor MomentOfInertiaUnit constructor to use MomentOfInertiaUnit instead of a Per<> (#7546) 2024-12-14 11:26:26 -08:00
sciencewhiz
49e3e4a0be [wpiunits] Fix deprecation javadoc for units negate (#7436)
deprecated javadoc tags aren't inherited
2024-11-27 23:03:23 -08:00
sciencewhiz
6ef5b85758 [wpiunits] Restore and deprecate divide (#7438)
It was changed to div in #7387, but 2024 used divide.
2024-11-27 23:01:26 -08:00
Vignesh Balasubramaniam
ac1836ec44 [wpiunits] Add absolute value and copy sign functionality (#7358) 2024-11-18 17:46:15 -08:00
Tim Winters
bade0a8716 [wpiunits] Use div instead of divide for kotlin compatibility (#7387) 2024-11-15 11:49:40 -07:00
sciencewhiz
71c050389a [wpiunits] Restore and deprecate measure negate (#7345)
Delegate to unaryMinus.

This ensures there's a deprecation message to help users with migration, vs just a compile error.
2024-11-06 16:07:31 -07:00
Tyler Veness
a48f3c35f4 Remove argv usage from Python scripts (#7311)
argparse will automatically read sys.argv, so we don't need to pass it
in manually. Furthermore, none of our scripts customize argv.
2024-11-02 19:09:32 -07:00
Ryan Blue
89c5d98fe9 [build] Use pathlib in wpiunits generation script (#7306)
Makes wpiunits more consistent with the other generation scripts.

Also sort imports, remove args from main.
2024-10-29 23:05:48 -07:00
Nicholas Armstrong
ac907f755a [wpiunits] Add resistance units (#7168) 2024-10-23 08:20:17 -06:00
PJ Reiniger
36e0c9d6db [build] MVP for building with bazel (#6994) 2024-10-19 09:54:49 -07: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
Sam Carlberg
a9b885070e [wpiunits] Java units API rewrite (#6958)
Java generics are too limited to do what we need. This refactors generic code previously in Unit and Measure into unit-specific classes that can have unit-safe math operations (notably, times and divide) that can return values in known units instead of a wildcarded Measure<?>.

Unit-specific measure implementations are automatically generated by ./wpiunits/generate_units.py, which generates generic interfaces and mutable and immutable implementations of those interfaces. These make up the bulk of the diff of this PR (approximately 9300 LOC).

This also adds units for angular and linear velocities, accelerations, and momenta; moment of inertia; and torque.
2024-09-07 10:59:29 -07:00
Gold856
b12b83aa89 Fix typos with cspell (#6972) 2024-08-17 07:44:34 -07:00
Gold856
9703142ebe [build] CMake: simplify source JAR creation and install (#6831)
Bump required minimum CMake version to 3.21.
2024-07-15 15:12:41 -07:00
Gold856
bf75c03218 [build] Clean up CMake files (#6802)
Explicitly list required components when using FindJava and FindJNI
Consolidate find_package calls for Java, JNI, and OpenCV into the root CMakeLists.txt file
Remove references to main_lib_dest
Install missing generated headers
Flatten some if statements
Use LinkMacOSGUI macro instead of hand rolling it
Stop installing OpenCV libraries and an extra ntcorejni library; OpenCV JAR will still be installed to make it easy to use
Only print platform version on Windows
Prevent GUI modules from being built when wpimath is off, which would otherwise cause a build failure
Simplify build configuration checks
Clean up fieldImages JAR creation
Place built JARs in the same subdir as installed JARs
Remove unnecessary JAR includes
Remove extra directories in target_include_directories
Improve CMake docs
2024-07-11 16:01:05 -06:00
Gold856
ae6954c78f [wpiunits] Clarify return conditions for isEquivalent (NFC) (#6727) 2024-06-09 17:54:31 -06:00
Gold856
b0cc84a9c7 [build] Upgrade to PMD 7.2.0 (#6718) 2024-06-08 22:08:23 -07:00
Gold856
b99d9c1710 Use Java 17 features (#6691)
Uses enhanced instanceof (and simplify equals methods)
Uses switch expressions and arrow labels
Seal and finalize some Shuffleboard classes

Co-authored-by: Sam Carlberg <sam@slfc.dev>
2024-06-04 21:09:10 -07:00
Gold856
72a6d22d9a [build] Organize cmake files (#6617) 2024-05-24 10:48:05 -07:00
Wispy
7fbbecb5b7 [wpiunits] Add Measure.divide(Measure<U2>) (#6611) 2024-05-15 07:22:38 -06:00
Tyler Veness
d3af27be94 [wpiunits] Fix Javadoc warning (#6614) 2024-05-12 10:25:44 -07:00
Sam Carlberg
6c9dcc157e [wpiunits] Change units to track their base unit, instead of their base class (#6342)
Unit objects now have a reference to the base unit from which they're derived. Constructing a unit object without specifying a base unit implicitly signifies that it's its own base unit, eg new Angle(null, 1, "Radian", "rad") would be the base angle unit of radians, while new Angle(Radians, 2 * PI, "Rotation", "R") would be a new angle unit based on radians.

This fixes much of the hacky code surrounding the derived unit types Velocity, Per, and Mult, but is a breaking change for any user code that defines custom unit classes or uses the anonymous unit type.
2024-05-12 06:15:56 -07:00
Wispy
39d33bfca6 [wpiunits] Adds FeetPerSecondPerSecond (#6543) 2024-04-27 21:08:13 -07:00
Nicholas Armstrong
3e6c0d0b71 [wpiunits] Add Acceleration and MOI Units (#6495) 2024-04-22 19:09:18 -07:00
vichik
e89c8c1008 [wpiunits] Add isNear function implementation (#6396)
This implementation uses a tolerance in the same units as the measure it checks.
2024-04-21 20:40:33 -07:00
DeltaDizzy
607682b687 [wpiunits] Fix Distance class javadocs to state the correct dimension (NFC) (#6363) 2024-02-19 12:58:56 -08:00
vichik
90bb6cfffa [wpiunits] Fix measure isNear function (#6313)
Now the function allows comparison between negative numbers, positive numbers or both.
2024-01-31 13:18:47 -08:00