2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
place_cone_command.h
Go to the documentation of this file.
1
4
5#pragma once
6
8#include <frc/smartdashboard/SmartDashboard.h>
9#include <frc2/command/CommandBase.h>
10#include <frc2/command/CommandHelper.h>
11#include <frc2/command/SequentialCommandGroup.h>
16
17#include <string>
18
20
22 : public frc2::CommandHelper<frc2::CommandBase, PlaceConeCommand>
23 , public AutonomousCommand {
24 public:
26 LifterSubsystem* lifter,
27 IntakeSubsystem* intake,
28 frc::Translation2d desiredArmPos,
29 ScoringPosition scoringPos);
30
31 void Initialize() override;
32
33 void Execute() override;
34
35 void End(bool interrupted) override;
36
37 bool IsFinished() override;
38
42 std::string GetName() const final;
46 frc2::Command* GetCommand() final;
47
48 private:
49 static units::degree_t GetShoulderAngle(const LifterSubsystem& lifter, const frc::Translation2d& pose) {
50 units::degree_t shoulderAngle = lifter.ConvertLifterPose(pose).shoulderAngle;
51 frc::SmartDashboard::PutNumber("(GetShoulderAngle) degrees", units::degree_t(shoulderAngle).to<double>());
52 return shoulderAngle;
53 }
54
58
59 frc::Translation2d m_desiredArmPos;
61
62 frc2::CommandPtr m_allCommands;
63};
A command that can be selected from the dashboard.
Definition autonomous_command.h:14
Definition bash_guard_subsystem.h:14
Definition intake_subsystem.h:17
Definition lifter_subsystem.h:26
Definition place_cone_command.h:23
LifterSubsystem * m_lifter
Definition place_cone_command.h:56
IntakeSubsystem * m_intake
Definition place_cone_command.h:57
frc2::CommandPtr m_allCommands
Definition place_cone_command.h:62
frc::Translation2d m_desiredArmPos
Definition place_cone_command.h:59
void Initialize() override
Definition place_cone_command.cpp:35
ScoringPosition m_scoringPosition
Definition place_cone_command.h:60
frc2::Command * GetCommand() final
Get the command to run when selected from dashboard.
Definition place_cone_command.cpp:77
bool IsFinished() override
Definition place_cone_command.cpp:67
void Execute() override
Definition place_cone_command.cpp:57
void End(bool interrupted) override
Definition place_cone_command.cpp:62
std::string GetName() const final
Get the name of the command to display on the dashboard.
Definition place_cone_command.cpp:73
BashGuardSubsystem * m_bashGuard
Definition place_cone_command.h:55
static units::degree_t GetShoulderAngle(const LifterSubsystem &lifter, const frc::Translation2d &pose)
Definition place_cone_command.h:49
Definition field_points.h:37