mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[commands] Add convenience factories (#4460)
Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
// 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 <frc2/command/CommandPtr.h>
|
||||
#include <frc2/command/button/CommandXboxController.h>
|
||||
|
||||
#include "Constants.h"
|
||||
#include "subsystems/Drive.h"
|
||||
#include "subsystems/Intake.h"
|
||||
#include "subsystems/Shooter.h"
|
||||
#include "subsystems/Storage.h"
|
||||
|
||||
/**
|
||||
* This class is where the bulk of the robot should be declared. Since
|
||||
* Command-based is a "declarative" paradigm, very little robot logic should
|
||||
* actually be handled in the {@link Robot} periodic methods (other than the
|
||||
* scheduler calls). Instead, the structure of the robot (including subsystems,
|
||||
* commands, and button mappings) should be declared here.
|
||||
*/
|
||||
class RapidReactCommandBot {
|
||||
public:
|
||||
/**
|
||||
* Use this method to define bindings between conditions and commands. These
|
||||
* are useful for automating robot behaviors based on button and sensor input.
|
||||
*
|
||||
* <p>Should be called during Robot::RobotInit().
|
||||
*
|
||||
* <p>Event binding methods are available on the frc2::Trigger class.
|
||||
*/
|
||||
void ConfigureBindings();
|
||||
|
||||
/**
|
||||
* Use this to define the command that runs during autonomous.
|
||||
*
|
||||
* <p>Scheduled during Robot::AutonomousInit().
|
||||
*/
|
||||
frc2::CommandPtr GetAutonomousCommand();
|
||||
|
||||
private:
|
||||
// The robot's subsystems
|
||||
Drive m_drive;
|
||||
Intake m_intake;
|
||||
Shooter m_shooter;
|
||||
Storage m_storage;
|
||||
|
||||
// The driver's controller
|
||||
frc2::CommandXboxController m_driverController{
|
||||
OIConstants::kDriverControllerPort};
|
||||
};
|
||||
Reference in New Issue
Block a user