Merge branch 'main' into 2027

This commit is contained in:
Peter Johnson
2024-12-19 20:40:37 -08:00
46 changed files with 1512 additions and 431 deletions

View File

@@ -41,12 +41,11 @@ class ProxyCommand : public CommandHelper<Command, ProxyCommand> {
* 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 <code>AsProxy</code> decorator.
* supplier-constructed proxied command should instead defer a proxy command.
* @see DeferredCommand
*/
WPI_IGNORE_DEPRECATED
[[deprecated("Proxy a DeferredCommand instead")]]
[[deprecated("Defer a proxy command instead.")]]
explicit ProxyCommand(wpi::unique_function<Command*()> supplier);
/**
@@ -62,11 +61,10 @@ class ProxyCommand : public CommandHelper<Command, ProxyCommand> {
* 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 <code>AsProxy</code> decorator.
* supplier-constructed proxied command should instead defer a proxy command.
* @see DeferredCommand
*/
[[deprecated("Proxy a DeferredCommand instead")]]
[[deprecated("Defer a proxy command instead.")]]
explicit ProxyCommand(wpi::unique_function<CommandPtr()> supplier);
WPI_UNIGNORE_DEPRECATED

View File

@@ -11,6 +11,7 @@
#include <frc/event/EventLoop.h>
#include <frc/filter/Debouncer.h>
#include <units/time.h>
#include <wpi/FunctionExtras.h>
#include "frc2/command/Command.h"
#include "frc2/command/CommandScheduler.h"
@@ -291,6 +292,13 @@ class Trigger {
bool Get() const;
private:
/**
* Adds a binding to the EventLoop.
*
* @param body The body of the binding to add.
*/
void AddBinding(wpi::unique_function<void(bool, bool)>&& body);
frc::EventLoop* m_loop;
std::function<bool()> m_condition;
};