Kavin Muralikrishnan
07345712dc
[wpimath] Document default tolerances of PIDController ( #7377 )
2024-11-12 18:19:55 -05:00
Joseph Eng
425bf83036
[wpimath] Add 2D to 3D geometry constructors ( #7380 )
2024-11-12 18:18:37 -05:00
David Vo
6adad7bad7
[wpiutil] Replace StringBuffer usage with StringBuilder ( #7376 )
...
This is a local variable that doesn't escape the method, so there's certainly no reason to have synchronization here.
2024-11-10 07:43:43 -08:00
Kavin Muralikrishnan
280d2c7e32
[examples] Update C++ XRP Code to use SI Units ( #7366 )
2024-11-08 20:24:13 -08:00
Thad House
edc3963955
[wpinet] Fix resolver thread on newer versions of macOS ( #7372 )
...
Implicit capture of this is deprecated.
2024-11-08 20:23:17 -08:00
Tyler Veness
c58be2580d
[ntcore] Suppress warning false positive ( #7370 )
...
```
In copy constructor ‘std::function<_Res(_ArgTypes ...)>::function(const std::function<_Res(_ArgTypes ...)>&) [with _Res = void; _ArgTypes = {unsigned int}]’,
inlined from ‘nt::server::ServerClient4Base::ServerClient4Base(std::string_view, std::string_view, bool, nt::server::SetPeriodicFunc, nt::server::ServerStorage&, int, wpi::Logger&)’ at /home/tav/frc/wpilib/allwpilib/ntcore/src/main/native/cpp/server/ServerClient4Base.h:24:77,
inlined from ‘nt::server::ServerClientLocal::ServerClientLocal(nt::server::ServerStorage&, int, wpi::Logger&)’ at /home/tav/frc/wpilib/allwpilib/ntcore/src/main/native/cpp/server/ServerClientLocal.cpp:18:75:
/usr/include/c++/14.2.1/bits/std_function.h:391:17: error: ‘<anonymous>’ may be used uninitialized [-Werror=maybe-uninitialized]
391 | __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
| ~~~~^~~~~~~~~~
/usr/include/c++/14.2.1/bits/std_function.h: In constructor ‘nt::server::ServerClientLocal::ServerClientLocal(nt::server::ServerStorage&, int, wpi::Logger&)’:
/usr/include/c++/14.2.1/bits/std_function.h:267:7: note: by argument 2 of type ‘const std::_Any_data&’ to ‘static bool std::_Function_handler<_Res(_ArgTypes ...), _Functor>::_M_manager(std::_Any_data&, const std::_Any_data&, std::_Manager_operation) [with _Res = void; _Functor = nt::server::ServerClientLocal::ServerClientLocal(nt::server::ServerStorage&, int, wpi::Logger&)::<lambda(uint32_t)>; _ArgTypes = {unsigned int}]’ declared here
267 | _M_manager(_Any_data& __dest, const _Any_data& __source,
| ^~~~~~~~~~
/home/tav/frc/wpilib/allwpilib/ntcore/src/main/native/cpp/server/ServerClientLocal.cpp:18:75: note: ‘<anonymous>’ declared here
18 | : ServerClient4Base{"", "", true, [](uint32_t) {}, storage, id, logger} {
| ^
```
2024-11-08 20:22:47 -08:00
Peter Johnson
f40bd3593d
[wpilib,wpimath] Don't use mutable units for return values ( #7369 )
...
It only saves a single allocation and can cause confusing behavior on the
caller (user) side.
2024-11-08 18:29:51 -08:00
Thad House
3cc541f261
Remove generated google protobuf support ( #7371 )
...
It's not used anymore, and cleans up the build.
2024-11-08 18:29:30 -08:00
Tyler Veness
811b130968
[docs] Link to Bazel build docs from main readme ( #7367 )
...
I had a really hard to finding them because the main readme didn't call
it out.
2024-11-08 14:05:50 -08:00
Thad House
d39dfd64ea
[build] Fix cmake build with WITH_PROTOBUF off ( #7368 )
...
Protobuf.cpp only uses nanopb, which is fine to have even with WITH_PROTOBUF off.
2024-11-08 14:05:29 -08:00
Tyler Veness
661bae568f
[wpimath] Add time-varying RKDP ( #7362 )
...
This makes the ground truth for the Taylor series AQ discretization more
accurate.
2024-11-07 23:46:52 -08:00
Peter Johnson
01f85abcfe
[ntcore] Use Endian.h in WireEncoder3
2024-11-08 00:46:27 -07:00
Peter Johnson
396f8203ac
[ntcore] HandleMap: Use concepts for T
2024-11-08 00:46:27 -07:00
Peter Johnson
4a43ddbacf
[ntcore] Split LocalStorage implementation into separate files
2024-11-08 00:46:27 -07:00
Peter Johnson
0921054a28
[ntcore] Split ServerImpl implementation into separate files
2024-11-08 00:46:27 -07:00
Peter Johnson
f738fc92f0
[ntcore] Move ServerImpl to nt::server namespace
2024-11-08 00:46:27 -07:00
Peter Johnson
a0f38f83f9
[ntcore] NetworkOutgoingQueue: Move function defs inside class
2024-11-08 00:46:27 -07:00
Peter Johnson
876be30724
[ntcore] Value: Inline constructors
2024-11-08 00:46:27 -07:00
Peter Johnson
de318fab91
[ntcore] LocalStorage: Move template functions inside class definition
2024-11-08 00:46:27 -07:00
Thad House
8b8b634f65
[wpiutil] Change C++ protobuf to nanopb ( #7309 )
...
The Google C++ protobuf implementation has issues with dynamic linkage across DLL boundaries because it uses global variables. It also has a compile-time dependency because the protoc version must exactly match the libprotobuf version. Using nanopb with a customized generator fixes both of these issues.
Co-authored-by: Gold856 <117957790+Gold856@users.noreply.github.com >
2024-11-07 22:42:50 -08:00
Thad House
fd2e0c0427
[ntcoreffi] Switch ntcoreffi DLM to WPI_String ( #7359 )
...
We forgot to do this originally.
2024-11-07 15:19:37 -07:00
Tyler Veness
a66fa339dc
[wpimath] Make controllers and some trajectory classes constexpr ( #7343 )
2024-11-07 14:02:11 -07:00
Kavin Muralikrishnan
44a45d44e2
[xrp] Update XRP C++ Method/Class Descriptions for Java Parity ( #7351 )
...
Co-authored-by: Ryan Blue <ryanzblue@gmail.com >
2024-11-06 16:12:16 -07:00
Ryan Blue
af652817d9
[commands] Revert "WrappedCommand: Call wrapped command initSendable ( #6471 )" ( #7353 )
...
This reverts commit 7bc0380694 .
Calling initSendable on the wrapped command is fundamentally flawed as the wrapper is the command being sent.
2024-11-06 16:10:37 -07:00
Ryan Blue
5a16b0e108
[wpilib] Refactor Alert ( #7279 )
...
This refactors Alert in both c++ and java to fix the issues with the current c++ implementation and improve performance.
Currently, constructing an Alert adds it to a list of Alerts with the same group and type. Activating an alert sets a flag on the alert. When the SendableAlerts is polled (GetStrings), the entire list is iterated over, filtered, and the filtered list is sorted by timestamp. This leads to a worst case O(m + nlog(n)) time complexity for GetStrings, where m and n are the count of total constructed alerts active alerts respectively. It also allocates intermediate data structures to hold the active alert strings for sorting.
This changes the implementation to improve the performance of GetStrings, by shifting the sorting overhead to Alert.Set
Constructing the Alert only initializes the alert's initial state, and initializes the SendableAlerts for the group if it is not already initialized.
Activating or deactivating an alert sets an internal flag for state tracking, and inserts or removes a structure containing the timestamp and text into a self-sorting data structure (std::set, TreeSet) containing other active alerts with the same group and type. (worst case O(log(n))
Now, SendableAlerts.GetStrings only has to iterate over the structure and copy the strings to the returned array. (amortized O(n))
This also fixes the c++ implementation by removing the need for SendableAlerts to directly access the Alert.
This also adds a helper method to SendableRegistry to force initialization of the instance to prevent static initialization ordering issues.
2024-11-06 16:09:06 -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
Ryan Blue
83fa422338
[wpiutil] DynamicStruct: Fix decoding of signed integers ( #7350 )
...
Add tests for both C++ and Java.
2024-11-05 17:45:49 -07:00
Tyler Veness
3113627be6
[wpimath] Fix PIDController error tolerance getters ( #7341 )
2024-11-05 09:52:22 -07:00
Thad House
f2d2500d1d
[wpiutil] Check MSVC Runtime ( #7301 )
2024-11-05 09:51:48 -07:00
Tyler Veness
63e623d70b
[wpimath] Fix case and order of HolonomicDriveController PID getters ( #7342 )
2024-11-05 09:50:17 -07:00
Tyler Veness
9e8d37c03b
[wpimath] Remove unhelpful test fixtures ( #7344 )
...
These test fixtures were adding complexity while only saving one line of
object initialization per test. Our other tests like this just make the
object at the top of each test.
2024-11-05 09:49:38 -07:00
truher
ad09d73dd6
[ntcore] Replace "ValueListenerPoller" with "NetworkTableListenerPoller" in docs ( #7328 )
2024-11-05 09:49:03 -07:00
Ryan Blue
3fd33b1f72
[wpiutil] DynamicStruct: Clear nested fields when updating/adding a schema ( #7334 )
2024-11-05 09:48:24 -07:00
Jade
043c155087
Fix a few clangd warnings ( #7335 )
2024-11-05 09:47:54 -07:00
Ryan Blue
7a6c7af412
[wpiutil] Fix dynamic struct decoding for nested structs ( #7346 )
...
After a struct-type field descriptor had offsets calculated more than once, IsBitField would return true, causing the second call to CalculateOffsets to calculate incorrect offsets.
2024-11-05 06:43:04 -07:00
Ryan Blue
8588b5e520
[glass] Revert "Storage: Store Value by value" ( #7333 )
...
This reverts commit 309b370223 .
Storage::GetChildArray never initializes the child array when the entry is new, so it returns invalid references.
2024-11-04 23:34:18 -07:00
Jade
debb52156c
[wpilib] Clamp sim battery voltage to 0 ( #7325 )
2024-11-03 10:37:44 -08:00
Kavin Muralikrishnan
23e71e10e4
[xrp] Add getter for XRP LED ( #7327 )
2024-11-03 10:32:03 -08:00
Sam Carlberg
44c0bbc4a9
[epilogue] Generate unique names for variables used in instanceof chains ( #7323 )
...
Fixes an issue where the variable names would clash with the field names of the associated VarHandles.
2024-11-02 19:11:22 -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
Tyler Veness
7c91b81906
[ci] Upgrade to wpiformat 2024.45 ( #7326 )
2024-11-02 17:56:55 -07:00
Jade
eb8583596c
[ci] Remove parts of Bazel CI ( #7324 )
...
We were building huge amounts with bazel we were already building
otherwise. We've been getting heavily backlogged in CI because of the amount
of CI jobs we are running versus our maximum runners quota (particularly on Mac), so this really isn't worth it right now.
2024-11-02 07:05:24 -07:00
Tyler Veness
dfd1084526
[wpimath] Replace pi with symbol in docs ( #7322 )
2024-11-01 17:16:18 -07:00
Peter Johnson
2cfe114c78
[wpiutil] DynamicStruct: Store StructDescriptor by value
2024-10-31 22:04:13 -07:00
Peter Johnson
caae5357b7
[wpilibc] Mechanism2d: Store roots by value
2024-10-31 22:04:13 -07:00
Peter Johnson
22e91bfacd
[wpilibc] ShuffleboardInstance: Store ShuffleboardTab by value
2024-10-31 22:04:13 -07:00
Peter Johnson
67e1b5fe95
[sim] halsim_ws_core: Store SimDeviceValueData by value
2024-10-31 22:04:13 -07:00
Peter Johnson
27e07d6787
[ntcore] ClientImpl3: Store Entry by value
2024-10-31 22:04:13 -07:00
Peter Johnson
e49d452e46
[glass] Context: Store storageRoots by value
2024-10-31 22:04:13 -07:00
Peter Johnson
5c0edc2410
[glass] Field2D: Store field objects by value
2024-10-31 22:04:13 -07:00