2022-Robot
Robot code for 2022 FRC Season by Argos, FRC team #1756
Loading...
Searching...
No Matches
auto_position_aim_command.h
Go to the documentation of this file.
1
4
5#pragma once
6
7#include <frc/geometry/Translation2d.h>
8#include <frc2/command/CommandBase.h>
9#include <frc2/command/CommandHelper.h>
10
15
16class AutoPositionAimCommand : public frc2::CommandHelper<frc2::CommandBase, AutoPositionAimCommand> {
17 public:
18 explicit AutoPositionAimCommand(ShooterSubsystem* shootSys, frc::Pose2d shootingPosition);
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:
30 frc::Pose2d m_shootingPosition;
32 std::chrono::time_point<std::chrono::steady_clock> m_startTime;
33
34 units::degree_t GetOffsetAngle(frc::Translation2d curPos, frc::Translation2d target);
35
36 units::degree_t GetAngleToPoint(frc::Translation2d curPos, frc::Translation2d target);
37
38 units::degree_t GetTurretAngleToTarget(frc::Pose2d curRobotPos, frc::Translation2d target);
39};
Definition: auto_position_aim_command.h:16
bool IsFinished() override
Definition: auto_position_aim_command.cpp:50
void Execute() override
Definition: auto_position_aim_command.cpp:39
void End(bool interrupted) override
Definition: auto_position_aim_command.cpp:47
units::degree_t GetOffsetAngle(frc::Translation2d curPos, frc::Translation2d target)
Definition: auto_position_aim_command.cpp:58
frc::Pose2d m_shootingPosition
Definition: auto_position_aim_command.h:30
void Initialize() override
Definition: auto_position_aim_command.cpp:22
std::chrono::time_point< std::chrono::steady_clock > m_startTime
When the command began.
Definition: auto_position_aim_command.h:32
units::degree_t GetAngleToPoint(frc::Translation2d curPos, frc::Translation2d target)
Definition: auto_position_aim_command.cpp:75
units::degree_t GetTurretAngleToTarget(frc::Pose2d curRobotPos, frc::Translation2d target)
Definition: auto_position_aim_command.cpp:86
argos_lib::Debouncer m_threshDebounce
Definition: auto_position_aim_command.h:31
ShooterSubsystem * m_pShooter
Definition: auto_position_aim_command.h:29
Definition: shooter_subsystem.h:138
Definition: debouncer.h:14