// 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 "subsystems/DriveSubsystem.h" /** * A command to drive the robot with joystick input passed in through lambdas. * Written explicitly for pedagogical purposes - actual code should inline a * command this simple with RunCommand. * * @see RunCommand */ class DefaultDrive : public frc2::CommandHelper { public: /** * Creates a new DefaultDrive. * * @param subsystem The drive subsystem this command wil run on. * @param forward The control input for driving forwards/backwards * @param rotation The control input for turning */ DefaultDrive(DriveSubsystem* subsystem, std::function forward, std::function rotation); void Execute() override; private: DriveSubsystem* m_drive; std::function m_forward; std::function m_rotation; };