mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
[wpilib] Clamp input voltage in sim classes (#2955)
This commit is contained in:
@@ -72,6 +72,16 @@ class DifferentialDrivetrainSim {
|
||||
units::meter_t trackWidth,
|
||||
const std::array<double, 7>& measurementStdDevs = {});
|
||||
|
||||
/**
|
||||
* Clamp the input vector such that no element exceeds the given voltage. If
|
||||
* any does, the relative magnitudes of the input will be maintained.
|
||||
*
|
||||
* @param u The input vector.
|
||||
* @param maxVoltage The maximum voltage.
|
||||
* @return The normalized input.
|
||||
*/
|
||||
Eigen::Matrix<double, 2, 1> ClampInput(Eigen::Matrix<double, 2, 1> u);
|
||||
|
||||
/**
|
||||
* Sets the applied voltage to the drivetrain. Note that positive voltage must
|
||||
* make that side of the drivetrain travel forward (+X).
|
||||
|
||||
Reference in New Issue
Block a user