2021-01-01 06:37:20 +02:00
|
|
|
// 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
|
|
|
|
|
|
2023-07-18 21:18:32 -07:00
|
|
|
#include <functional>
|
|
|
|
|
|
2025-11-07 19:57:55 -05:00
|
|
|
#include <wpi/commands2/Command.hpp>
|
|
|
|
|
#include <wpi/commands2/CommandHelper.hpp>
|
2021-01-01 06:37:20 +02:00
|
|
|
|
2025-11-07 19:56:21 -05:00
|
|
|
#include "subsystems/Drivetrain.hpp"
|
2021-01-01 06:37:20 +02:00
|
|
|
|
|
|
|
|
class TeleopArcadeDrive
|
2025-11-07 20:00:05 -05:00
|
|
|
: public wpi::cmd::CommandHelper<wpi::cmd::Command, TeleopArcadeDrive> {
|
2021-01-01 06:37:20 +02:00
|
|
|
public:
|
2024-11-16 10:24:58 -05:00
|
|
|
/**
|
|
|
|
|
* Creates a new ArcadeDrive. This command will drive your robot according to
|
|
|
|
|
* the speed suppliers. This command does not terminate.
|
|
|
|
|
*
|
|
|
|
|
* @param drivetrain The drivetrain subsystem on which this command will run
|
|
|
|
|
* @param xaxisSpeedSupplier Supplier of forward/backward speed
|
|
|
|
|
* @param zaxisRotateSupplier Supplier of rotational speed
|
|
|
|
|
*/
|
2021-01-01 06:37:20 +02:00
|
|
|
TeleopArcadeDrive(Drivetrain* subsystem,
|
|
|
|
|
std::function<double()> xaxisSpeedSupplier,
|
|
|
|
|
std::function<double()> zaxisRotateSupplier);
|
|
|
|
|
void Execute() override;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
Drivetrain* m_drive;
|
|
|
|
|
std::function<double()> m_xaxisSpeedSupplier;
|
|
|
|
|
std::function<double()> m_zaxisRotateSupplier;
|
|
|
|
|
};
|