Remove deprecated code (#8656)

This commit is contained in:
Gold856
2026-03-15 00:28:31 -04:00
committed by GitHub
parent f1adce4cf7
commit d1fba06851
52 changed files with 10 additions and 1135 deletions

View File

@@ -222,28 +222,6 @@ public class PIDController implements Sendable, AutoCloseable {
return m_period;
}
/**
* Returns the position tolerance of this controller.
*
* @return the position tolerance of the controller.
* @deprecated Use getErrorTolerance() instead.
*/
@Deprecated(forRemoval = true, since = "2025")
public double getPositionTolerance() {
return m_errorTolerance;
}
/**
* Returns the velocity tolerance of this controller.
*
* @return the velocity tolerance of the controller.
* @deprecated Use getErrorDerivativeTolerance() instead.
*/
@Deprecated(forRemoval = true, since = "2025")
public double getVelocityTolerance() {
return m_errorDerivativeTolerance;
}
/**
* Returns the error tolerance of this controller. Defaults to 0.05.
*
@@ -377,28 +355,6 @@ public class PIDController implements Sendable, AutoCloseable {
m_errorDerivativeTolerance = errorDerivativeTolerance;
}
/**
* Returns the difference between the setpoint and the measurement.
*
* @return The error.
* @deprecated Use getError() instead.
*/
@Deprecated(forRemoval = true, since = "2025")
public double getPositionError() {
return m_error;
}
/**
* Returns the velocity error.
*
* @return The velocity error.
* @deprecated Use getErrorDerivative() instead.
*/
@Deprecated(forRemoval = true, since = "2025")
public double getVelocityError() {
return m_errorDerivative;
}
/**
* Returns the difference between the setpoint and the measurement.
*

View File

@@ -6,34 +6,12 @@ package org.wpilib.math.trajectory.constraint;
import org.wpilib.math.geometry.Ellipse2d;
import org.wpilib.math.geometry.Pose2d;
import org.wpilib.math.geometry.Rotation2d;
import org.wpilib.math.geometry.Translation2d;
/** Enforces a particular constraint only within an elliptical region. */
public class EllipticalRegionConstraint implements TrajectoryConstraint {
private final Ellipse2d m_ellipse;
private final TrajectoryConstraint m_constraint;
/**
* Constructs a new EllipticalRegionConstraint.
*
* @param center The center of the ellipse in which to enforce the constraint.
* @param xWidth The width of the ellipse in which to enforce the constraint in meters.
* @param yWidth The height of the ellipse in which to enforce the constraint in meters.
* @param rotation The rotation to apply to all radii around the origin.
* @param constraint The constraint to enforce when the robot is within the region.
* @deprecated Use constructor taking Ellipse2d instead.
*/
@Deprecated(since = "2025", forRemoval = true)
public EllipticalRegionConstraint(
Translation2d center,
double xWidth,
double yWidth,
Rotation2d rotation,
TrajectoryConstraint constraint) {
this(new Ellipse2d(new Pose2d(center, rotation), xWidth / 2.0, yWidth / 2.0), constraint);
}
/**
* Constructs a new EllipticalRegionConstraint.
*

View File

@@ -6,29 +6,12 @@ package org.wpilib.math.trajectory.constraint;
import org.wpilib.math.geometry.Pose2d;
import org.wpilib.math.geometry.Rectangle2d;
import org.wpilib.math.geometry.Translation2d;
/** Enforces a particular constraint only within a rectangular region. */
public class RectangularRegionConstraint implements TrajectoryConstraint {
private final Rectangle2d m_rectangle;
private final TrajectoryConstraint m_constraint;
/**
* Constructs a new RectangularRegionConstraint.
*
* @param bottomLeftPoint The bottom left point of the rectangular region in which to enforce the
* constraint.
* @param topRightPoint The top right point of the rectangular region in which to enforce the
* constraint.
* @param constraint The constraint to enforce when the robot is within the region.
* @deprecated Use constructor taking Rectangle2d instead.
*/
@Deprecated(since = "2025", forRemoval = true)
public RectangularRegionConstraint(
Translation2d bottomLeftPoint, Translation2d topRightPoint, TrajectoryConstraint constraint) {
this(new Rectangle2d(bottomLeftPoint, topRightPoint), constraint);
}
/**
* Constructs a new RectangularRegionConstraint.
*

View File

@@ -67,48 +67,6 @@ class WPILIB_DLLEXPORT ArmFeedforward {
}
}
/**
* Calculates the feedforward from the gains and setpoints assuming continuous
* control.
*
* @param angle The angle setpoint, in radians. This angle should be
* measured from the horizontal (i.e. if the provided
* angle is 0, the arm should be parallel to the floor).
* If your encoder does not follow this convention, an
* offset should be added.
* @param velocity The velocity setpoint.
* @param acceleration The acceleration setpoint.
* @return The computed feedforward, in volts.
*/
[[deprecated("Use the current/next velocity overload instead.")]]
constexpr wpi::units::volt_t Calculate(
wpi::units::unit_t<Angle> angle, wpi::units::unit_t<Velocity> velocity,
wpi::units::unit_t<Acceleration> acceleration) const {
return kS * wpi::util::sgn(velocity) + kG * wpi::units::math::cos(angle) +
kV * velocity + kA * acceleration;
}
/**
* Calculates the feedforward from the gains and setpoints assuming continuous
* control.
*
* @param currentAngle The current angle in radians. This angle should be
* measured from the horizontal (i.e. if the provided angle is 0, the arm
* should be parallel to the floor). If your encoder does not follow this
* convention, an offset should be added.
* @param currentVelocity The current velocity setpoint.
* @param nextVelocity The next velocity setpoint.
* @param dt Time between velocity setpoints in seconds.
* @return The computed feedforward in volts.
*/
[[deprecated("Use the current/next velocity overload instead.")]]
wpi::units::volt_t Calculate(wpi::units::unit_t<Angle> currentAngle,
wpi::units::unit_t<Velocity> currentVelocity,
wpi::units::unit_t<Velocity> nextVelocity,
wpi::units::second_t dt) const {
return Calculate(currentAngle, currentVelocity, nextVelocity);
}
/**
* Calculates the feedforward from the gains and setpoint assuming discrete
* control. Use this method when the velocity does not change.

View File

@@ -192,28 +192,6 @@ class WPILIB_DLLEXPORT PIDController
return m_errorDerivativeTolerance;
}
/**
* Gets the position tolerance of this controller.
*
* @return The position tolerance of the controller.
* @deprecated Use GetErrorTolerance() instead.
*/
[[deprecated("Use the GetErrorTolerance method instead.")]]
constexpr double GetPositionTolerance() const {
return m_errorTolerance;
}
/**
* Gets the velocity tolerance of this controller.
*
* @return The velocity tolerance of the controller.
* @deprecated Use GetErrorDerivativeTolerance() instead.
*/
[[deprecated("Use the GetErrorDerivativeTolerance method instead.")]]
constexpr double GetVelocityTolerance() const {
return m_errorDerivativeTolerance;
}
/**
* Gets the accumulated error used in the integral calculation of this
* controller.
@@ -328,24 +306,6 @@ class WPILIB_DLLEXPORT PIDController
*/
constexpr double GetErrorDerivative() const { return m_errorDerivative; }
/**
* Returns the difference between the setpoint and the measurement.
* @deprecated Use GetError() instead.
*/
[[deprecated("Use GetError method instead.")]]
constexpr double GetPositionError() const {
return m_error;
}
/**
* Returns the velocity error.
* @deprecated Use GetErrorDerivative() instead.
*/
[[deprecated("Use GetErrorDerivative method instead.")]]
constexpr double GetVelocityError() const {
return m_errorDerivative;
}
/**
* Returns the next output of the PID controller.
*

View File

@@ -21,26 +21,6 @@ namespace wpi::math {
template <std::derived_from<TrajectoryConstraint> Constraint>
class EllipticalRegionConstraint : public TrajectoryConstraint {
public:
/**
* Constructs a new EllipticalRegionConstraint.
*
* @param center The center of the ellipse in which to enforce the constraint.
* @param xWidth The width of the ellipse in which to enforce the constraint.
* @param yWidth The height of the ellipse in which to enforce the constraint.
* @param rotation The rotation to apply to all radii around the origin.
* @param constraint The constraint to enforce when the robot is within the
* region.
* @deprecated Use constructor taking Ellipse2d instead.
*/
[[deprecated("Use constructor taking Ellipse2d instead.")]]
constexpr EllipticalRegionConstraint(const Translation2d& center,
wpi::units::meter_t xWidth,
wpi::units::meter_t yWidth,
const Rotation2d& rotation,
const Constraint& constraint)
: m_ellipse{Pose2d{center, rotation}, xWidth / 2.0, yWidth / 2.0},
m_constraint(constraint) {}
/**
* Constructs a new EllipticalRegionConstraint.
*

View File

@@ -19,23 +19,6 @@ namespace wpi::math {
template <std::derived_from<TrajectoryConstraint> Constraint>
class RectangularRegionConstraint : public TrajectoryConstraint {
public:
/**
* Constructs a new RectangularRegionConstraint.
*
* @param bottomLeftPoint The bottom left point of the rectangular region in
* which to enforce the constraint.
* @param topRightPoint The top right point of the rectangular region in which
* to enforce the constraint.
* @param constraint The constraint to enforce when the robot is within the
* region.
* @deprecated Use constructor taking Rectangle2d instead.
*/
[[deprecated("Use constructor taking Rectangle2d instead.")]]
constexpr RectangularRegionConstraint(const Translation2d& bottomLeftPoint,
const Translation2d& topRightPoint,
const Constraint& constraint)
: m_rectangle{bottomLeftPoint, topRightPoint}, m_constraint(constraint) {}
/**
* Constructs a new RectangularRegionConstraint.
*

View File

@@ -13,10 +13,6 @@ classes:
wpi::units::volt_t, wpi::units::volt_t, wpi::units::unit_t<kv_unit>, wpi::units::unit_t<ka_unit>:
Calculate:
overloads:
wpi::units::unit_t<Angle>, wpi::units::unit_t<Velocity>, wpi::units::unit_t<Acceleration> [const]:
ignore: true
wpi::units::unit_t<Angle>, wpi::units::unit_t<Velocity>, wpi::units::unit_t<Velocity>, wpi::units::second_t [const]:
ignore: true
wpi::units::unit_t<Angle>, wpi::units::unit_t<Velocity> [const]:
wpi::units::unit_t<Angle>, wpi::units::unit_t<Velocity>, wpi::units::unit_t<Velocity> [const]:
MaxAchievableVelocity:

View File

@@ -10,20 +10,10 @@ classes:
methods:
EllipticalRegionConstraint:
overloads:
const Translation2d&, wpi::units::meter_t, wpi::units::meter_t, const Rotation2d&, const Constraint&:
const Ellipse2d&, const Constraint&:
MaxVelocity:
MinMaxAcceleration:
template_inline_code: |
cls_EllipticalRegionConstraint
.def_static("fromFeet", [](const Translation2d& center, wpi::units::foot_t xWidth,
wpi::units::foot_t yWidth, const Rotation2d& rotation,
const Constraint& constraint) {
return std::make_shared<EllipticalRegionConstraint<Constraint>>(center, xWidth, yWidth, rotation, constraint);
}, py::arg("center"), py::arg("xWidth"), py::arg("yWidth"), py::arg("rotation"), py::arg("constraint"))
;
templates:
EllipticalRegionConstraint:
qualname: wpi::math::EllipticalRegionConstraint

View File

@@ -19,8 +19,6 @@ classes:
GetPeriod:
GetErrorTolerance:
GetErrorDerivativeTolerance:
GetPositionTolerance:
GetVelocityTolerance:
GetAccumulatedError:
SetSetpoint:
GetSetpoint:
@@ -32,8 +30,6 @@ classes:
SetTolerance:
GetError:
GetErrorDerivative:
GetPositionError:
GetVelocityError:
Calculate:
overloads:
double:

View File

@@ -10,7 +10,6 @@ classes:
methods:
RectangularRegionConstraint:
overloads:
const Translation2d&, const Translation2d&, const Constraint&:
const Rectangle2d&, const Constraint&:
MaxVelocity:
MinMaxAcceleration: