diff --git a/.bazelrc b/.bazelrc index 8dcb2a1274..966b2e52ab 100644 --- a/.bazelrc +++ b/.bazelrc @@ -35,28 +35,35 @@ build:build_cpp --test_tag_filters=+allwpilib-build-cpp --build_tag_filters=+all build:no_example --test_tag_filters=-wpi-example --build_tag_filters=-wpi-example test:no_example --test_tag_filters=-wpi-example --build_tag_filters=-wpi-example +# Artifactory Cache Setup +build:base_remote --remote_timeout=3600 + +# Additional suggestions from buildbuddy for speed +build:base_remote --experimental_remote_cache_compression +build:base_remote --experimental_remote_cache_compression_threshold=100 +build:base_remote --noslim_profile +build:base_remote --experimental_profile_include_target_label +build:base_remote --experimental_profile_include_primary_output +build:base_remote --nolegacy_important_outputs + +common:base_remote_readonly --noremote_upload_local_results +build:artifactory_readonly --config=base_remote_readonly +build:artifactory_readonly --remote_cache=https://frcmaven.wpi.edu/artifactory/wpilib-generic-cache-bazel-local +# workaround for https://github.com/bazelbuild/bazel/issues/17700 +build:artifactory_readonly --remote_cache_header=X-JFrog-Download-Redirect-To=None + # Build Buddy Cache Setup build:build_buddy --bes_results_url=https://app.buildbuddy.io/invocation/ build:build_buddy --bes_backend=grpcs://remote.buildbuddy.io build:build_buddy --remote_cache=grpcs://remote.buildbuddy.io -build:build_buddy --remote_timeout=3600 - -# Additional suggestions from buildbuddy for speed -build:build_buddy --remote_cache_compression -build:build_buddy --experimental_remote_cache_compression_threshold=100 -build:build_buddy --noslim_profile -build:build_buddy --experimental_profile_include_target_label -build:build_buddy --experimental_profile_include_primary_output -build:build_buddy --nolegacy_important_outputs - -common:build_buddy_readonly --noremote_upload_local_results +build:build_buddy --config=base_remote # This config should be used locally. It downloads more than the CI version -build:remote_user --config=build_buddy -build:remote_user --config=build_buddy_readonly +build:remote_user --config=base_remote +build:remote_user --config=artifactory_readonly build:remote_user --remote_download_toplevel -build:ci --config=build_buddy +build:ci --config=base_remote build:ci --remote_download_minimal build --build_metadata=REPO_URL=https://github.com/wpilibsuite/allwpilib.git diff --git a/.github/actions/setup-artifactory-bazel/action.yml b/.github/actions/setup-artifactory-bazel/action.yml new file mode 100644 index 0000000000..f2be1fb149 --- /dev/null +++ b/.github/actions/setup-artifactory-bazel/action.yml @@ -0,0 +1,30 @@ +name: "Setup Artifactory Bazel caching" +description: "Sets up the Artifactory Bazel cache to be readonly / writing based on the presence of environment variables" + +inputs: + username: + description: "Artifactory API username" + token: + description: "Artifactory API token" + +runs: + using: "composite" + steps: + - name: Setup without key + env: + API_KEY: ${{ inputs.token }} + if: ${{ env.API_KEY == '' }} + shell: bash + run: | + echo "No API key secret detected, will setup readonly cache" + echo "build:ci --config=artifactory_readonly" > bazel_auth.rc + + - name: Set with key + env: + API_KEY: ${{ inputs.token }} + if: ${{ env.API_KEY != '' }} + shell: bash + run: | + echo "API Key detected!" + # X-JFrog-Download-Redirect-To is a workaround for https://github.com/bazelbuild/bazel/issues/17700 + echo "build:base_remote --remote_cache=https://${{ inputs.username }}:${{ inputs.token }}@frcmaven.wpi.edu/artifactory/wpilib-generic-cache-bazel-local --remote_cache_header=X-JFrog-Download-Redirect-To=None" > bazel_auth.rc diff --git a/.github/actions/setup-build-buddy/action.yml b/.github/actions/setup-build-buddy/action.yml deleted file mode 100644 index 423398a053..0000000000 --- a/.github/actions/setup-build-buddy/action.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: 'Setup BuildBuddy acache' -description: 'Sets up the build buddy cache to be readonly / writing based on the presence of environment variables' - -inputs: - token: - description: 'Build Buddy API token' - -runs: - using: "composite" - steps: - - name: Setup without key - env: - API_KEY: ${{ inputs.token }} - if: ${{ env.API_KEY == '' }} - shell: bash - run: | - echo "No API key secret detected, will setup readonly cache" - echo "build:ci --config=build_buddy_readonly" > bazel_auth.rc - - - name: Set with key - env: - API_KEY: ${{ inputs.token }} - if: ${{ env.API_KEY != '' }} - shell: bash - run: | - echo "API Key detected!" - echo "build:build_buddy --remote_header=x-buildbuddy-api-key=${{ env.API_KEY }}" > bazel_auth.rc diff --git a/.github/workflows/aql/wpilib-generic-gradle-cache_unused.aql b/.github/workflows/aql/wpilib-generic-gradle-cache_unused.aql index 242fcaf693..21cc781aef 100644 --- a/.github/workflows/aql/wpilib-generic-gradle-cache_unused.aql +++ b/.github/workflows/aql/wpilib-generic-gradle-cache_unused.aql @@ -5,7 +5,8 @@ "items.find": { "$or":[ { "repo": "wpilib-generic-gradlecache" }, - { "repo": "wpilib-generic-cache-cmake" } + { "repo": "wpilib-generic-cache-cmake" }, + { "repo": "wpilib-generic-cache-bazel" } ], "$or":[ { diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 9bbd3e97f8..768000f54d 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -26,10 +26,11 @@ jobs: java-version: 17 architecture: x64 - - id: Setup_build_buddy - uses: ./.github/actions/setup-build-buddy + - name: Setup Artifactory + uses: ./.github/actions/setup-artifactory-bazel with: - token: ${{ secrets.BUILDBUDDY_API_KEY }} + username: ${{ secrets.ARTIFACTORY_USERNAME }} + token: ${{ secrets.ARTIFACTORY_PASSWORD }} - name: bazel ${{ matrix.action }} run: bazel --output_user_root=C:\\bazelroot ${{ matrix.action }} -k ... --config=ci ${{ matrix.config }} --verbose_failures @@ -42,10 +43,11 @@ jobs: - uses: actions/checkout@v4 with: { fetch-depth: 0 } - - id: Setup_build_buddy - uses: ./.github/actions/setup-build-buddy + - name: Setup Artifactory + uses: ./.github/actions/setup-artifactory-bazel with: - token: ${{ secrets.BUILDBUDDY_API_KEY }} + username: ${{ secrets.ARTIFACTORY_USERNAME }} + token: ${{ secrets.ARTIFACTORY_PASSWORD }} - name: bazel test (release) run: bazel test -k ... --config=ci -c opt --config=macos --nojava_header_compilation --verbose_failures @@ -64,12 +66,12 @@ jobs: steps: - uses: actions/checkout@v4 with: { fetch-depth: 0 } - - uses: bazelbuild/setup-bazelisk@v3 - - id: Setup_build_buddy - uses: ./.github/actions/setup-build-buddy + - name: Setup Artifactory + uses: ./.github/actions/setup-artifactory-bazel with: - token: ${{ secrets.BUILDBUDDY_API_KEY }} + username: ${{ secrets.ARTIFACTORY_USERNAME }} + token: ${{ secrets.ARTIFACTORY_PASSWORD }} - name: bazel ${{ matrix.action }} (release) run: bazel ${{ matrix.action }} ... --config=ci -c opt ${{ matrix.config }} -k --verbose_failures diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f5b54d4b04..f04042415e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,7 @@ So you want to contribute your changes back to WPILib. Great! We have a few cont - [General Contribution Rules](#general-contribution-rules) - [What to Contribute](#what-to-contribute) +- [Contribution Process](#contribution-process) - [Coding Guidelines](#coding-guidelines) - [Submitting Changes](#submitting-changes) - [Pull Request Format](#pull-request-format) @@ -30,12 +31,21 @@ So you want to contribute your changes back to WPILib. Great! We have a few cont - Features must be added to Java (WPILibJ), C++ (WPILibC), with rare exceptions. - Most of Python (RobotPy) is created by wrapping WPILibC with pybind11 via robotpy-build. However, new features to the command framework should also be submitted to [robotpy-commands-v2](https://github.com/robotpy/robotpy-commands-v2) as the command framework is reimplemented in Python. - During competition season, we will not merge any new feature additions. We want to ensure that the API is stable during the season to help minimize issues for teams. - - Ask about large changes before spending a bunch of time on them! You can create a new issue on our GitHub tracker for feature request/discussion and talk about it with us there. + - Ask about large changes before spending a bunch of time on them! See [Contribution Process](#contribution-process) for where to ask. - Features that make it easier for teams with less experience to be more successful are more likely to be accepted. - Features in WPILib should be broadly applicable to all teams. Anything that is team specific should not be submitted. - As a rule, we are happy with the general structure of WPILib. We are not interested in major rewrites of all of WPILib. We are open to talking about ideas, but backwards compatibility is very important for WPILib, so be sure to keep this in mind when proposing major changes. - Generally speaking, we do not accept code for specific sensors. We have to be able to test the sensor in hardware on the WPILib test bed. Additionally, hardware availability for teams is important. Therefore, as a general rule, the library only directly supports hardware that is in the Kit of Parts. If you are a company interested in getting a sensor into the Kit of Parts, please contact FIRST directly at frcparts@firstinspires.org. +## Contribution Process + +Have an idea to make WPILib better? Here's some steps to go from idea to implementation: + +1. (Optional) **Discuss it in the Discord.** The programming discussion channel in the [Unofficial FIRST Robotics Competition Discord Server](https://discord.com/invite/frc) is a popular choice for initial discussion about ideas because many WPILib developers are active there and the live messaging nature of the platform is well suited for initial discussion (particularly for smaller changes). Note that the unofficial Discord server is not a mandatory step in the development process and is not endorsed by FIRSTĀ®. +2. (Recommended) **Open a GitHub issue.** GitHub issues are another way to get initial feedback about an idea before working on an implementation. Compared to the unofficial Discord server, GitHub issues have much wider visibility and are better suited for serious discussions about major changes. Getting feedback about an idea (whether in the unofficial Discord server or in a GitHub issue) before working on the implementation is recommended to avoid working on a change that will be rejected, though some ideas are pretty safe. +3. (Rare) **Create a design document in GitHub.** Sometimes, a change is so large that a design document is necessary to fully flesh out the details (and get feedback on them) before starting on an implementation. This is done through a pull request that adds the design document (as a Markdown file) to the repository. This is extremely rare, and it is sometimes done concurrently with the implementation if the change doesn't need much debate but is large enough to require a design document. +4. (Mandatory) **Create a GitHub pull request.** This is how you implement the changes, and is the focus of most of the rest of this document. + ## Coding Guidelines WPILib uses modified Google style guides for both C++ and Java, which can be found in the [styleguide repository](https://github.com/wpilibsuite/styleguide). Autoformatters are available for many popular editors at https://github.com/google/styleguide. Running wpiformat is required for all contributions and is enforced by our continuous integration system. diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java index d6cd4c8860..d46ce313c6 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/Command.java @@ -533,7 +533,12 @@ public abstract class Command implements Sendable { }); } - /** Schedules this command. */ + /** + * Schedules this command. + * + * @deprecated Use CommandScheduler.getInstance().schedule(Command...) instead + */ + @Deprecated(since = "2025", forRemoval = true) public void schedule() { CommandScheduler.getInstance().schedule(this); } @@ -610,7 +615,7 @@ public abstract class Command implements Sendable { value -> { if (value) { if (!isScheduled()) { - schedule(); + CommandScheduler.getInstance().schedule(this); } } else { if (isScheduled()) { diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ProxyCommand.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ProxyCommand.java index d3235c9e19..67f8fdb1ce 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ProxyCommand.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ProxyCommand.java @@ -58,7 +58,7 @@ public class ProxyCommand extends Command { @Override public void initialize() { m_command = m_supplier.get(); - m_command.schedule(); + CommandScheduler.getInstance().schedule(m_command); } @Override diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ScheduleCommand.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ScheduleCommand.java index cc2234119e..788f6fc2b0 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ScheduleCommand.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/ScheduleCommand.java @@ -28,7 +28,7 @@ public class ScheduleCommand extends Command { @Override public void initialize() { for (Command command : m_toSchedule) { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } } diff --git a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/Trigger.java b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/Trigger.java index 8dc3ae52b3..65c6145f6b 100644 --- a/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/Trigger.java +++ b/wpilibNewCommands/src/main/java/edu/wpi/first/wpilibj2/command/button/Trigger.java @@ -93,7 +93,7 @@ public class Trigger implements BooleanSupplier { addBinding( (previous, current) -> { if (previous != current) { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } }); return this; @@ -110,7 +110,7 @@ public class Trigger implements BooleanSupplier { addBinding( (previous, current) -> { if (!previous && current) { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } }); return this; @@ -127,7 +127,7 @@ public class Trigger implements BooleanSupplier { addBinding( (previous, current) -> { if (previous && !current) { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } }); return this; @@ -148,7 +148,7 @@ public class Trigger implements BooleanSupplier { addBinding( (previous, current) -> { if (!previous && current) { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } else if (previous && !current) { command.cancel(); } @@ -171,7 +171,7 @@ public class Trigger implements BooleanSupplier { addBinding( (previous, current) -> { if (previous && !current) { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } else if (!previous && current) { command.cancel(); } @@ -193,7 +193,7 @@ public class Trigger implements BooleanSupplier { if (command.isScheduled()) { command.cancel(); } else { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } } }); @@ -214,7 +214,7 @@ public class Trigger implements BooleanSupplier { if (command.isScheduled()) { command.cancel(); } else { - command.schedule(); + CommandScheduler.getInstance().schedule(command); } } }); diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/Command.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/Command.cpp index af8e30a33a..fea3c1a865 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/Command.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/Command.cpp @@ -197,7 +197,7 @@ void Command::InitSendable(wpi::SendableBuilder& builder) { [this](bool value) { bool isScheduled = IsScheduled(); if (value && !isScheduled) { - Schedule(); + CommandScheduler::GetInstance().Schedule(this); } else if (!value && isScheduled) { Cancel(); } diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp index 92999ea691..e328abc53c 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/ProxyCommand.cpp @@ -37,7 +37,7 @@ ProxyCommand::ProxyCommand(std::unique_ptr command) { void ProxyCommand::Initialize() { m_command = m_supplier(); - m_command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_command); } void ProxyCommand::End(bool interrupted) { diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/ScheduleCommand.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/ScheduleCommand.cpp index c96f21835e..e0ce85d291 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/ScheduleCommand.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/ScheduleCommand.cpp @@ -18,7 +18,7 @@ ScheduleCommand::ScheduleCommand(Command* toSchedule) { void ScheduleCommand::Initialize() { for (auto command : m_toSchedule) { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } } diff --git a/wpilibNewCommands/src/main/native/cpp/frc2/command/button/Trigger.cpp b/wpilibNewCommands/src/main/native/cpp/frc2/command/button/Trigger.cpp index 00f179da08..6afdbb2b2c 100644 --- a/wpilibNewCommands/src/main/native/cpp/frc2/command/button/Trigger.cpp +++ b/wpilibNewCommands/src/main/native/cpp/frc2/command/button/Trigger.cpp @@ -29,7 +29,7 @@ void Trigger::AddBinding(wpi::unique_function&& body) { Trigger Trigger::OnChange(Command* command) { AddBinding([command](bool previous, bool current) { if (previous != current) { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } }); return *this; @@ -38,7 +38,7 @@ Trigger Trigger::OnChange(Command* command) { Trigger Trigger::OnChange(CommandPtr&& command) { AddBinding([command = std::move(command)](bool previous, bool current) { if (previous != current) { - command.Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } }); return *this; @@ -47,7 +47,7 @@ Trigger Trigger::OnChange(CommandPtr&& command) { Trigger Trigger::OnTrue(Command* command) { AddBinding([command](bool previous, bool current) { if (!previous && current) { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } }); return *this; @@ -56,7 +56,7 @@ Trigger Trigger::OnTrue(Command* command) { Trigger Trigger::OnTrue(CommandPtr&& command) { AddBinding([command = std::move(command)](bool previous, bool current) { if (!previous && current) { - command.Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } }); return *this; @@ -65,7 +65,7 @@ Trigger Trigger::OnTrue(CommandPtr&& command) { Trigger Trigger::OnFalse(Command* command) { AddBinding([command](bool previous, bool current) { if (previous && !current) { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } }); return *this; @@ -74,7 +74,7 @@ Trigger Trigger::OnFalse(Command* command) { Trigger Trigger::OnFalse(CommandPtr&& command) { AddBinding([command = std::move(command)](bool previous, bool current) { if (previous && !current) { - command.Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } }); return *this; @@ -83,7 +83,7 @@ Trigger Trigger::OnFalse(CommandPtr&& command) { Trigger Trigger::WhileTrue(Command* command) { AddBinding([command](bool previous, bool current) { if (!previous && current) { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } else if (previous && !current) { command->Cancel(); } @@ -94,7 +94,7 @@ Trigger Trigger::WhileTrue(Command* command) { Trigger Trigger::WhileTrue(CommandPtr&& command) { AddBinding([command = std::move(command)](bool previous, bool current) { if (!previous && current) { - command.Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } else if (previous && !current) { command.Cancel(); } @@ -105,7 +105,7 @@ Trigger Trigger::WhileTrue(CommandPtr&& command) { Trigger Trigger::WhileFalse(Command* command) { AddBinding([command](bool previous, bool current) { if (previous && !current) { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } else if (!previous && current) { command->Cancel(); } @@ -116,7 +116,7 @@ Trigger Trigger::WhileFalse(Command* command) { Trigger Trigger::WhileFalse(CommandPtr&& command) { AddBinding([command = std::move(command)](bool previous, bool current) { if (!previous && current) { - command.Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } else if (previous && !current) { command.Cancel(); } @@ -130,7 +130,7 @@ Trigger Trigger::ToggleOnTrue(Command* command) { if (command->IsScheduled()) { command->Cancel(); } else { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } } }); @@ -143,7 +143,7 @@ Trigger Trigger::ToggleOnTrue(CommandPtr&& command) { if (command.IsScheduled()) { command.Cancel(); } else { - command.Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } } }); @@ -156,7 +156,7 @@ Trigger Trigger::ToggleOnFalse(Command* command) { if (command->IsScheduled()) { command->Cancel(); } else { - command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } } }); @@ -169,7 +169,7 @@ Trigger Trigger::ToggleOnFalse(CommandPtr&& command) { if (command.IsScheduled()) { command.Cancel(); } else { - command.Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(command); } } }); diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/Command.h b/wpilibNewCommands/src/main/native/include/frc2/command/Command.h index 79b6d75968..480d501f8b 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/Command.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/Command.h @@ -398,7 +398,10 @@ class Command : public wpi::Sendable, public wpi::SendableHelper { /** * Schedules this command. + * + * @deprecated Use CommandScheduler::GetInstance().Schedule() instead */ + [[deprecated("Use CommandScheduler::GetInstance().Schedule() instead.")]] void Schedule(); /** diff --git a/wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h b/wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h index fdd53c6425..fb54d3bc09 100644 --- a/wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h +++ b/wpilibNewCommands/src/main/native/include/frc2/command/CommandPtr.h @@ -277,7 +277,10 @@ CommandPtr final { /** * 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 diff --git a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/CommandSendableButtonTest.java b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/CommandSendableButtonTest.java index c89ed7f7f3..809044aeb0 100644 --- a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/CommandSendableButtonTest.java +++ b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/CommandSendableButtonTest.java @@ -55,7 +55,7 @@ class CommandSendableButtonTest extends CommandTestBase { @Test void trueAndScheduledNoOp() { // Scheduled and true -> no-op - m_command.schedule(); + CommandScheduler.getInstance().schedule(m_command); CommandScheduler.getInstance().run(); SmartDashboard.updateValues(); assertTrue(m_command.isScheduled()); @@ -90,7 +90,7 @@ class CommandSendableButtonTest extends CommandTestBase { @Test void falseAndScheduledCancel() { // Scheduled and false -> cancel - m_command.schedule(); + CommandScheduler.getInstance().schedule(m_command); CommandScheduler.getInstance().run(); SmartDashboard.updateValues(); assertTrue(m_command.isScheduled()); diff --git a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ProxyCommandTest.java b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ProxyCommandTest.java index 2eae20bbc8..9b1fe4270c 100644 --- a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ProxyCommandTest.java +++ b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ProxyCommandTest.java @@ -22,7 +22,7 @@ class ProxyCommandTest extends CommandTestBase { scheduler.schedule(scheduleCommand); - verify(command1).schedule(); + verify(command1).initialize(); } } diff --git a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ScheduleCommandTest.java b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ScheduleCommandTest.java index 875b2e5ea9..e5c47493de 100644 --- a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ScheduleCommandTest.java +++ b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/ScheduleCommandTest.java @@ -22,8 +22,8 @@ class ScheduleCommandTest extends CommandTestBase { scheduler.schedule(scheduleCommand); - verify(command1).schedule(); - verify(command2).schedule(); + verify(command1).initialize(); + verify(command2).initialize(); } } diff --git a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/NetworkButtonTest.java b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/NetworkButtonTest.java index b9adc1344c..7b1de35046 100644 --- a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/NetworkButtonTest.java +++ b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/NetworkButtonTest.java @@ -39,10 +39,10 @@ class NetworkButtonTest extends CommandTestBase { pub.set(false); button.onTrue(command); scheduler.run(); - verify(command, never()).schedule(); + verify(command, never()).initialize(); pub.set(true); scheduler.run(); scheduler.run(); - verify(command).schedule(); + verify(command).initialize(); } } diff --git a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/TriggerTest.java b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/TriggerTest.java index 8cd5fdea2f..58406847ef 100644 --- a/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/TriggerTest.java +++ b/wpilibNewCommands/src/test/java/edu/wpi/first/wpilibj2/command/button/TriggerTest.java @@ -207,7 +207,7 @@ class TriggerTest extends CommandTestBase { .until(button); button.setPressed(false); - command1.schedule(); + scheduler.schedule(command1); scheduler.run(); assertEquals(1, startCounter.get()); assertEquals(0, endCounter.get()); @@ -258,13 +258,13 @@ class TriggerTest extends CommandTestBase { button.setPressed(true); scheduler.run(); - verify(command, never()).schedule(); + verify(command, never()).initialize(); SimHooks.stepTiming(0.3); button.setPressed(true); scheduler.run(); - verify(command).schedule(); + verify(command).initialize(); } @Test diff --git a/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandSendableButtonTest.cpp b/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandSendableButtonTest.cpp index 08caa5cdda..1f2c8446b1 100644 --- a/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandSendableButtonTest.cpp +++ b/wpilibNewCommands/src/test/native/cpp/frc2/command/CommandSendableButtonTest.cpp @@ -49,7 +49,7 @@ TEST_F(CommandSendableButtonTest, trueAndNotScheduledSchedules) { TEST_F(CommandSendableButtonTest, trueAndScheduledNoOp) { // Scheduled and true -> no-op - m_command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_command.value()); GetScheduler().Run(); frc::SmartDashboard::UpdateValues(); EXPECT_TRUE(m_command->IsScheduled()); @@ -82,7 +82,7 @@ TEST_F(CommandSendableButtonTest, falseAndNotScheduledNoOp) { TEST_F(CommandSendableButtonTest, falseAndScheduledCancel) { // Scheduled and false -> cancel - m_command->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_command.value()); GetScheduler().Run(); frc::SmartDashboard::UpdateValues(); EXPECT_TRUE(m_command->IsScheduled()); diff --git a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp index 142d59fa6b..18be09af70 100644 --- a/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/DriveDistanceOffboard/cpp/Robot.cpp @@ -38,7 +38,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value()); } } diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/Robot.cpp index d731edc1c9..fdd7a4941f 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotInlined/cpp/Robot.cpp @@ -47,7 +47,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand != nullptr) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/Robot.cpp index d731edc1c9..fdd7a4941f 100644 --- a/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/HatchbotTraditional/cpp/Robot.cpp @@ -47,7 +47,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand != nullptr) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/examples/MecanumControllerCommand/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/MecanumControllerCommand/cpp/Robot.cpp index 142d59fa6b..18be09af70 100644 --- a/wpilibcExamples/src/main/cpp/examples/MecanumControllerCommand/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/MecanumControllerCommand/cpp/Robot.cpp @@ -38,7 +38,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value()); } } diff --git a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp index d28c275f8e..51c6813ac5 100644 --- a/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/RapidReactCommandBot/cpp/Robot.cpp @@ -26,7 +26,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_robot.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value()); } } diff --git a/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/Robot.cpp index 5916340735..904a39eb4f 100644 --- a/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/Robot.cpp @@ -37,7 +37,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand != nullptr) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/Robot.cpp index 580decec83..798be1ab1d 100644 --- a/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SelectCommand/cpp/Robot.cpp @@ -38,7 +38,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand != nullptr) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/Robot.cpp index 142d59fa6b..18be09af70 100644 --- a/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SwerveControllerCommand/cpp/Robot.cpp @@ -38,7 +38,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value()); } } diff --git a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/Robot.cpp index 2ed3f804f5..5666887c98 100644 --- a/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/SysIdRoutine/cpp/Robot.cpp @@ -22,7 +22,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value()); } } diff --git a/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/Robot.cpp index 5916340735..904a39eb4f 100644 --- a/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/examples/XRPReference/cpp/Robot.cpp @@ -37,7 +37,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand != nullptr) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand); } } diff --git a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp index 6a1eb4beea..14844d189f 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbased/cpp/Robot.cpp @@ -37,7 +37,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value()); } } diff --git a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp index 2ed3f804f5..5666887c98 100644 --- a/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp +++ b/wpilibcExamples/src/main/cpp/templates/commandbasedskeleton/cpp/Robot.cpp @@ -22,7 +22,7 @@ void Robot::AutonomousInit() { m_autonomousCommand = m_container.GetAutonomousCommand(); if (m_autonomousCommand) { - m_autonomousCommand->Schedule(); + frc2::CommandScheduler::GetInstance().Schedule(m_autonomousCommand.value()); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/drivedistanceoffboard/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/drivedistanceoffboard/Robot.java index 208c6bc8f0..0525a1d4f6 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/drivedistanceoffboard/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/drivedistanceoffboard/Robot.java @@ -65,7 +65,7 @@ public class Robot extends TimedRobot { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined/Robot.java index df9582e035..faaa97ffd4 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbotinlined/Robot.java @@ -67,7 +67,7 @@ public class Robot extends TimedRobot { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional/Robot.java index 39ea80d06a..720316874b 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/hatchbottraditional/Robot.java @@ -74,7 +74,7 @@ public class Robot extends TimedRobot { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand/Robot.java index f4453a37e2..beec10031a 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/mecanumcontrollercommand/Robot.java @@ -65,7 +65,7 @@ public class Robot extends TimedRobot { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/rapidreactcommandbot/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/rapidreactcommandbot/Robot.java index 463e1d6f3c..c90dd0d18b 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/rapidreactcommandbot/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/rapidreactcommandbot/Robot.java @@ -63,7 +63,7 @@ public class Robot extends TimedRobot { m_autonomousCommand = m_robot.getAutonomousCommand(); if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference/Robot.java index 6ea9e353ed..337a478264 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/romireference/Robot.java @@ -58,7 +58,7 @@ public class Robot extends TimedRobot { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/selectcommand/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/selectcommand/Robot.java index 8bcf44391b..0e00fa479e 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/selectcommand/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/selectcommand/Robot.java @@ -65,7 +65,7 @@ public class Robot extends TimedRobot { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand/Robot.java index 850fcfe71e..94f7eecf72 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/swervecontrollercommand/Robot.java @@ -65,7 +65,7 @@ public class Robot extends TimedRobot { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/sysidroutine/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/sysidroutine/Robot.java index fcf7e60473..1ce1d49946 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/sysidroutine/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/sysidroutine/Robot.java @@ -55,7 +55,7 @@ public class Robot extends TimedRobot { m_autonomousCommand = m_robot.getAutonomousCommand(); if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/xrpreference/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/xrpreference/Robot.java index bf3b76c13d..9bb81b3374 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/xrpreference/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/examples/xrpreference/Robot.java @@ -58,7 +58,7 @@ public class Robot extends TimedRobot { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/Robot.java index 3ea9a26269..053bd402fc 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbased/Robot.java @@ -58,7 +58,7 @@ public class Robot extends TimedRobot { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbasedskeleton/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbasedskeleton/Robot.java index 753f54f362..45dc6fc8f2 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbasedskeleton/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/commandbasedskeleton/Robot.java @@ -36,7 +36,7 @@ public class Robot extends TimedRobot { m_autonomousCommand = m_robotContainer.getAutonomousCommand(); if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/romicommandbased/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/romicommandbased/Robot.java index 3282138cf2..6831a89e26 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/romicommandbased/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/romicommandbased/Robot.java @@ -58,7 +58,7 @@ public class Robot extends TimedRobot { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/xrpcommandbased/Robot.java b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/xrpcommandbased/Robot.java index f9a51fec87..4196c275e2 100644 --- a/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/xrpcommandbased/Robot.java +++ b/wpilibjExamples/src/main/java/edu/wpi/first/wpilibj/templates/xrpcommandbased/Robot.java @@ -58,7 +58,7 @@ public class Robot extends TimedRobot { // schedule the autonomous command (example) if (m_autonomousCommand != null) { - m_autonomousCommand.schedule(); + CommandScheduler.getInstance().schedule(m_autonomousCommand); } } diff --git a/wpimath/generate_nanopb.py b/wpimath/generate_nanopb.py index 97af4dfa7c..d8bf6d5b77 100755 --- a/wpimath/generate_nanopb.py +++ b/wpimath/generate_nanopb.py @@ -19,7 +19,7 @@ def generate_nanopb(nanopb: Path, output_directory: Path, proto_dir: Path): proto_files = proto_dir.glob("*.proto") for path in proto_files: absolute_filename = path.absolute() - subprocess.run( + subprocess.check_call( [ sys.executable, nanopb, @@ -28,8 +28,7 @@ def generate_nanopb(nanopb: Path, output_directory: Path, proto_dir: Path): "-S.cpp", "-e.npb", absolute_filename, - ], - check=True, + ] ) java_files = (output_directory).glob("*") for java_file in java_files: diff --git a/wpimath/generate_quickbuf.py b/wpimath/generate_quickbuf.py index 1774a98006..8b0747b858 100755 --- a/wpimath/generate_quickbuf.py +++ b/wpimath/generate_quickbuf.py @@ -15,7 +15,7 @@ def generate_quickbuf( proto_files = proto_dir.glob("*.proto") for path in proto_files: absolute_filename = path.absolute() - subprocess.run( + subprocess.check_call( [ protoc, f"--plugin=protoc-gen-quickbuf={quickbuf_plugin}",