From d1fba06851de0e31a89f06a4e41f2d1bda950780 Mon Sep 17 00:00:00 2001 From: Gold856 <117957790+Gold856@users.noreply.github.com> Date: Sun, 15 Mar 2026 00:28:31 -0400 Subject: [PATCH] Remove deprecated code (#8656) --- .../vision/apriltag/AprilTagFieldLayout.java | 4 +- .../vision/apriltag/AprilTagFields.java | 14 --- .../main/native/cpp/AprilTagFieldLayout.cpp | 5 - .../wpi/apriltag/AprilTagFieldLayout.hpp | 11 -- .../python/semiwrap/AprilTagFieldLayout.yml | 2 - .../java/org/wpilib/command2/Command.java | 30 ----- .../org/wpilib/command2/ProxyCommand.java | 18 --- .../main/native/cpp/frc2/command/Command.cpp | 4 - .../native/cpp/frc2/command/CommandPtr.cpp | 14 --- .../main/native/cpp/frc2/command/Commands.cpp | 1 - .../native/cpp/frc2/command/ProxyCommand.cpp | 13 -- .../native/include/wpi/commands2/Command.hpp | 8 -- .../include/wpi/commands2/CommandPtr.hpp | 23 ---- .../native/include/wpi/commands2/Commands.hpp | 1 - .../include/wpi/commands2/ProxyCommand.hpp | 41 ------ .../src/main/python/commands2/__init__.py | 13 -- .../src/main/python/commands2/command.py | 29 ----- .../src/main/python/commands2/proxycommand.py | 63 +--------- .../test/python/test_command_decorators.py | 18 --- .../main/native/cpp/jni/NetworkTablesJNI.cpp | 4 - .../native/cpp/driverstation/hid.cpp.jinja | 40 +----- .../include/wpi/driverstation/hid.hpp.jinja | 101 +-------------- .../cpp/driverstation/NiDsPS4Controller.cpp | 1 - .../cpp/driverstation/NiDsPS5Controller.cpp | 1 - .../driverstation/NiDsStadiaController.cpp | 1 - .../cpp/driverstation/NiDsXboxController.cpp | 1 - .../cpp/framework/IterativeRobotBase.cpp | 8 +- .../src/main/native/cpp/system/Resource.cpp | 68 ---------- .../wpi/framework/IterativeRobotBase.hpp | 11 -- .../native/include/wpi/system/Resource.hpp | 88 ------------- .../python/semiwrap/IterativeRobotBase.yml | 1 - wpilibj/src/generate/main/java/hid.java.jinja | 118 +----------------- .../driverstation/NiDsPS4Controller.java | 1 - .../driverstation/NiDsPS5Controller.java | 1 - .../driverstation/NiDsStadiaController.java | 1 - .../driverstation/NiDsXboxController.java | 1 - .../wpilib/framework/IterativeRobotBase.java | 16 +-- .../main/java/org/wpilib/system/Resource.java | 107 ---------------- .../wpilib/math/controller/PIDController.java | 44 ------- .../EllipticalRegionConstraint.java | 22 ---- .../RectangularRegionConstraint.java | 17 --- .../wpi/math/controller/ArmFeedforward.hpp | 42 ------- .../wpi/math/controller/PIDController.hpp | 40 ------ .../constraint/EllipticalRegionConstraint.hpp | 20 --- .../RectangularRegionConstraint.hpp | 17 --- .../main/python/semiwrap/ArmFeedforward.yml | 4 - .../semiwrap/EllipticalRegionConstraint.yml | 10 -- .../main/python/semiwrap/PIDController.yml | 4 - .../semiwrap/RectangularRegionConstraint.yml | 1 - .../src/main/native/cpp/xrp/XRPServo.cpp | 22 ---- .../main/native/include/wpi/xrp/XRPServo.hpp | 18 --- .../src/main/python/semiwrap/XRPServo.yml | 2 - 52 files changed, 10 insertions(+), 1135 deletions(-) delete mode 100644 wpilibc/src/main/native/cpp/system/Resource.cpp delete mode 100644 wpilibc/src/main/native/include/wpi/system/Resource.hpp delete mode 100644 wpilibj/src/main/java/org/wpilib/system/Resource.java diff --git a/apriltag/src/main/java/org/wpilib/vision/apriltag/AprilTagFieldLayout.java b/apriltag/src/main/java/org/wpilib/vision/apriltag/AprilTagFieldLayout.java index 0c24a73962..263af46379 100644 --- a/apriltag/src/main/java/org/wpilib/vision/apriltag/AprilTagFieldLayout.java +++ b/apriltag/src/main/java/org/wpilib/vision/apriltag/AprilTagFieldLayout.java @@ -245,8 +245,8 @@ public class AprilTagFieldLayout { /** * Deserializes a field layout from a resource within a internal jar file. * - *

Users should use {@link AprilTagFields#loadAprilTagLayoutField()} to load official layouts - * and {@link #AprilTagFieldLayout(String)} for custom layouts. + *

Users should use {@link #loadField(AprilTagFields)} to load official layouts and {@link + * #AprilTagFieldLayout(String)} for custom layouts. * * @param resourcePath The absolute path of the resource * @return The deserialized layout diff --git a/apriltag/src/main/java/org/wpilib/vision/apriltag/AprilTagFields.java b/apriltag/src/main/java/org/wpilib/vision/apriltag/AprilTagFields.java index 7b3641029c..f0c75bc2b2 100644 --- a/apriltag/src/main/java/org/wpilib/vision/apriltag/AprilTagFields.java +++ b/apriltag/src/main/java/org/wpilib/vision/apriltag/AprilTagFields.java @@ -4,8 +4,6 @@ package org.wpilib.vision.apriltag; -import java.io.UncheckedIOException; - /** Loadable AprilTag field layouts. */ public enum AprilTagFields { /** 2022 Rapid React. */ @@ -37,16 +35,4 @@ public enum AprilTagFields { AprilTagFields(String resourceFile) { m_resourceFile = kBaseResourceDir + resourceFile; } - - /** - * Get a {@link AprilTagFieldLayout} from the resource JSON. - * - * @return AprilTagFieldLayout of the field - * @throws UncheckedIOException If the layout does not exist - * @deprecated Use {@link AprilTagFieldLayout#loadField(AprilTagFields)} instead. - */ - @Deprecated(forRemoval = true, since = "2025") - public AprilTagFieldLayout loadAprilTagLayoutField() { - return AprilTagFieldLayout.loadField(this); - } } diff --git a/apriltag/src/main/native/cpp/AprilTagFieldLayout.cpp b/apriltag/src/main/native/cpp/AprilTagFieldLayout.cpp index b7830edcf8..166ab3b883 100644 --- a/apriltag/src/main/native/cpp/AprilTagFieldLayout.cpp +++ b/apriltag/src/main/native/cpp/AprilTagFieldLayout.cpp @@ -177,8 +177,3 @@ AprilTagFieldLayout AprilTagFieldLayout::LoadField(AprilTagField field) { wpi::util::json json = wpi::util::json::parse(fieldString); return json.get(); } - -AprilTagFieldLayout wpi::apriltag::LoadAprilTagLayoutField( - AprilTagField field) { - return AprilTagFieldLayout::LoadField(field); -} diff --git a/apriltag/src/main/native/include/wpi/apriltag/AprilTagFieldLayout.hpp b/apriltag/src/main/native/include/wpi/apriltag/AprilTagFieldLayout.hpp index a761d3782b..4b6548f26c 100644 --- a/apriltag/src/main/native/include/wpi/apriltag/AprilTagFieldLayout.hpp +++ b/apriltag/src/main/native/include/wpi/apriltag/AprilTagFieldLayout.hpp @@ -161,15 +161,4 @@ void to_json(wpi::util::json& json, const AprilTagFieldLayout& layout); WPILIB_DLLEXPORT void from_json(const wpi::util::json& json, AprilTagFieldLayout& layout); -/** - * Loads an AprilTagFieldLayout from a predefined field - * - * @param field The predefined field - * @return AprilTagFieldLayout of the field - * @deprecated Use AprilTagFieldLayout::LoadField() instead - */ -[[deprecated("Use AprilTagFieldLayout::LoadField() instead")]] -WPILIB_DLLEXPORT AprilTagFieldLayout -LoadAprilTagLayoutField(AprilTagField field); - } // namespace wpi::apriltag diff --git a/apriltag/src/main/python/semiwrap/AprilTagFieldLayout.yml b/apriltag/src/main/python/semiwrap/AprilTagFieldLayout.yml index ac032718d9..784392b1f2 100644 --- a/apriltag/src/main/python/semiwrap/AprilTagFieldLayout.yml +++ b/apriltag/src/main/python/semiwrap/AprilTagFieldLayout.yml @@ -3,8 +3,6 @@ functions: ignore: true from_json: ignore: true - LoadAprilTagLayoutField: - ignore: true classes: wpi::apriltag::AprilTagFieldLayout: enums: diff --git a/commandsv2/src/main/java/org/wpilib/command2/Command.java b/commandsv2/src/main/java/org/wpilib/command2/Command.java index 02766fa1ef..05547c3d99 100644 --- a/commandsv2/src/main/java/org/wpilib/command2/Command.java +++ b/commandsv2/src/main/java/org/wpilib/command2/Command.java @@ -307,26 +307,6 @@ public abstract class Command implements Sendable { return new ParallelDeadlineGroup(deadline, this); } - /** - * Decorates this command with a set of commands to run parallel to it, ending when the calling - * command ends and interrupting all the others. Often more convenient/less-verbose than - * constructing a new {@link ParallelDeadlineGroup} explicitly. - * - *

Note: This decorator works by adding this command to a composition. The command the - * decorator was called on cannot be scheduled independently or be added to a different - * composition (namely, decorators), unless it is manually cleared from the list of composed - * commands with {@link CommandScheduler#removeComposedCommand(Command)}. The command composition - * returned from this method can be further decorated without issue. - * - * @param parallel the commands to run in parallel - * @return the decorated command - * @deprecated Use {@link deadlineFor} instead. - */ - @Deprecated(since = "2025", forRemoval = true) - public ParallelDeadlineGroup deadlineWith(Command... parallel) { - return new ParallelDeadlineGroup(this, parallel); - } - /** * Decorates this command with a set of commands to run parallel to it, ending when the calling * command ends and interrupting all the others. Often more convenient/less-verbose than @@ -535,16 +515,6 @@ public abstract class Command implements Sendable { }); } - /** - * Schedules this command. - * - * @deprecated Use CommandScheduler.getInstance().schedule(Command...) instead - */ - @Deprecated(since = "2025", forRemoval = true) - public void schedule() { - CommandScheduler.getInstance().schedule(this); - } - /** * Cancels this command. Will call {@link #end(boolean) end(true)}. Commands will be canceled * regardless of {@link InterruptionBehavior interruption behavior}. diff --git a/commandsv2/src/main/java/org/wpilib/command2/ProxyCommand.java b/commandsv2/src/main/java/org/wpilib/command2/ProxyCommand.java index 8c83f67104..143902aa8d 100644 --- a/commandsv2/src/main/java/org/wpilib/command2/ProxyCommand.java +++ b/commandsv2/src/main/java/org/wpilib/command2/ProxyCommand.java @@ -24,24 +24,6 @@ public class ProxyCommand extends Command { private final Supplier m_supplier; private Command m_command; - /** - * Creates a new ProxyCommand that schedules the supplied command when initialized, and ends when - * it is no longer scheduled. Use this for lazily creating proxied commands at - * runtime. Proxying should only be done to escape from composition requirement semantics, so if - * only initialization time command construction is needed, use {@link DeferredCommand} instead. - * - * @param supplier the command supplier - * @deprecated This constructor's similarity to {@link DeferredCommand} is confusing and opens - * potential footguns for users who do not fully understand the semantics and implications of - * proxying, but who simply want runtime construction. Users who do know what they are doing - * and need a supplier-constructed proxied command should instead defer a proxy command. - * @see DeferredCommand - */ - @Deprecated(since = "2025", forRemoval = true) - public ProxyCommand(Supplier supplier) { - m_supplier = requireNonNullParam(supplier, "supplier", "ProxyCommand"); - } - /** * Creates a new ProxyCommand that schedules the given command when initialized, and ends when it * is no longer scheduled. diff --git a/commandsv2/src/main/native/cpp/frc2/command/Command.cpp b/commandsv2/src/main/native/cpp/frc2/command/Command.cpp index 11fcd2166f..aedd7f8e6d 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/Command.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/Command.cpp @@ -152,10 +152,6 @@ CommandPtr Command::WithName(std::string_view name) && { return std::move(*this).ToPtr().WithName(name); } -void Command::Schedule() { - CommandScheduler::GetInstance().Schedule(this); -} - void Command::Cancel() { CommandScheduler::GetInstance().Cancel(this); } diff --git a/commandsv2/src/main/native/cpp/frc2/command/CommandPtr.cpp b/commandsv2/src/main/native/cpp/frc2/command/CommandPtr.cpp index 0d24e58948..fec92c5270 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/CommandPtr.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/CommandPtr.cpp @@ -176,15 +176,6 @@ CommandPtr CommandPtr::WithDeadline(CommandPtr&& deadline) && { return std::move(*this); } -CommandPtr CommandPtr::DeadlineWith(CommandPtr&& parallel) && { - AssertValid(); - std::vector> vec; - vec.emplace_back(std::move(parallel).Unwrap()); - m_ptr = - std::make_unique(std::move(m_ptr), std::move(vec)); - return std::move(*this); -} - CommandPtr CommandPtr::DeadlineFor(CommandPtr&& parallel) && { AssertValid(); std::vector> vec; @@ -268,11 +259,6 @@ std::unique_ptr CommandPtr::Unwrap() && { return std::move(m_ptr); } -void CommandPtr::Schedule() const& { - AssertValid(); - CommandScheduler::GetInstance().Schedule(*this); -} - void CommandPtr::Cancel() const& { AssertValid(); CommandScheduler::GetInstance().Cancel(*this); diff --git a/commandsv2/src/main/native/cpp/frc2/command/Commands.cpp b/commandsv2/src/main/native/cpp/frc2/command/Commands.cpp index a43da053d8..687f6c2c6a 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/Commands.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/Commands.cpp @@ -21,7 +21,6 @@ #include "wpi/commands2/WaitCommand.hpp" #include "wpi/commands2/WaitUntilCommand.hpp" #include "wpi/util/FunctionExtras.hpp" -#include "wpi/util/deprecated.hpp" using namespace wpi::cmd; diff --git a/commandsv2/src/main/native/cpp/frc2/command/ProxyCommand.cpp b/commandsv2/src/main/native/cpp/frc2/command/ProxyCommand.cpp index eced9d2f48..2a5f3bc0ac 100644 --- a/commandsv2/src/main/native/cpp/frc2/command/ProxyCommand.cpp +++ b/commandsv2/src/main/native/cpp/frc2/command/ProxyCommand.cpp @@ -9,23 +9,10 @@ #include -#include "wpi/util/deprecated.hpp" #include "wpi/util/sendable/SendableBuilder.hpp" using namespace wpi::cmd; -WPI_IGNORE_DEPRECATED -ProxyCommand::ProxyCommand(wpi::util::unique_function supplier) - : m_supplier(std::move(supplier)) {} - -ProxyCommand::ProxyCommand(wpi::util::unique_function supplier) - : ProxyCommand([supplier = std::move(supplier), - holder = std::optional{}]() mutable { - holder = supplier(); - return holder->get(); - }) {} -WPI_UNIGNORE_DEPRECATED - ProxyCommand::ProxyCommand(Command* command) : m_supplier([command] { return command; }) { SetName(fmt::format("Proxy({})", command->GetName())); diff --git a/commandsv2/src/main/native/include/wpi/commands2/Command.hpp b/commandsv2/src/main/native/include/wpi/commands2/Command.hpp index 68e9fe2da6..41adcb07d5 100644 --- a/commandsv2/src/main/native/include/wpi/commands2/Command.hpp +++ b/commandsv2/src/main/native/include/wpi/commands2/Command.hpp @@ -396,14 +396,6 @@ class Command : public wpi::util::Sendable, */ CommandPtr WithName(std::string_view name) &&; - /** - * Schedules this command. - * - * @deprecated Use CommandScheduler::GetInstance().Schedule() instead - */ - [[deprecated("Use CommandScheduler::GetInstance().Schedule() instead.")]] - void Schedule(); - /** * Cancels this command. Will call End(true). Commands will be canceled * regardless of interruption behavior. diff --git a/commandsv2/src/main/native/include/wpi/commands2/CommandPtr.hpp b/commandsv2/src/main/native/include/wpi/commands2/CommandPtr.hpp index 4b0dfb6fc4..405493c80a 100644 --- a/commandsv2/src/main/native/include/wpi/commands2/CommandPtr.hpp +++ b/commandsv2/src/main/native/include/wpi/commands2/CommandPtr.hpp @@ -179,18 +179,6 @@ class [[nodiscard]] CommandPtr final { */ CommandPtr WithDeadline(CommandPtr&& deadline) &&; - /** - * Decorates this command with a set of commands to run parallel to it, ending - * when the calling command ends and interrupting all the others. Often more - * convenient/less-verbose than constructing a new {@link - * ParallelDeadlineGroup} explicitly. - * - * @param parallel the commands to run in parallel - * @return the decorated command - */ - [[deprecated("Replace with DeadlineFor")]] - CommandPtr DeadlineWith(CommandPtr&& parallel) &&; - /** * Decorates this command with a set of commands to run parallel to it, ending * when the calling command ends and interrupting all the others. Often more @@ -274,17 +262,6 @@ class [[nodiscard]] CommandPtr final { */ std::unique_ptr Unwrap() &&; - /** - * Schedules this command. - * - * @deprecated Use CommandScheduler::GetInstance().Schedule() instead - */ - [[deprecated("Use CommandScheduler::GetInstance().Schedule() instead.")]] - void Schedule() const&; - - // Prevent calls on a temporary, as the returned pointer would be invalid - void Schedule() && = delete; - /** * Cancels this command. Will call End(true). Commands will be canceled * regardless of interruption behavior. diff --git a/commandsv2/src/main/native/include/wpi/commands2/Commands.hpp b/commandsv2/src/main/native/include/wpi/commands2/Commands.hpp index 48237985fe..cc9c491132 100644 --- a/commandsv2/src/main/native/include/wpi/commands2/Commands.hpp +++ b/commandsv2/src/main/native/include/wpi/commands2/Commands.hpp @@ -15,7 +15,6 @@ #include "wpi/commands2/CommandPtr.hpp" #include "wpi/commands2/Requirements.hpp" #include "wpi/commands2/SelectCommand.hpp" -#include "wpi/util/deprecated.hpp" namespace wpi::cmd { class Subsystem; diff --git a/commandsv2/src/main/native/include/wpi/commands2/ProxyCommand.hpp b/commandsv2/src/main/native/include/wpi/commands2/ProxyCommand.hpp index e11fb06e56..f96d69b6e1 100644 --- a/commandsv2/src/main/native/include/wpi/commands2/ProxyCommand.hpp +++ b/commandsv2/src/main/native/include/wpi/commands2/ProxyCommand.hpp @@ -9,7 +9,6 @@ #include "wpi/commands2/Command.hpp" #include "wpi/commands2/CommandHelper.hpp" #include "wpi/util/FunctionExtras.hpp" -#include "wpi/util/deprecated.hpp" namespace wpi::cmd { /** @@ -27,46 +26,6 @@ namespace wpi::cmd { */ class ProxyCommand : public CommandHelper { public: - /** - * Creates a new ProxyCommand that schedules the supplied command when - * initialized, and ends when it is no longer scheduled. Use this for lazily - * creating proxied commands at runtime. Proxying should only - * be done to escape from composition requirement semantics, so if only - * initialization time command construction is needed, use {@link - * DeferredCommand} instead. - * - * @param supplier the command supplier - * @deprecated This constructor's similarity to {@link DeferredCommand} is - * confusing and opens potential footguns for users who do not fully - * understand the semantics and implications of proxying, but who simply want - * runtime construction. Users who do know what they are doing and need a - * supplier-constructed proxied command should instead defer a proxy command. - * @see DeferredCommand - */ - WPI_IGNORE_DEPRECATED - [[deprecated("Defer a proxy command instead.")]] - explicit ProxyCommand(wpi::util::unique_function supplier); - - /** - * Creates a new ProxyCommand that schedules the supplied command when - * initialized, and ends when it is no longer scheduled. Use this for lazily - * creating proxied commands at runtime. Proxying should only - * be done to escape from composition requirement semantics, so if only - * initialization time command construction is needed, use {@link - * DeferredCommand} instead. - * - * @param supplier the command supplier - * @deprecated This constructor's similarity to {@link DeferredCommand} is - * confusing and opens potential footguns for users who do not fully - * understand the semantics and implications of proxying, but who simply want - * runtime construction. Users who do know what they are doing and need a - * supplier-constructed proxied command should instead defer a proxy command. - * @see DeferredCommand - */ - [[deprecated("Defer a proxy command instead.")]] - explicit ProxyCommand(wpi::util::unique_function supplier); - WPI_UNIGNORE_DEPRECATED - /** * Creates a new ProxyCommand that schedules the given command when * initialized, and ends when it is no longer scheduled. diff --git a/commandsv2/src/main/python/commands2/__init__.py b/commandsv2/src/main/python/commands2/__init__.py index c29fedf92a..1a0dad21e9 100644 --- a/commandsv2/src/main/python/commands2/__init__.py +++ b/commandsv2/src/main/python/commands2/__init__.py @@ -59,16 +59,3 @@ __all__ = [ "WaitUntilCommand", "WrapperCommand", ] - -if not TYPE_CHECKING: - - def __getattr__(attr): - if attr == "SubsystemBase": - import warnings - - warnings.warn( - "SubsystemBase is deprecated", DeprecationWarning, stacklevel=2 - ) - return Subsystem - - raise AttributeError(f"module {__name__!r} has no attribute {attr!r}") diff --git a/commandsv2/src/main/python/commands2/command.py b/commandsv2/src/main/python/commands2/command.py index 26506a047a..e00ac7b0e2 100644 --- a/commandsv2/src/main/python/commands2/command.py +++ b/commandsv2/src/main/python/commands2/command.py @@ -260,35 +260,6 @@ class Command(Sendable): return SequentialCommandGroup(self, *next) - def deadlineWith(self, *parallel: Command) -> ParallelDeadlineGroup: - """ - Decorates this command with a set of commands to run parallel to it, ending when the calling - command ends and interrupting all the others. Often more convenient/less-verbose than - constructing a new ParallelDeadlineGroup explicitly. - - .. note:: This decorator works by adding this command to a composition. - The command the decorator was called on cannot be scheduled - independently or be added to a different composition (namely, - decorators), unless it is manually cleared from the list of composed - commands with :func:`commands2.CommandScheduler.removeComposedCommand`. - The command composition returned from this method can be further - decorated without issue. - - :param parallel: the commands to run in parallel - :returns: the decorated command - """ - import warnings - - warnings.warn( - "deadlineWith is deprecated use deadlineFor instead", - DeprecationWarning, - stacklevel=2, - ) - - from .paralleldeadlinegroup import ParallelDeadlineGroup - - return ParallelDeadlineGroup(self, *parallel) - def deadlineFor(self, *parallel: Command) -> ParallelDeadlineGroup: """ Decorates this command with a set of commands to run parallel to it, ending when the calling diff --git a/commandsv2/src/main/python/commands2/proxycommand.py b/commandsv2/src/main/python/commands2/proxycommand.py index 564f34b39f..36114fe2fb 100644 --- a/commandsv2/src/main/python/commands2/proxycommand.py +++ b/commandsv2/src/main/python/commands2/proxycommand.py @@ -1,13 +1,9 @@ # validated: 2024-01-19 DS 192a28af4731 ProxyCommand.java from __future__ import annotations -from typing import Callable, overload - from wpiutil import SendableBuilder from .command import Command -from .util import format_args_kwargs -import warnings class ProxyCommand(Command): @@ -21,26 +17,8 @@ class ProxyCommand(Command): If this command is interrupted, it will cancel the command. """ - _supplier: Callable[[], Command] + _command: Command - @overload - def __init__(self, supplier: Callable[[], Command]): - """ - Creates a new ProxyCommand that schedules the supplied command when initialized, and ends when - it is no longer scheduled. Use this for lazily creating **proxied** commands at - runtime. Proxying should only be done to escape from composition requirement semantics, so if - only initialization time command construction is needed, use DeferredCommand instead. - - :param supplier: the command supplier - This constructor's similarity to DeferredCommand is confusing and opens - potential footguns for users who do not fully understand the semantics and implications of - proxying, but who simply want runtime construction. Users who do know what they are doing - and need a supplier-constructed proxied command should instead proxy a DeferredCommand - using the ``asProxy`` decorator. - """ - ... - - @overload def __init__(self, command: Command): """ Creates a new ProxyCommand that schedules the given command when initialized, and ends when it @@ -48,47 +26,12 @@ class ProxyCommand(Command): :param command: the command to run by proxy """ - ... - - def __init__(self, *args, **kwargs): super().__init__() - def init_supplier(supplier: Callable[[], Command]): - assert callable(supplier) - self._supplier = supplier - warnings.warn( - "The ProxyCommand supplier constructor has been deprecated", - DeprecationWarning, - stacklevel=3, - ) - - def init_command(command: Command): - self.setName(f"Proxy({command.getName()})") - self._supplier = lambda: command - - num_args = len(args) + len(kwargs) - - if num_args == 1 and len(kwargs) == 1: - if "supplier" in kwargs: - return init_supplier(kwargs["supplier"]) - elif "command" in kwargs: - return init_command(kwargs["command"]) - elif num_args == 1 and len(args) == 1: - if isinstance(args[0], Command): - return init_command(args[0]) - elif callable(args[0]): - return init_supplier(args[0]) - - raise TypeError(f""" -TypeError: ProxyCommand(): incompatible function arguments. The following argument types are supported: - 1. (self: ProxyCommand, supplier: () -> Command) - 2. (self: ProxyCommand, command: Command) - -Invoked with: {format_args_kwargs(self, *args, **kwargs)} -""") + self.setName(f"Proxy({command.getName()})") + self._command = command def initialize(self): - self._command = self._supplier() self._command.schedule() def end(self, interrupted: bool): diff --git a/commandsv2/src/test/python/test_command_decorators.py b/commandsv2/src/test/python/test_command_decorators.py index 97f9027830..3fe249a072 100644 --- a/commandsv2/src/test/python/test_command_decorators.py +++ b/commandsv2/src/test/python/test_command_decorators.py @@ -78,24 +78,6 @@ def test_andThen(scheduler: commands2.CommandScheduler): assert condition == True -def test_deadlineWith(scheduler: commands2.CommandScheduler): - condition = OOBoolean(False) - condition.set(False) - - dictator = commands2.WaitUntilCommand(condition) - endsBefore = commands2.InstantCommand() - endsAfter = commands2.WaitUntilCommand(lambda: False) - - group = dictator.deadlineWith(endsBefore, endsAfter) - - scheduler.schedule(group) - scheduler.run() - assert group.isScheduled() - condition.set(True) - scheduler.run() - assert not group.isScheduled() - - def test_deadlineFor(scheduler: commands2.CommandScheduler): condition = OOBoolean(False) condition.set(False) diff --git a/ntcore/src/main/native/cpp/jni/NetworkTablesJNI.cpp b/ntcore/src/main/native/cpp/jni/NetworkTablesJNI.cpp index 6996cd1769..4819adcb8a 100644 --- a/ntcore/src/main/native/cpp/jni/NetworkTablesJNI.cpp +++ b/ntcore/src/main/native/cpp/jni/NetworkTablesJNI.cpp @@ -20,10 +20,6 @@ using namespace wpi::util::java; -#ifdef __GNUC__ -#pragma GCC diagnostic ignored "-Wdeprecated-declarations" -#endif - namespace wpi::nt { bool JNI_LoadTypes(JNIEnv* env); void JNI_UnloadTypes(JNIEnv* env); diff --git a/wpilibc/src/generate/main/native/cpp/driverstation/hid.cpp.jinja b/wpilibc/src/generate/main/native/cpp/driverstation/hid.cpp.jinja index 3c9faaba1c..abb39462e5 100644 --- a/wpilibc/src/generate/main/native/cpp/driverstation/hid.cpp.jinja +++ b/wpilibc/src/generate/main/native/cpp/driverstation/hid.cpp.jinja @@ -53,45 +53,7 @@ bool {{ ConsoleName }}Controller::Get{{ capitalize_first(button.name) }}ButtonRe BooleanEvent {{ ConsoleName }}Controller::{{ capitalize_first(button.name) }}(EventLoop* loop) const { return BooleanEvent(loop, [this]() { return this->Get{{ capitalize_first(button.name) }}Button(); }); } -{% endfor -%} -{% if ConsoleName == "Xbox" or ConsoleName == "Stadia"%} -bool {{ ConsoleName }}Controller::GetLeftBumper() const { - return GetRawButton(Button::kLeftBumper); -} - -bool {{ ConsoleName }}Controller::GetRightBumper() const { - return GetRawButton(Button::kRightBumper); -} - -bool {{ ConsoleName }}Controller::GetLeftBumperPressed() { - return GetRawButtonPressed(Button::kLeftBumper); -} - -bool {{ ConsoleName }}Controller::GetRightBumperPressed() { - return GetRawButtonPressed(Button::kRightBumper); -} - -bool {{ ConsoleName }}Controller::GetLeftBumperReleased() { - return GetRawButtonReleased(Button::kLeftBumper); -} - -bool {{ ConsoleName }}Controller::GetRightBumperReleased() { - return GetRawButtonReleased(Button::kRightBumper); -} -{%- elif ConsoleName == "PS4" or ConsoleName == "PS5" %} -bool {{ ConsoleName }}Controller::GetTouchpad() const { - return GetRawButton(Button::kTouchpad); -} - -bool {{ ConsoleName }}Controller::GetTouchpadPressed() { - return GetRawButtonPressed(Button::kTouchpad); -} - -bool {{ ConsoleName }}Controller::GetTouchpadReleased() { - return GetRawButtonReleased(Button::kTouchpad); -} -{%- endif %} - +{% endfor %} void {{ ConsoleName }}Controller::InitSendable(wpi::util::SendableBuilder& builder) { builder.SetSmartDashboardType("HID"); builder.PublishConstString("ControllerType", "{{ ConsoleName }}"); diff --git a/wpilibc/src/generate/main/native/include/wpi/driverstation/hid.hpp.jinja b/wpilibc/src/generate/main/native/include/wpi/driverstation/hid.hpp.jinja index 9e29eeb760..5c8db19103 100644 --- a/wpilibc/src/generate/main/native/include/wpi/driverstation/hid.hpp.jinja +++ b/wpilibc/src/generate/main/native/include/wpi/driverstation/hid.hpp.jinja @@ -116,106 +116,7 @@ class {{ ConsoleName }}Controller : public GenericHID, * digital signal attached to the given loop. */ BooleanEvent {{ capitalize_first(button.name) }}(EventLoop* loop) const; -{% endfor -%} -{% if ConsoleName == "Xbox" or ConsoleName == "Stadia" %} - /** - * Read the value of the left bumper (LB) button on the controller. - * - * @return the state of the button - * @deprecated Use GetLeftBumperButton instead. This function is deprecated - * for removal to make function names consistent to allow the HID classes to - * be automatically generated. - */ - [[deprecated("Use GetLeftBumperButton instead")]] - bool GetLeftBumper() const; - - /** - * Read the value of the right bumper (RB) button on the controller. - * - * @return the state of the button - * @deprecated Use GetRightBumperButton instead. This function is deprecated - * for removal to make function names consistent to allow the HID classes to - * be automatically generated. - */ - [[deprecated("Use GetRightBumperButton instead")]] - bool GetRightBumper() const; - - /** - * Whether the left bumper (LB) was pressed since the last check. - * - * @return Whether the button was pressed since the last check - * @deprecated Use GetLeftBumperButtonPressed instead. This function is - * deprecated for removal to make function names consistent to allow the HID - * classes to be automatically generated. - */ - [[deprecated("Use GetLeftBumperButtonPressed instead")]] - bool GetLeftBumperPressed(); - - /** - * Whether the right bumper (RB) was pressed since the last check. - * - * @return Whether the button was pressed since the last check - * @deprecated Use GetRightBumperButtonPressed instead. This function is - * deprecated for removal to make function names consistent to allow the HID - * classes to be automatically generated. - */ - [[deprecated("Use GetRightBumperButtonPressed instead")]] - bool GetRightBumperPressed(); - - /** - * Whether the left bumper (LB) was released since the last check. - * - * @return Whether the button was released since the last check. - * @deprecated Use GetLeftBumperButtonReleased instead. This function is - * deprecated for removal to make function names consistent to allow the HID - * classes to be automatically generated. - */ - [[deprecated("Use GetLeftBumperButtonReleased instead")]] - bool GetLeftBumperReleased(); - - /** - * Whether the right bumper (RB) was released since the last check. - * - * @return Whether the button was released since the last check. - * @deprecated Use GetRightBumperButtonReleased instead. This function is - * deprecated for removal to make function names consistent to allow the HID - * classes to be automatically generated. - */ - [[deprecated("Use GetRightBumperButtonReleased instead")]] - bool GetRightBumperReleased(); -{% elif ConsoleName == "PS4" or ConsoleName == "PS5" %} - /** - * Read the value of the touchpad button on the controller. - * - * @return The state of the button. - * @deprecated Use GetTouchpadButton instead. This function is deprecated for - * removal to make function names consistent to allow the HID classes to be - * automatically generated. - */ - [[deprecated("Use GetTouchpadButton instead")]] - bool GetTouchpad() const; - /** - * Whether the touchpad was pressed since the last check. - * - * @return Whether the touchpad was pressed since the last check. - * @deprecated Use GetTouchpadButtonPressed instead. This function is - * deprecated for removal to make function names consistent to allow the HID - * classes to be automatically generated. - */ - [[deprecated("Use GetTouchpadButtonPressed instead")]] - bool GetTouchpadPressed(); - - /** - * Whether the touchpad was released since the last check. - * - * @return Whether the touchpad was released since the last check. - * @deprecated Use GetLeftBumperButton instead. This function is deprecated - * for removal to make function names consistent to allow the HID classes to - * be automatically generated. - */ - [[deprecated("Use GetTouchpadButtonReleased instead")]] - bool GetTouchpadReleased(); -{% endif %} +{% endfor %} /** Represents a digital button on an {{ ConsoleName }}Controller. */ struct Button { {%- for button in buttons %} diff --git a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS4Controller.cpp b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS4Controller.cpp index cbdf8d93af..883fde7b58 100644 --- a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS4Controller.cpp +++ b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS4Controller.cpp @@ -265,7 +265,6 @@ BooleanEvent NiDsPS4Controller::Touchpad(EventLoop* loop) const { return BooleanEvent(loop, [this]() { return this->GetTouchpadButton(); }); } - void NiDsPS4Controller::InitSendable(wpi::util::SendableBuilder& builder) { builder.SetSmartDashboardType("HID"); builder.PublishConstString("ControllerType", "NiDsPS4"); diff --git a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS5Controller.cpp b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS5Controller.cpp index b97dfc45ee..adbdbd0bc1 100644 --- a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS5Controller.cpp +++ b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsPS5Controller.cpp @@ -265,7 +265,6 @@ BooleanEvent NiDsPS5Controller::Touchpad(EventLoop* loop) const { return BooleanEvent(loop, [this]() { return this->GetTouchpadButton(); }); } - void NiDsPS5Controller::InitSendable(wpi::util::SendableBuilder& builder) { builder.SetSmartDashboardType("HID"); builder.PublishConstString("ControllerType", "NiDsPS5"); diff --git a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsStadiaController.cpp b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsStadiaController.cpp index c288eba932..29f5944ece 100644 --- a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsStadiaController.cpp +++ b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsStadiaController.cpp @@ -273,7 +273,6 @@ BooleanEvent NiDsStadiaController::Frame(EventLoop* loop) const { return BooleanEvent(loop, [this]() { return this->GetFrameButton(); }); } - void NiDsStadiaController::InitSendable(wpi::util::SendableBuilder& builder) { builder.SetSmartDashboardType("HID"); builder.PublishConstString("ControllerType", "NiDsStadia"); diff --git a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsXboxController.cpp b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsXboxController.cpp index 3522824132..0cddb960fe 100644 --- a/wpilibc/src/generated/main/native/cpp/driverstation/NiDsXboxController.cpp +++ b/wpilibc/src/generated/main/native/cpp/driverstation/NiDsXboxController.cpp @@ -217,7 +217,6 @@ BooleanEvent NiDsXboxController::RightStick(EventLoop* loop) const { return BooleanEvent(loop, [this]() { return this->GetRightStickButton(); }); } - void NiDsXboxController::InitSendable(wpi::util::SendableBuilder& builder) { builder.SetSmartDashboardType("HID"); builder.PublishConstString("ControllerType", "NiDsXbox"); diff --git a/wpilibc/src/main/native/cpp/framework/IterativeRobotBase.cpp b/wpilibc/src/main/native/cpp/framework/IterativeRobotBase.cpp index 36a9ace393..8dab4600b9 100644 --- a/wpilibc/src/main/native/cpp/framework/IterativeRobotBase.cpp +++ b/wpilibc/src/main/native/cpp/framework/IterativeRobotBase.cpp @@ -86,10 +86,6 @@ void IterativeRobotBase::TeleopExit() {} void IterativeRobotBase::TestExit() {} -void IterativeRobotBase::SetNetworkTablesFlushEnabled(bool enabled) { - m_ntFlushEnabled = enabled; -} - wpi::units::second_t IterativeRobotBase::GetPeriod() const { return m_period; } @@ -171,9 +167,7 @@ void IterativeRobotBase::LoopFunc() { m_watchdog.Disable(); // Flush NetworkTables - if (m_ntFlushEnabled) { - wpi::nt::NetworkTableInstance::GetDefault().FlushLocal(); - } + wpi::nt::NetworkTableInstance::GetDefault().FlushLocal(); // Warn on loop time overruns if (m_watchdog.IsExpired()) { diff --git a/wpilibc/src/main/native/cpp/system/Resource.cpp b/wpilibc/src/main/native/cpp/system/Resource.cpp deleted file mode 100644 index 005dd6969b..0000000000 --- a/wpilibc/src/main/native/cpp/system/Resource.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#include "wpi/system/Resource.hpp" - -#include -#include -#include -#include - -#include "wpi/system/Errors.hpp" -#include "wpi/util/deprecated.hpp" - -WPI_IGNORE_DEPRECATED -using namespace wpi; - -wpi::util::mutex Resource::m_createMutex; - -void Resource::CreateResourceObject(std::unique_ptr& r, - uint32_t elements) { - std::scoped_lock lock(m_createMutex); - if (!r) { - r = std::make_unique(elements); - } -} -WPI_UNIGNORE_DEPRECATED - -Resource::Resource(uint32_t elements) { - m_isAllocated = std::vector(elements, false); -} - -uint32_t Resource::Allocate(const std::string& resourceDesc) { - std::scoped_lock lock(m_allocateMutex); - for (uint32_t i = 0; i < m_isAllocated.size(); i++) { - if (!m_isAllocated[i]) { - m_isAllocated[i] = true; - return i; - } - } - throw WPILIB_MakeError(err::NoAvailableResources, "{}", resourceDesc); -} - -uint32_t Resource::Allocate(uint32_t index, const std::string& resourceDesc) { - std::scoped_lock lock(m_allocateMutex); - if (index >= m_isAllocated.size()) { - throw WPILIB_MakeError(err::ChannelIndexOutOfRange, "{}", resourceDesc); - } - if (m_isAllocated[index]) { - throw WPILIB_MakeError(err::ResourceAlreadyAllocated, "{}", resourceDesc); - } - m_isAllocated[index] = true; - return index; -} - -void Resource::Free(uint32_t index) { - std::unique_lock lock(m_allocateMutex); - if (index == std::numeric_limits::max()) { - return; - } - if (index >= m_isAllocated.size()) { - throw WPILIB_MakeError(err::NotAllocated, "index {}", index); - } - if (!m_isAllocated[index]) { - throw WPILIB_MakeError(err::NotAllocated, "index {}", index); - } - m_isAllocated[index] = false; -} diff --git a/wpilibc/src/main/native/include/wpi/framework/IterativeRobotBase.hpp b/wpilibc/src/main/native/include/wpi/framework/IterativeRobotBase.hpp index 408885d7ec..09fe232ac2 100644 --- a/wpilibc/src/main/native/include/wpi/framework/IterativeRobotBase.hpp +++ b/wpilibc/src/main/native/include/wpi/framework/IterativeRobotBase.hpp @@ -187,16 +187,6 @@ class IterativeRobotBase : public RobotBase { */ virtual void TestExit(); - /** - * Enables or disables flushing NetworkTables every loop iteration. - * By default, this is enabled. - * - * @param enabled True to enable, false to disable - * @deprecated Deprecated without replacement. - */ - [[deprecated("Deprecated without replacement.")]] - void SetNetworkTablesFlushEnabled(bool enabled); - /** * Gets time period between calls to Periodic() functions. */ @@ -229,7 +219,6 @@ class IterativeRobotBase : public RobotBase { int m_lastMode = -1; wpi::units::second_t m_period; Watchdog m_watchdog; - bool m_ntFlushEnabled = true; bool m_calledDsConnected = false; void PrintLoopOverrunMessage(); diff --git a/wpilibc/src/main/native/include/wpi/system/Resource.hpp b/wpilibc/src/main/native/include/wpi/system/Resource.hpp deleted file mode 100644 index 8a356bbf13..0000000000 --- a/wpilibc/src/main/native/include/wpi/system/Resource.hpp +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -#pragma once - -#include - -#include -#include -#include - -#include "wpi/util/mutex.hpp" - -namespace wpi { - -/** - * The Resource class is a convenient way to track allocated resources. - * - * It tracks them as indices in the range [0 .. elements - 1]. E.g. the library - * uses this to track hardware channel allocation. - * - * The Resource class does not allocate the hardware channels or other - * resources; it just tracks which indices were marked in use by Allocate and - * not yet freed by Free. - * @deprecated Use the HandleResource classes instead - */ -class [[deprecated("Use the HandleResource classes instead")]] Resource { - public: - virtual ~Resource() = default; - - /** - * Factory method to create a Resource allocation-tracker *if* needed. - * - * @param r address of the caller's Resource pointer. If *r == nullptr, - * this will construct a Resource and make *r point to it. If - * *r != nullptr, i.e. the caller already has a Resource - * instance, this won't do anything. - * @param elements the number of elements for this Resource allocator to - * track, that is, it will allocate resource numbers in the - * range [0 .. elements - 1]. - */ - static void CreateResourceObject(std::unique_ptr& r, - uint32_t elements); - - /** - * Allocate storage for a new instance of Resource. - * - * Allocate a bool array of values that will get initialized to indicate that - * no resources have been allocated yet. The indices of the resources are - * [0 .. elements - 1]. - */ - explicit Resource(uint32_t size); - - /** - * Allocate a resource. - * - * When a resource is requested, mark it allocated. In this case, a free - * resource value within the range is located and returned after it is marked - * allocated. - */ - uint32_t Allocate(const std::string& resourceDesc); - - /** - * Allocate a specific resource value. - * - * The user requests a specific resource value, i.e. channel number and it is - * verified unallocated, then returned. - */ - uint32_t Allocate(uint32_t index, const std::string& resourceDesc); - - /** - * Free an allocated resource. - * - * After a resource is no longer needed, for example a destructor is called - * for a channel assignment class, Free will release the resource value so it - * can be reused somewhere else in the program. - */ - void Free(uint32_t index); - - private: - std::vector m_isAllocated; - wpi::util::mutex m_allocateMutex; - - static wpi::util::mutex m_createMutex; -}; - -} // namespace wpi diff --git a/wpilibc/src/main/python/semiwrap/IterativeRobotBase.yml b/wpilibc/src/main/python/semiwrap/IterativeRobotBase.yml index 9f27f1c21c..b0803dd501 100644 --- a/wpilibc/src/main/python/semiwrap/IterativeRobotBase.yml +++ b/wpilibc/src/main/python/semiwrap/IterativeRobotBase.yml @@ -23,7 +23,6 @@ classes: AutonomousExit: TeleopExit: TestExit: - SetNetworkTablesFlushEnabled: GetPeriod: PrintWatchdogEpochs: doc: | diff --git a/wpilibj/src/generate/main/java/hid.java.jinja b/wpilibj/src/generate/main/java/hid.java.jinja index 23c5ff7a8c..d5edd7470f 100644 --- a/wpilibj/src/generate/main/java/hid.java.jinja +++ b/wpilibj/src/generate/main/java/hid.java.jinja @@ -186,123 +186,7 @@ public class {{ ConsoleName }}Controller extends GenericHID implements Sendable public BooleanEvent {{ button.name }}(EventLoop loop) { return button(Button.k{{ capitalize_first(button.name) }}.value, loop); } -{% endfor -%} -{% if ConsoleName == "Xbox" or ConsoleName == "Stadia" %} - /** - * Read the value of the left bumper (LB) button on the controller. - * - * @return The state of the button. - * @deprecated Use {@link getLeftBumperButton} instead. This function is deprecated for removal - * to make function names consistent to allow the HID classes to be automatically generated. - */ - @Deprecated(since = "2025", forRemoval = true) - public boolean getLeftBumper() { - return getRawButton(Button.kLeftBumper.value); - } - - /** - * Read the value of the right bumper (RB) button on the controller. - * - * @return The state of the button. - * @deprecated Use {@link getRightBumperButton} instead. This function is deprecated for removal - * to make function names consistent to allow the HID classes to be automatically generated. - */ - @Deprecated(since = "2025", forRemoval = true) - public boolean getRightBumper() { - return getRawButton(Button.kRightBumper.value); - } - - /** - * Whether the left bumper (LB) was pressed since the last check. - * - * @return Whether the button was pressed since the last check. - * @deprecated Use {@link getLeftBumperButtonPressed} instead. This function is deprecated for - * removal to make function names consistent to allow the HID classes to be automatically - * generated. - */ - @Deprecated(since = "2025", forRemoval = true) - public boolean getLeftBumperPressed() { - return getRawButtonPressed(Button.kLeftBumper.value); - } - - /** - * Whether the right bumper (RB) was pressed since the last check. - * - * @return Whether the button was pressed since the last check. - * @deprecated Use {@link getRightBumperButtonPressed} instead. This function is deprecated for - * removal to make function names consistent to allow the HID classes to be automatically - * generated. - */ - @Deprecated(since = "2025", forRemoval = true) - public boolean getRightBumperPressed() { - return getRawButtonPressed(Button.kRightBumper.value); - } - - /** - * Whether the left bumper (LB) was released since the last check. - * - * @return Whether the button was released since the last check. - * @deprecated Use {@link getLeftBumperButtonReleased} instead. This function is deprecated for - * removal to make function names consistent to allow the HID classes to be automatically - * generated. - */ - @Deprecated(since = "2025", forRemoval = true) - public boolean getLeftBumperReleased() { - return getRawButtonReleased(Button.kLeftBumper.value); - } - - /** - * Whether the right bumper (RB) was released since the last check. - * - * @return Whether the button was released since the last check. - * @deprecated Use {@link getRightBumperButtonReleased} instead. This function is deprecated for - * removal to make function names consistent to allow the HID classes to be automatically - * generated. - */ - @Deprecated(since = "2025", forRemoval = true) - public boolean getRightBumperReleased() { - return getRawButtonReleased(Button.kRightBumper.value); - } -{%- elif ConsoleName == "PS4" or ConsoleName == "PS5" %} - /** - * Read the value of the touchpad on the controller. - * - * @return The state of the touchpad. - * @deprecated Use {@link getTouchpadButton} instead. This function is deprecated for removal to - * make function names consistent to allow the HID classes to be automatically generated. - */ - @Deprecated(since = "2025", forRemoval = true) - public boolean getTouchpad() { - return getRawButton(Button.kTouchpad.value); - } - - /** - * Whether the touchpad was pressed since the last check. - * - * @return Whether the touchpad was pressed since the last check. - * @deprecated Use {@link getTouchpadButtonPressed} instead. This function is deprecated for - * removal to make function names consistent to allow the HID classes to be automatically - * generated. - */ - @Deprecated(since = "2025", forRemoval = true) - public boolean getTouchpadPressed() { - return getRawButtonPressed(Button.kTouchpad.value); - } - - /** - * Whether the touchpad was released since the last check. - * - * @return Whether the touchpad was released since the last check. - * @deprecated Use {@link getTouchpadButtonReleased} instead. This function is deprecated for - * removal to make function names consistent to allow the HID classes to be automatically - * generated. - */ - @Deprecated(since = "2025", forRemoval = true) - public boolean getTouchpadReleased() { - return getRawButtonReleased(Button.kTouchpad.value); - } -{%- endif %} - +{% endfor %} @Override public void initSendable(SendableBuilder builder) { builder.setSmartDashboardType("HID"); diff --git a/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsPS4Controller.java b/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsPS4Controller.java index 501f09b7cf..4c61c8d53d 100644 --- a/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsPS4Controller.java +++ b/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsPS4Controller.java @@ -715,7 +715,6 @@ public class NiDsPS4Controller extends GenericHID implements Sendable { return button(Button.kTouchpad.value, loop); } - @Override public void initSendable(SendableBuilder builder) { builder.setSmartDashboardType("HID"); diff --git a/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsPS5Controller.java b/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsPS5Controller.java index de358a2e34..4cff27b705 100644 --- a/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsPS5Controller.java +++ b/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsPS5Controller.java @@ -715,7 +715,6 @@ public class NiDsPS5Controller extends GenericHID implements Sendable { return button(Button.kTouchpad.value, loop); } - @Override public void initSendable(SendableBuilder builder) { builder.setSmartDashboardType("HID"); diff --git a/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsStadiaController.java b/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsStadiaController.java index bc9df892d0..13a118004b 100644 --- a/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsStadiaController.java +++ b/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsStadiaController.java @@ -731,7 +731,6 @@ public class NiDsStadiaController extends GenericHID implements Sendable { return button(Button.kFrame.value, loop); } - @Override public void initSendable(SendableBuilder builder) { builder.setSmartDashboardType("HID"); diff --git a/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsXboxController.java b/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsXboxController.java index 5ec5a782da..45aa9c59cf 100644 --- a/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsXboxController.java +++ b/wpilibj/src/generated/main/java/org/wpilib/driverstation/NiDsXboxController.java @@ -607,7 +607,6 @@ public class NiDsXboxController extends GenericHID implements Sendable { return button(Button.kRightStick.value, loop); } - @Override public void initSendable(SendableBuilder builder) { builder.setSmartDashboardType("HID"); diff --git a/wpilibj/src/main/java/org/wpilib/framework/IterativeRobotBase.java b/wpilibj/src/main/java/org/wpilib/framework/IterativeRobotBase.java index 89439b7280..a44d876942 100644 --- a/wpilibj/src/main/java/org/wpilib/framework/IterativeRobotBase.java +++ b/wpilibj/src/main/java/org/wpilib/framework/IterativeRobotBase.java @@ -60,7 +60,6 @@ public abstract class IterativeRobotBase extends RobotBase { private RobotMode m_lastMode; private final double m_period; private final Watchdog m_watchdog; - private boolean m_ntFlushEnabled = true; private boolean m_calledDsConnected; /** @@ -226,17 +225,6 @@ public abstract class IterativeRobotBase extends RobotBase { */ public void testExit() {} - /** - * Enables or disables flushing NetworkTables every loop iteration. By default, this is enabled. - * - * @param enabled True to enable, false to disable - * @deprecated Deprecated without replacement. - */ - @Deprecated(forRemoval = true, since = "2025") - public void setNetworkTablesFlushEnabled(boolean enabled) { - m_ntFlushEnabled = enabled; - } - /** * Gets time period between calls to Periodic() functions. * @@ -342,9 +330,7 @@ public abstract class IterativeRobotBase extends RobotBase { m_watchdog.disable(); // Flush NetworkTables - if (m_ntFlushEnabled) { - NetworkTableInstance.getDefault().flushLocal(); - } + NetworkTableInstance.getDefault().flushLocal(); // Warn on loop time overruns if (m_watchdog.isExpired()) { diff --git a/wpilibj/src/main/java/org/wpilib/system/Resource.java b/wpilibj/src/main/java/org/wpilib/system/Resource.java deleted file mode 100644 index 10d8c6d6b4..0000000000 --- a/wpilibj/src/main/java/org/wpilib/system/Resource.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) FIRST and other WPILib contributors. -// Open Source Software; you can modify and/or share it under the terms of -// the WPILib BSD license file in the root directory of this project. - -package org.wpilib.system; - -import org.wpilib.hardware.hal.util.AllocationException; -import org.wpilib.hardware.hal.util.CheckedAllocationException; - -/** - * Track resources in the program. The Resource class is a convenient way of keeping track of - * allocated arbitrary resources in the program. Resources are just indices that have a lower and - * upper bound that are tracked by this class. In the library they are used for tracking allocation - * of hardware channels but this is purely arbitrary. The resource class does not do any actual - * allocation, but simply tracks if a given index is currently in use. - * - *

WARNING: this should only be statically allocated. When the program loads into memory - * all the static constructors are called. At that time a linked list of all the "Resources" is - * created. Then, when the program actually starts - in the Robot constructor, all resources are - * initialized. This ensures that the program is restartable in memory without having to - * unload/reload. - * - * @deprecated Will be removed with no replacement. - */ -@Deprecated(forRemoval = true, since = "2025") -public final class Resource { - private static Resource resourceList; - private final boolean[] m_numAllocated; - private final int m_size; - private final Resource m_nextResource; - - /** Clears all allocated resources. */ - public static void restartProgram() { - for (Resource r = Resource.resourceList; r != null; r = r.m_nextResource) { - for (int i = 0; i < r.m_size; i++) { - r.m_numAllocated[i] = false; - } - } - } - - /** - * Allocate storage for a new instance of Resource. Allocate a bool array of values that will get - * initialized to indicate that no resources have been allocated yet. The indices of the resources - * are 0..size-1. - * - * @param size The number of blocks to allocate - */ - public Resource(final int size) { - m_size = size; - m_numAllocated = new boolean[size]; - for (int i = 0; i < size; i++) { - m_numAllocated[i] = false; - } - m_nextResource = Resource.resourceList; - Resource.resourceList = this; - } - - /** - * Allocate a resource. When a resource is requested, mark it allocated. In this case, a free - * resource value within the range is located and returned after it is marked allocated. - * - * @return The index of the allocated block. - * @throws CheckedAllocationException If there are no resources available to be allocated. - */ - public int allocate() throws CheckedAllocationException { - for (int i = 0; i < m_size; i++) { - if (!m_numAllocated[i]) { - m_numAllocated[i] = true; - return i; - } - } - throw new CheckedAllocationException("No available resources"); - } - - /** - * Allocate a specific resource value. The user requests a specific resource value, i.e. channel - * number, and it is verified unallocated, then returned. - * - * @param index The resource to allocate - * @return The index of the allocated block - * @throws CheckedAllocationException If there are no resources available to be allocated. - */ - public int allocate(final int index) throws CheckedAllocationException { - if (index >= m_size || index < 0) { - throw new CheckedAllocationException("Index " + index + " out of range"); - } - if (m_numAllocated[index]) { - throw new CheckedAllocationException("Resource at index " + index + " already allocated"); - } - m_numAllocated[index] = true; - return index; - } - - /** - * Free an allocated resource. After a resource is no longer needed, for example a destructor is - * called for a channel assignment class, this method will release the resource value, so it can - * be reused somewhere else in the program. - * - * @param index The index of the resource to free. - */ - public void free(final int index) { - if (!m_numAllocated[index]) { - throw new AllocationException("No resource available to be freed"); - } - m_numAllocated[index] = false; - } -} diff --git a/wpimath/src/main/java/org/wpilib/math/controller/PIDController.java b/wpimath/src/main/java/org/wpilib/math/controller/PIDController.java index 27d0ed16bb..25ebe7151f 100644 --- a/wpimath/src/main/java/org/wpilib/math/controller/PIDController.java +++ b/wpimath/src/main/java/org/wpilib/math/controller/PIDController.java @@ -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. * diff --git a/wpimath/src/main/java/org/wpilib/math/trajectory/constraint/EllipticalRegionConstraint.java b/wpimath/src/main/java/org/wpilib/math/trajectory/constraint/EllipticalRegionConstraint.java index 78a309ed0a..919ffd4898 100644 --- a/wpimath/src/main/java/org/wpilib/math/trajectory/constraint/EllipticalRegionConstraint.java +++ b/wpimath/src/main/java/org/wpilib/math/trajectory/constraint/EllipticalRegionConstraint.java @@ -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. * diff --git a/wpimath/src/main/java/org/wpilib/math/trajectory/constraint/RectangularRegionConstraint.java b/wpimath/src/main/java/org/wpilib/math/trajectory/constraint/RectangularRegionConstraint.java index c1579bddb3..7c4da2b9e5 100644 --- a/wpimath/src/main/java/org/wpilib/math/trajectory/constraint/RectangularRegionConstraint.java +++ b/wpimath/src/main/java/org/wpilib/math/trajectory/constraint/RectangularRegionConstraint.java @@ -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. * diff --git a/wpimath/src/main/native/include/wpi/math/controller/ArmFeedforward.hpp b/wpimath/src/main/native/include/wpi/math/controller/ArmFeedforward.hpp index d2af2e7bb3..ac4c52912f 100644 --- a/wpimath/src/main/native/include/wpi/math/controller/ArmFeedforward.hpp +++ b/wpimath/src/main/native/include/wpi/math/controller/ArmFeedforward.hpp @@ -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, wpi::units::unit_t velocity, - wpi::units::unit_t 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 currentAngle, - wpi::units::unit_t currentVelocity, - wpi::units::unit_t 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. diff --git a/wpimath/src/main/native/include/wpi/math/controller/PIDController.hpp b/wpimath/src/main/native/include/wpi/math/controller/PIDController.hpp index 00fde9a70a..5d891dc442 100644 --- a/wpimath/src/main/native/include/wpi/math/controller/PIDController.hpp +++ b/wpimath/src/main/native/include/wpi/math/controller/PIDController.hpp @@ -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. * diff --git a/wpimath/src/main/native/include/wpi/math/trajectory/constraint/EllipticalRegionConstraint.hpp b/wpimath/src/main/native/include/wpi/math/trajectory/constraint/EllipticalRegionConstraint.hpp index d0c8e7a41e..aa2f4914b0 100644 --- a/wpimath/src/main/native/include/wpi/math/trajectory/constraint/EllipticalRegionConstraint.hpp +++ b/wpimath/src/main/native/include/wpi/math/trajectory/constraint/EllipticalRegionConstraint.hpp @@ -21,26 +21,6 @@ namespace wpi::math { template 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. * diff --git a/wpimath/src/main/native/include/wpi/math/trajectory/constraint/RectangularRegionConstraint.hpp b/wpimath/src/main/native/include/wpi/math/trajectory/constraint/RectangularRegionConstraint.hpp index 6a0d29ece1..f0df284ef1 100644 --- a/wpimath/src/main/native/include/wpi/math/trajectory/constraint/RectangularRegionConstraint.hpp +++ b/wpimath/src/main/native/include/wpi/math/trajectory/constraint/RectangularRegionConstraint.hpp @@ -19,23 +19,6 @@ namespace wpi::math { template 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. * diff --git a/wpimath/src/main/python/semiwrap/ArmFeedforward.yml b/wpimath/src/main/python/semiwrap/ArmFeedforward.yml index 10c5976273..218a589cc2 100644 --- a/wpimath/src/main/python/semiwrap/ArmFeedforward.yml +++ b/wpimath/src/main/python/semiwrap/ArmFeedforward.yml @@ -13,10 +13,6 @@ classes: wpi::units::volt_t, wpi::units::volt_t, wpi::units::unit_t, wpi::units::unit_t: Calculate: overloads: - wpi::units::unit_t, wpi::units::unit_t, wpi::units::unit_t [const]: - ignore: true - wpi::units::unit_t, wpi::units::unit_t, wpi::units::unit_t, wpi::units::second_t [const]: - ignore: true wpi::units::unit_t, wpi::units::unit_t [const]: wpi::units::unit_t, wpi::units::unit_t, wpi::units::unit_t [const]: MaxAchievableVelocity: diff --git a/wpimath/src/main/python/semiwrap/EllipticalRegionConstraint.yml b/wpimath/src/main/python/semiwrap/EllipticalRegionConstraint.yml index 0318e2372a..5049e6d1c4 100644 --- a/wpimath/src/main/python/semiwrap/EllipticalRegionConstraint.yml +++ b/wpimath/src/main/python/semiwrap/EllipticalRegionConstraint.yml @@ -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>(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 diff --git a/wpimath/src/main/python/semiwrap/PIDController.yml b/wpimath/src/main/python/semiwrap/PIDController.yml index cb1f7e1cb5..8f69f660fd 100644 --- a/wpimath/src/main/python/semiwrap/PIDController.yml +++ b/wpimath/src/main/python/semiwrap/PIDController.yml @@ -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: diff --git a/wpimath/src/main/python/semiwrap/RectangularRegionConstraint.yml b/wpimath/src/main/python/semiwrap/RectangularRegionConstraint.yml index b33b453aa6..ca562a82fc 100644 --- a/wpimath/src/main/python/semiwrap/RectangularRegionConstraint.yml +++ b/wpimath/src/main/python/semiwrap/RectangularRegionConstraint.yml @@ -10,7 +10,6 @@ classes: methods: RectangularRegionConstraint: overloads: - const Translation2d&, const Translation2d&, const Constraint&: const Rectangle2d&, const Constraint&: MaxVelocity: MinMaxAcceleration: diff --git a/xrpVendordep/src/main/native/cpp/xrp/XRPServo.cpp b/xrpVendordep/src/main/native/cpp/xrp/XRPServo.cpp index 0e4dd39233..e9b38f7938 100644 --- a/xrpVendordep/src/main/native/cpp/xrp/XRPServo.cpp +++ b/xrpVendordep/src/main/native/cpp/xrp/XRPServo.cpp @@ -62,25 +62,3 @@ wpi::units::radian_t XRPServo::GetAngle() const { return 90_deg; } - -void XRPServo::SetPosition(double pos) { - if (pos < 0.0) { - pos = 0.0; - } - - if (pos > 1.0) { - pos = 1.0; - } - - if (m_simPosition) { - m_simPosition.Set(pos); - } -} - -double XRPServo::GetPosition() const { - if (m_simPosition) { - return m_simPosition.Get(); - } - - return 0.5; -} diff --git a/xrpVendordep/src/main/native/include/wpi/xrp/XRPServo.hpp b/xrpVendordep/src/main/native/include/wpi/xrp/XRPServo.hpp index 3c7e21dbcf..01a7e6354c 100644 --- a/xrpVendordep/src/main/native/include/wpi/xrp/XRPServo.hpp +++ b/xrpVendordep/src/main/native/include/wpi/xrp/XRPServo.hpp @@ -46,24 +46,6 @@ class XRPServo { */ wpi::units::radian_t GetAngle() const; - /** - * Set the servo position. - * - * @param position Desired position (Between 0.0 and 1.0) - * @deprecated Use SetAngle() instead - */ - [[deprecated("Use SetAngle() instead")]] - void SetPosition(double position); - - /** - * Get the servo position. - * - * @return Current servo position - * @deprecated Use GetAngle() instead - */ - [[deprecated("Use GetAngle() instead")]] - double GetPosition() const; - private: hal::SimDevice m_simDevice; hal::SimDouble m_simPosition; diff --git a/xrpVendordep/src/main/python/semiwrap/XRPServo.yml b/xrpVendordep/src/main/python/semiwrap/XRPServo.yml index 01890a062a..12eb93a5fe 100644 --- a/xrpVendordep/src/main/python/semiwrap/XRPServo.yml +++ b/xrpVendordep/src/main/python/semiwrap/XRPServo.yml @@ -4,5 +4,3 @@ classes: XRPServo: SetAngle: GetAngle: - SetPosition: - GetPosition: