2022-Robot
Robot code for 2022 FRC Season by Argos, FRC team #1756
Loading...
Searching...
No Matches
RobotContainer.h
Go to the documentation of this file.
1
4
5#pragma once
6
7#include <frc/Compressor.h>
8#include <frc2/command/Command.h>
9
10#include <memory>
11
12#include "Constants.h"
38#include "utils/auto_selector.h"
41
50 public:
52
53 frc2::Command* GetAutonomousCommand();
54
58 void Disable();
59
60 private:
61 std::shared_ptr<NetworkTablesWrapper> m_pNetworkTable;
62
63 // The robot's subsystems and commands are defined here...
64 // Interpolation of controller inputs. Used for making the inputs non-linear, allowing finer control of how the robot responds to the joystick.
69
74
79
81
82 frc::Compressor m_compressor;
83
87 std::unique_ptr<ClimberSubsystem> m_pClimber;
89
94
95 // Tuning stuff
96 units::degree_t m_hoodTargetPosition;
97 units::revolutions_per_minute_t m_shooterTargetVelocity;
99 units::inches_per_second_t m_climberArmCruiseVelocity;
100 units::inches_per_second_squared_t m_climberArmAccel;
102 units::inches_per_second_t m_climberHookCruiseVelocity;
103 units::inches_per_second_squared_t m_climberHookAccel;
104 units::degree_t m_turretTargetPosition;
105 units::inch_t m_targetShotDistance;
107
108 // Drive profile tuning
115 units::degrees_per_second_t m_driveFollowerRotationalVelocity;
116 units::degrees_per_second_squared_t m_driveFollowerRotationalAcceleration;
117
118 units::inch_t m_driveProfileDistX;
119 units::inch_t m_driveProfileDistY;
120 units::degree_t m_driveProfileRot;
121 units::feet_per_second_t m_driveProfileMaxLinearVel;
122 units::feet_per_second_squared_t m_driveProfileMaxLinearAccel;
123 units::degrees_per_second_t m_driveProfileMaxRotationalVel;
124 units::degrees_per_second_squared_t m_driveProfileMaxRotationalAccel;
125
126 // Autonomous Commands
140
141 // Autonomous Selector
143
145};
Allow user to select from auto routines using the default dashboard autonomous selector.
Definition: auto_selector.h:16
Definition: autonomous_center_1ball_delay.h:22
Definition: autonomous_center_1ball.h:28
Definition: autonomous_center_left_2ball_defense.h:28
Definition: autonomous_center_left_2ball_delay.h:22
Definition: autonomous_center_left_2ball.h:28
Definition: autonomous_center_right_2ball_delay.h:22
Definition: autonomous_center_right_2ball.h:28
Definition: autonomous_nothing.h:23
Definition: autonomous_right_2ball_delay.h:22
Definition: autonomous_right_2ball.h:28
Definition: autonomous_right_5ballDef.h:26
Definition: autonomous_right_5ball_gap.h:26
Definition: autonomous_right_5ball.h:26
Works with the climber subsystem to execute a series of setpoints, automating the climb sequence.
Definition: climb_command.h:19
Moves arms slowly down, upon reaching known position will reset relative positioning.
Definition: home_climber_arm_command.h:19
Slowly moves hooks down the rail, upon reaching known position will reset relative positioning.
Definition: home_climber_hook_command.h:19
Moves hood slowly down, until hitting a known position then resets relative positioning.
Definition: home_hood_command.h:19
Controls the Intake of the robot and provides internal ball position state info.
Definition: intake_subsystem.h:24
Definition: RobotContainer.h:49
argos_lib::NTSubscriber m_NTMonitor
Definition: RobotContainer.h:106
double m_driveFollowerRotationalkI
Definition: RobotContainer.h:113
ClimbCommand m_climbCommand
Definition: RobotContainer.h:93
units::inch_t m_driveProfileDistY
Definition: RobotContainer.h:119
double m_driveFollowerLinearkI
Definition: RobotContainer.h:110
units::revolutions_per_minute_t m_shooterTargetVelocity
Definition: RobotContainer.h:97
AutonomousRight5ball m_autoRight5Ball
Definition: RobotContainer.h:136
AutonomousRight5ballGap m_autoRight5BallGap
Definition: RobotContainer.h:138
units::inch_t m_climberHookTargetExtension
Definition: RobotContainer.h:101
units::degrees_per_second_squared_t m_driveProfileMaxRotationalAccel
Definition: RobotContainer.h:124
argos_lib::InterpolationMap< decltype(controllerMap::hoodSpeed.front().inVal), controllerMap::hoodSpeed.size()> m_hoodSpeedMap
Definition: RobotContainer.h:78
AutoSelector m_autoRoutineSelector
Definition: RobotContainer.h:142
AutonomousCenterRight2ballDelay m_autoCenterRight2BallDelay
Definition: RobotContainer.h:133
units::inch_t m_climberArmTargetExtension
Definition: RobotContainer.h:98
AutonomousCenterRight2ball m_autoCenterRight2Ball
Definition: RobotContainer.h:132
HomeHoodCommand m_homeHoodCommand
Definition: RobotContainer.h:90
units::feet_per_second_t m_driveProfileMaxLinearVel
Definition: RobotContainer.h:121
AutonomousNothing m_autoNothing
Definition: RobotContainer.h:139
std::shared_ptr< NetworkTablesWrapper > m_pNetworkTable
Definition: RobotContainer.h:61
std::unique_ptr< ClimberSubsystem > m_pClimber
Definition: RobotContainer.h:87
AutonomousRight2ball m_autoRight2Ball
Definition: RobotContainer.h:134
units::inches_per_second_t m_climberArmCruiseVelocity
Definition: RobotContainer.h:99
frc2::Command * GetAutonomousCommand()
Definition: RobotContainer.cpp:602
void Disable()
Called once when robot is disabled.
Definition: RobotContainer.cpp:606
SwerveDriveSubsystem m_swerveDrive
Definition: RobotContainer.h:85
double m_driveFollowerLinearkP
Definition: RobotContainer.h:109
units::inch_t m_driveProfileDistX
Definition: RobotContainer.h:118
units::degrees_per_second_t m_driveProfileMaxRotationalVel
Definition: RobotContainer.h:123
units::degrees_per_second_t m_driveFollowerRotationalVelocity
Definition: RobotContainer.h:115
AutonomousCenterLeft2ballDefense m_autoCenterLeft2BallDefense
Definition: RobotContainer.h:130
argos_lib::InterpolationMap< decltype(controllerMap::hookSpeed.front().inVal), controllerMap::hookSpeed.size()> m_hookSpeedMap
Definition: RobotContainer.h:71
units::inch_t m_targetShotDistance
Definition: RobotContainer.h:105
units::degree_t m_driveProfileRot
Definition: RobotContainer.h:120
AutonomousRight2ballDelay m_autoRight2BallDelay
Definition: RobotContainer.h:135
AutonomousRight5ballDef m_autoRight5BallDef
Definition: RobotContainer.h:137
argos_lib::InterpolationMap< decltype(controllerMap::driveRotSpeed.front().inVal), controllerMap::driveRotSpeed.size()> m_driveRotSpeed
Definition: RobotContainer.h:68
double m_driveFollowerRotationalkP
Definition: RobotContainer.h:112
AutonomousCenter1ballDelay m_autoCenter1ballDelay
Definition: RobotContainer.h:128
AutonomousCenter1ball m_autoCenter1ball
Definition: RobotContainer.h:127
AutonomousCenterLeft2ballDelay m_autoCenterLeft2BallDelay
Definition: RobotContainer.h:131
units::degrees_per_second_squared_t m_driveFollowerRotationalAcceleration
Definition: RobotContainer.h:116
void ConfigureButtonBindings()
Definition: RobotContainer.cpp:336
HomeClimberHookCommand m_homeClimberHookCommand
Definition: RobotContainer.h:92
units::feet_per_second_squared_t m_driveProfileMaxLinearAccel
Definition: RobotContainer.h:122
units::inches_per_second_t m_climberHookCruiseVelocity
Definition: RobotContainer.h:102
units::inches_per_second_squared_t m_climberArmAccel
Definition: RobotContainer.h:100
units::degree_t m_turretTargetPosition
Definition: RobotContainer.h:104
argos_lib::SwappableControllersSubsystem m_controllers
Definition: RobotContainer.h:84
RobotContainer()
Definition: RobotContainer.cpp:21
IntakeSubsystem m_intake
Definition: RobotContainer.h:86
AutonomousCenterLeft2ball m_autoCenterLeft2Ball
Definition: RobotContainer.h:129
argos_lib::InterpolationMap< decltype(controllerMap::armSpeed.front().inVal), controllerMap::armSpeed.size()> m_armSpeedMap
Definition: RobotContainer.h:73
argos_lib::InterpolationMap< decltype(controllerMap::driveSpeed.front().inVal), controllerMap::driveSpeed.size()> m_driveSpeedMap
Definition: RobotContainer.h:66
units::degree_t m_hoodTargetPosition
Definition: RobotContainer.h:96
ShooterSubsystem m_shooter
Definition: RobotContainer.h:88
frc::Compressor m_compressor
Definition: RobotContainer.h:82
HomeClimberArmCommand m_homeClimberArmCommand
Definition: RobotContainer.h:91
double m_driveFollowerLinearkD
Definition: RobotContainer.h:111
units::inches_per_second_squared_t m_climberHookAccel
Definition: RobotContainer.h:103
double m_driveFollowerRotationalkD
Definition: RobotContainer.h:114
argos_lib::InterpolationMap< decltype(controllerMap::turretSpeed.front().inVal), controllerMap::turretSpeed.size()> m_turretSpeedMap
Definition: RobotContainer.h:76
const argos_lib::RobotInstance m_instance
Definition: RobotContainer.h:80
Definition: shooter_subsystem.h:138
Subsystem for controlling the swerve drivetrain of the robot.
Definition: swerve_drive_subsystem.h:50
Performs linear interpolation of a value based on a set of input->output mapping points.
Definition: interpolation.h:46
Subscribes to Network Tables entry updates and calls a specified callback to use the new value.
Definition: nt_subscriber.h:16
Allows two controllers to swap between "Driver" and "Operator" control schemes on the fly by swapping...
Definition: swappable_controllers_subsystem.h:18
RobotInstance
Differentiates between practice robot and competition robot.
Definition: config_types.h:13
constexpr std::array driveRotSpeed
Definition: interpolation_maps.h:51
constexpr std::array hoodSpeed
Definition: interpolation_maps.h:61
constexpr std::array hookSpeed
Definition: interpolation_maps.h:54
constexpr std::array armSpeed
Definition: interpolation_maps.h:56
constexpr std::array turretSpeed
Definition: interpolation_maps.h:59
constexpr std::array driveSpeed
Definition: interpolation_maps.h:45