2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
score_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/CommandPtr.h>
12#include <frc2/command/InstantCommand.h>
16
17#include <memory>
18
26class ScoreConeCommand : public frc2::CommandHelper<frc2::CommandBase, ScoreConeCommand> {
27 public:
29
30 void Initialize() override;
31
32 void Execute() override;
33
34 void End(bool interrupted) override;
35
36 bool IsFinished() override;
37
38 private:
39 static frc::Translation2d GetRelativePose(const frc::Translation2d& initPosition,
40 units::inch_t xOffset,
41 units::inch_t zOffset) {
42 frc::SmartDashboard::PutNumber("(GetRelativePose) Init(X)", units::inch_t(initPosition.X()).to<double>());
43 frc::SmartDashboard::PutNumber("(GetRelativePose) Init(Y)", units::inch_t(initPosition.Y()).to<double>());
44 frc::Translation2d returnPos = frc::Translation2d{initPosition.X() + xOffset, initPosition.Y() + zOffset};
45 frc::SmartDashboard::PutNumber("(GetRelativePose) Relative Pose Calculated(X)",
46 units::inch_t(returnPos.X()).to<double>());
47 frc::SmartDashboard::PutNumber("(GetRelativePose) Relative Pose Calculated(Y)",
48 units::inch_t(returnPos.Y()).to<double>());
49 return returnPos;
50 }
51
55 // Game Piece manipulation
56 frc2::InstantCommand m_retractIntake;
57 frc2::CommandPtr m_allCommands;
58};
Definition bash_guard_subsystem.h:14
Definition intake_subsystem.h:17
Definition lifter_subsystem.h:26
Definition score_cone_command.h:26
frc2::CommandPtr m_allCommands
Definition score_cone_command.h:57
frc2::InstantCommand m_retractIntake
Definition score_cone_command.h:56
bool IsFinished() override
Definition score_cone_command.cpp:79
void Execute() override
Definition score_cone_command.cpp:59
static frc::Translation2d GetRelativePose(const frc::Translation2d &initPosition, units::inch_t xOffset, units::inch_t zOffset)
Definition score_cone_command.h:39
void Initialize() override
Definition score_cone_command.cpp:23
LifterSubsystem & m_lifter
Definition score_cone_command.h:52
void End(bool interrupted) override
Definition score_cone_command.cpp:71
IntakeSubsystem & m_intake
Definition score_cone_command.h:53
BashGuardSubsystem & m_bash
Definition score_cone_command.h:54