-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRobotContainer.h
More file actions
126 lines (91 loc) · 3.07 KB
/
RobotContainer.h
File metadata and controls
126 lines (91 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#pragma once
#include <frc/Errors.h>
#include <memory>
#include <vector>
#include "Parameters.h"
#include "RobotContainer.h"
#include "Utils.h"
// Hardware
#include "hardware/Hardware.h"
// I/O Subsystems
#include "io/SwerveDriveIO.h"
#include "subsystems/SwerveDrive.h"
// Subsystems
#include "subsystems/SwerveDrive.h"
// Gamepad
#include "ui/GamepadMap.h"
#include <frc/Joystick.h>
#include <frc2/command/button/JoystickButton.h>
/// Commands
// swerve
#include "commands/swerve/TeleOpSwerveCommand.h"
#include "commands/swerve/AutoSwerveCommand.h"
#include <frc2/command/Command.h>
#include <frc2/command/SubsystemBase.h>
#include "Logging.h"
//subsytems
#include "subsystems/Arm.h"
#include "subsystems/SwerveDrive.h"
//I/O Subsystems
#include "io/ArmIO.h"
#include "commands/arm/ManualArmCommand.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 RobotContainer {
public:
RobotContainer();
std::shared_ptr<frc2::Command> GetAutonomousCommand();
std::shared_ptr<frc2::Command> GetDriveCommand();
private:
// Hardware Initialization
bool InitHardware(std::unique_ptr<Hardware> &hardware);
bool InitActuators(Actuators *actuators_interface);
bool InitSensors(const Actuators &actuators,
Sensors *sensor_interface);
// Command initialization
bool InitCommands();
// Gamepad initialization
bool InitGamepads();
void ConfigureButtonBindings();
// subsystem initialization
bool InitSwerve();
bool InitArm();
// Robot Hardware
std::unique_ptr<Hardware> hardware_;
std::shared_ptr<SwerveDriveHardwareInterface> swerve_drive_hw_;
std::shared_ptr<ArmHardwareInterface> arm_hw_;
// Hardware I/O interfaces
std::shared_ptr<SwerveDriveIO> swerve_drive_io_;
std::shared_ptr<ArmIO> arm_io_;
// Robot software interfaces.
std::shared_ptr<SwerveDriveSoftwareInterface> swerve_drive_sw_;
std::shared_ptr<ArmSoftwareInterface> arm_sw_;
// Subsystems
std::shared_ptr<SwerveDrive> swerve_drive_;
std::shared_ptr<Arm> arm_;
/**
* User interfaces
* - Gamepads
* - Joystick Buttons
*/
std::shared_ptr<frc::Joystick> gamepad1_;
std::shared_ptr<frc::Joystick> gamepad2_;
std::shared_ptr<frc2::JoystickButton> driver_a_button_;
std::shared_ptr<frc2::JoystickButton> driver_b_button_;
std::shared_ptr<frc2::JoystickButton> driver_back_button_;
std::shared_ptr<frc2::JoystickButton> driver_left_bumper_;
std::shared_ptr<frc2::JoystickButton> driver_right_bumper_;
/**
* Commands
*/
std::shared_ptr<AutoSwerveCommand> m_autonomousCommand_;
// swerve drive
std::shared_ptr<TeleOpSwerveCommand> swerve_teleop_command_;
//arm
std::shared_ptr<ManualArmCommand> manual_arm_command_;
};