Commit Graph

5527 Commits

Author SHA1 Message Date
Jonah Snider
dd163b62ae [wpimath] Rotation2d: Add factory method that uses rotations (#4166)
Rotation2d.fromRotations(1).equals(new Rotation2d(2 * Math.PI)); // true

Also adds a member method to get the value of the Rotation2d in rotations.
2022-04-13 22:31:43 -07:00
Tyler Veness
bd80e220b9 [ci] Upgrade CMake actions (#4161) 2022-04-12 19:00:00 -07:00
Tyler Veness
aef4b16d4c [wpimath] Remove unnecessary NOLINT in LinearPlantInversionFeedforward (NFC) (#4155) 2022-04-08 21:31:42 -07:00
Spud
975171609e [wpilib] Compressor: Rename enabled to isEnabled (#4147)
This is a less confusing name, as enabled() can imply it enables the compressor.
2022-04-08 21:31:08 -07:00
Tyler Veness
5bf46a9093 [wpimath] Add ComputerVisionUtil (#4124)
Closes #4108.
2022-04-08 21:20:53 -07:00
ohowe
f27a1f9bfb [commands] Fix JoystickButton.getAsBoolean (#4131)
This previously always returned false; the get method it inherited was not used in the getAsBoolean defined in the Trigger class. The fix is to swap get() and getAsBoolean() implementations in the Trigger class.
2022-04-08 21:20:23 -07:00
Excalibur FRC | 6738
1b26e2d5da [commands] Add RepeatCommand (#4009)
Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
2022-04-07 22:02:08 -07:00
apple
88222daa3d [hal] Fix misspelling in AnalogInput/Output docs (NFC) (#4153)
value -> valid
(NFC)
2022-04-07 21:57:01 -07:00
Tyler Veness
81c5b41ce1 [wpilibj] Document MechanismLigament2d angle unit (NFC) (#4142) 2022-03-31 00:29:44 -07:00
Peter Johnson
9650e6733e [wpiutil] DataLog: Document finish and thread safety (NFC) (#4140) 2022-03-29 12:28:59 -07:00
Tyler Veness
c8905ec29a [wpimath] Remove ImplicitModelFollower dt argument (#4119)
The math works just fine without model discretization.
2022-03-29 11:29:06 -07:00
Tyler Veness
b4620f01f9 [wpimath] Fix Rotation2d interpolation in Java (#4125)
Fixes #4112.
2022-03-29 08:42:43 -07:00
Tyler Veness
2e462a19d3 [wpimath] Constexprify units unary operators (#4138)
Fixes #4137.
2022-03-29 08:42:08 -07:00
Peter Johnson
069f932e59 [build] Fix gl3w cmake build (#4139) 2022-03-28 22:31:51 -07:00
Tyler Veness
126e3de91a [wpilibc] Remove unused SetPriority() call from Ultrasonic (#4123) 2022-03-24 07:24:12 -07:00
Tyler Veness
ba0dccaae4 [wpimath] Fix reference to Rotation2d.fromRadians() (#4118)
Rotation2d.fromRadians() doesn't exist. The constructor should be used
instead.
2022-03-20 21:57:03 -07:00
sciencewhiz
e1b6e5f212 [wpilib] Improve MotorSafety documentation (NFC) (#4120)
Remove OBE RobotDrive porting guide from MecanumDrive
2022-03-20 21:54:43 -07:00
Tyler Veness
8d79dc8738 [wpimath] Add ImplicitModelFollower (#4056) 2022-03-20 00:36:12 -07:00
Tyler Veness
78108c2aba [wpimath] Fix PIDController having incorrect error after calling SetSetpoint() (#4070) 2022-03-19 23:59:00 -07:00
Tyler Veness
cdafc723fb [examples] Remove unused LinearPlantInversionFeedforward includes (#4069) 2022-03-19 20:47:09 -07:00
Ashray._.g
0d70884dce [wpimath] Add InterpolatedTreeMap (#4073)
- Add InterpolatedTreeMap for Java from team 254's 2016 MIT licensed code
- Add InterpolatedMap for C++ from team 3512's code with @calcmogul (original author) permission

Co-authored-by: Tyler Veness <calcmogul@gmail.com>
2022-03-19 20:46:42 -07:00
Tyler Veness
765efa325e [wpimath] Remove redundant column index from vectors (#4116) 2022-03-19 20:44:14 -07:00
Tyler Veness
89ffcbbe41 [wpimath] Update TrapezoidProfile class name in comment (NFC) (#4107) 2022-03-19 20:41:53 -07:00
Tyler Veness
95ae23b0e7 [wpimath] Improve EKF numerical stability (#4093)
The Joseph form of the error covariance update equation is more
numerically stable when the Kalman gain isn't optimal. Numerical
instability and filter divergence can occur if the user goes long time
periods between updates and the error covariance becomes ill-conditioned
(the ratio between the largest and smallest eigenvalue gets too large).
2022-03-19 20:41:28 -07:00
Tyler Veness
d5cb6fed67 [wpimath] Support zero cost entries in MakeCostMatrix() (#4100)
The existing implementation will produce a cost of NaN if a tolerance of
infinity is entered, but the limit approaches zero. Being able to
specify that a state has no cost is useful, so this change adds support for
that.
2022-03-19 20:40:26 -07:00
Tyler Veness
d0fef18378 [wpimath] Remove redundant this. from ExtendedKalmanFilter.java (#4115) 2022-03-19 20:39:10 -07:00
Tyler Veness
d640c0f41f [wpimath] Fix pose estimator local measurement standard deviation docs (NFC) (#4113) 2022-03-19 20:38:32 -07:00
Dustin Spicuzza
a2fa5e3ff7 [wpilibc] BatterySim: Provide non-initializer list versions of Calculate (#4076) 2022-03-14 10:09:55 -07:00
sciencewhiz
a3eea9958e [hal] Add link to FRC CAN Spec (NFC) (#4086) 2022-03-14 10:07:44 -07:00
Tyler Veness
db27331d7b [wpilib] Update DifferentialDrive docs (NFC) (#4085)
Fixes #4084.
2022-03-14 10:07:06 -07:00
Peter Johnson
fdfb31f164 [dlt] Export boolean[] values (#4082) 2022-03-14 10:05:50 -07:00
Dustin Spicuzza
f93c3331b3 [wpigui] disable changing directory when initializing on MacOS (#4092)
- Seems to be intended for resource bundles in MacOS apps, which we don't use
2022-03-14 10:05:22 -07:00
Thad House
ab7ac4fbb9 [build] Fix various warnings in cmake builds (#4081) 2022-03-07 22:36:42 -08:00
Thad House
bc39a1a293 [wpilibc] Fix moved pneumatics objects not destructing properly (#4068) 2022-03-01 11:10:45 -08:00
Tyler Veness
2668130e70 [wpimath] Remove SwerveDrivePoseEstimator encoder reset warning (#4066)
SwerveDrivePoseEstimator uses velocities, so position resets aren't
needed.

Closes #4065.
2022-02-28 17:40:25 -08:00
Austin Shalit
d27ed3722b [ci] Set actions workflow concurrency (#4060)
This sets the workflow concurrency to 1 for all workflows. For PRs this means if you push an additional commit older jobs will be cancelled.

The documentation workflow already only runs on tags or merges to main. For this, we cancel previous runs if they are to the same destination (tag or main) but still prevent 2 jobs from running at once if they are spawned from different refs.
2022-02-27 20:13:58 -08:00
shueja-personal
dae18308c9 [wpimath] Minor fixes to Rotation2d docs (NFC) (#4055)
Fixed incorrect examples on .plus(), and a missing word.

Make example code snippets closer to actual use.
2022-02-27 16:56:56 -08:00
Peter Johnson
d66555e42f [datalogtool] Add datalogtool
This is a support tool for datalog file conversion (and eventually
download/remote datalog file management).
v2022.4.1
2022-02-26 09:49:34 -08:00
Peter Johnson
9f52d8a3b1 [wpilib] DriverStation: Add DataLog support for modes and joystick data 2022-02-26 09:49:34 -08:00
Peter Johnson
757ea91932 [wpilib] Add DataLogManager
This creates a default log file that captures NT changes and
automatically renames the log file based on time and match info.

DriverStation joystick logging will be implemented by the DriverStation
class instead.
2022-02-26 09:49:34 -08:00
Peter Johnson
02a804f1c5 [ntcore] Add DataLog support 2022-02-26 09:49:34 -08:00
Peter Johnson
9b500df0d9 [wpiutil] Add high speed data logging 2022-02-26 09:49:34 -08:00
Peter Johnson
5a89575b3a [wpiutil] Import customized LLVM MemoryBuffer 2022-02-26 09:49:34 -08:00
Peter Johnson
b8c4d7527b [wpiutil] Add MappedFileRegion 2022-02-26 09:49:34 -08:00
Alberto Jahuey Moncada
ac5d46cfa7 [wpilibc] Fix ProfiledPID SetTolerance default velocity value (#4054)
When trying to set the tolerance of a ProfiledPID, it fails if you don't give it a velocity value. It was missing a conversion from double to the appropiate unit.
2022-02-25 20:27:56 -08:00
Thad House
bc9e96e86f [wpilib] Absolute Encoder API and behavior fixes (#4052)
SetPositionOffset was added. Been requested multiple times, and easy to implement.

The javadocs mentioned GetPositionInRotation. It has tripped up many people how to get the absolute position from the encoder (You currently have to have precreated the DutyCycle object). Add this method (as GetAbsolutePostition) to make this easier to do.

The checks for making sure a matching set of values was read was doing direct double comparisions. This worked ok in the DutyCycle case, but has problems in the analog case. Solve this by using an epsilon comparison.

And finally, scale AnalogEncoders analog input to 0-1 instead of 0-5. This was reported a few years ago, but the issue was missed. This caused the encoder to count from 0-5, then 1-6, then 2-7 etc. This is solved and now works correctly.

Closes #3188
Closes #4046
Closes #4051

And fixes the following issue on CD
https://www.chiefdelphi.com/t/wpilib-analogencoder-java/372649
2022-02-24 22:45:15 -08:00
Dustin Spicuzza
f88c435dd0 [hal] Add mechanism to cancel all periodic callbacks (#4049) 2022-02-23 09:46:01 -08:00
Leonard Abbas
e4b91005cf [examples] Update SwerveModule constructor doc (NFC) (#4042)
Renamed "port" to "channel" for consistency.
2022-02-22 09:26:16 -08:00
Leonard Abbas
a260bfd83b [examples] Remove "this" keyword from SwerveModule (#4043) 2022-02-21 09:27:00 -08:00
Leonard Abbas
18e262a100 [examples] Fix multiple doc typos in SwerveControllerCommand example (NFC) (#4044) 2022-02-21 09:26:20 -08:00