FRC Paradigm Shift #1259
Documentation for the 2021 Robot
RobotContainer.h
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2019 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #include <frc/Filesystem.h>
11 #include <frc/XboxController.h>
12 
13 #include <frc/controller/PIDController.h>
14 #include <frc/controller/ProfiledPIDController.h>
15 
16 #include <frc/shuffleboard/Shuffleboard.h>
17 #include <frc/smartdashboard/SendableChooser.h>
18 
19 #include <frc2/command/Command.h>
20 #include <frc2/command/button/JoystickButton.h>
21 #include <frc2/command/InstantCommand.h>
22 #include <frc2/command/PIDCommand.h>
23 #include <frc2/command/RunCommand.h>
24 #include <frc2/command/SequentialCommandGroup.h>
25 #include <frc2/command/ParallelRaceGroup.h>
26 #include <frc2/command/SwerveControllerCommand.h>
27 
28 #include <frc/geometry/Translation2d.h>
29 
30 #include <frc/trajectory/Trajectory.h>
31 #include <frc/trajectory/TrajectoryGenerator.h>
32 #include <frc/trajectory/TrajectoryUtil.h>
33 
34 #include "common/Util.h"
35 #include "common/Gyro.h"
37 
40 
41 #include "Constants.h"
42 
43 #include <iostream>
44 #include <wpi/Path.h>
45 #include <wpi/SmallString.h>
46 
48 {
49 public:
51 
52  void Periodic();
53 
54  void ZeroDrive();
55  enum AutoPath {kEx1, kEx2, kEx3, kEx4};
56  frc2::Command *GetAutonomousCommand(AutoPath path);
57 
58  frc::SendableChooser<AutoPath> m_chooser;
59 
60 private:
61  void SetDefaultCommands();
63  frc2::SwerveControllerCommand2<DriveConstants::kNumSwerveModules> GetSwerveCommand(double path[][6], int length, bool primaryPath);
64  frc::Trajectory convertArrayToTrajectory(double a[][6], int length);
65  void PrintTrajectory(frc::Trajectory& trajectory);
66 
69 
72  bool m_fieldRelative = true;
74 };
void SetDefaultCommands()
void PrintTrajectory(frc::Trajectory &trajectory)
VisionSubsystem m_vision
frc2::SwerveControllerCommand2< DriveConstants::kNumSwerveModules > GetSwerveCommand(double path[][6], int length, bool primaryPath)
Definition: Gyro.h:14
frc::XboxController m_primaryController
constexpr int kSecondaryControllerPort
Definition: Constants.h:188
constexpr int kPrimaryControllerPort
Definition: Constants.h:186
frc::Trajectory convertArrayToTrajectory(double a[][6], int length)
frc2::Command * GetAutonomousCommand(AutoPath path)
frc::SendableChooser< AutoPath > m_chooser
DriveSubsystem m_drive
frc::XboxController m_secondaryController
void ConfigureButtonBindings()