Commit Graph

7 Commits

Author SHA1 Message Date
Tyler Veness
87384ea684 [wpilib] Fix PIDController continuous range error calculations (#3170)
The inputs should all be errors, so the range should be symmetric.

Fixes #3168.
Fixes #3304.
2021-05-21 23:52:30 -07:00
Peter Johnson
8f1f64ffb6 Remove year from file copyright message (NFC) (#2972)
Also update copyright to include "and other WPILib contributors" and clarify
license referral language to not be restricted to FIRST teams.
2020-12-26 14:12:05 -08:00
Tyler Veness
a112b5e231 [wpilib] Fix ProfiledPIDController continuous input (#2652)
There were three bugs:

1. The input range variables used in ProfiledPIDController::Calculate()
   weren't being updated
2. The modulus error calculation was incorrect.
3. The setpoint wasn't being wrapped like the goal, so the invariant
   that the error remains less than half the input range was violated.
   (Thanks to @CptJJ for pointing this out and suggesting a fix.)
2020-10-15 20:05:23 -07:00
Tyler Veness
ffa4b907c0 Fix C++ floating point literal formatting (#2114)
Found formatting errors with this regex
"([^a-z0-9\.]\.[0-9]|[^a-z0-9\.][0-9]\.[^a-z0-9\.])" and ignored false
positives.

Fixes #2112.
2019-11-20 21:48:15 -08:00
Tyler Veness
9b6ffc201c Replace SetOutputRange() with SetIntegratorRange()
If users are attempting to use the output range to limit the controller
action, they should use ProfiledPIDController instead. If they actually
intended to clamp the output, they should use std::clamp().
2019-09-03 19:46:59 -07:00
Tyler Veness
ff8b8f0a8a Remove percent tolerance from PID controller
It breaks the unit system badly; the tolerance member variable has
different units depending on percent vs absolute. Absolute tolerance is
a lot more natural than percent tolerance anyway.
2019-09-03 19:46:59 -07:00
Tyler Veness
fa06403000 Move drive integration tests into wpilibj/src/test (#1836)
Also move drive and controller tests into subfolders.
2019-08-20 21:05:38 -07:00