2022-Robot
Robot code for 2022 FRC Season by Argos, FRC team #1756
Loading...
Searching...
No Matches
shoot_command.h
Go to the documentation of this file.
1
4
5#pragma once
6
7#include <frc2/command/CommandBase.h>
8#include <frc2/command/CommandHelper.h>
9#include <units/time.h>
10
11#include <chrono>
12
14
15class ShootCommand : public frc2::CommandHelper<frc2::CommandBase, ShootCommand> {
16 public:
17 explicit ShootCommand(IntakeSubsystem* subsystem);
18 ShootCommand(IntakeSubsystem* subsystem, uint numCargo, units::millisecond_t timeout);
19
20 void Initialize() override;
21
22 void Execute() override;
23
24 void End(bool interrupted) override;
25
26 bool IsFinished() override;
27
28 private:
33
34 std::chrono::time_point<std::chrono::steady_clock> m_startTime;
35 units::millisecond_t m_timeout;
36};
Controls the Intake of the robot and provides internal ball position state info.
Definition: intake_subsystem.h:24
Definition: shoot_command.h:15
std::chrono::time_point< std::chrono::steady_clock > m_startTime
When the command began.
Definition: shoot_command.h:34
bool IsFinished() override
Definition: shoot_command.cpp:38
void Initialize() override
Definition: shoot_command.cpp:15
IntakeSubsystem * m_pIntake
Definition: shoot_command.h:29
void End(bool interrupted) override
Definition: shoot_command.cpp:33
uint m_totalCargo
Total cargo we expect to shoot. 0 indicates shoot until timeout.
Definition: shoot_command.h:31
uint m_cargoShot
Cargo shot so far.
Definition: shoot_command.h:32
units::millisecond_t m_timeout
0 indicates no timeout
Definition: shoot_command.h:35
void Execute() override
Definition: shoot_command.cpp:23
bool m_previousBallPresent
Definition: shoot_command.h:30