2022-Robot
Robot code for 2022 FRC Season by Argos, FRC team #1756
Loading...
Searching...
No Matches
drive_to_location.h
Go to the documentation of this file.
1
4
5#pragma once
6
7#include <frc/geometry/Pose2d.h>
8#include <frc2/command/CommandBase.h>
9#include <frc2/command/CommandHelper.h>
10
11#include <memory>
12
14
15class DriveToLocation : public frc2::CommandHelper<frc2::CommandBase, DriveToLocation> {
16 public:
18 const frc::Pose2d source,
19 const units::degree_t sourceAngle,
20 const frc::Pose2d destination,
21 const units::degree_t destAngle,
22 const frc::TrapezoidProfile<units::inches>::Constraints linearConstraints,
23 const frc::TrapezoidProfile<units::degrees>::Constraints rotationalConstraints);
24
25 void Initialize() override;
26
27 void Execute() override;
28
29 void End(bool interrupted) override;
30
31 bool IsFinished() override;
32
33 private:
35 const frc::Pose2d m_source;
36 const units::degree_t m_sourceAngle;
37 const frc::Pose2d m_destination;
38 const units::degree_t m_destAngle;
39 const frc::TrapezoidProfile<units::inches>::Constraints m_linearConstraints;
40 const frc::TrapezoidProfile<units::degrees>::Constraints m_rotationalConstraints;
41};
Definition: drive_to_location.h:15
void Execute() override
Definition: drive_to_location.cpp:34
const frc::Pose2d m_source
Definition: drive_to_location.h:35
void End(bool interrupted) override
Definition: drive_to_location.cpp:39
void Initialize() override
Definition: drive_to_location.cpp:27
const units::degree_t m_destAngle
Definition: drive_to_location.h:38
bool IsFinished() override
Definition: drive_to_location.cpp:44
const frc::TrapezoidProfile< units::inches >::Constraints m_linearConstraints
Definition: drive_to_location.h:39
SwerveDriveSubsystem * m_pDrive
Definition: drive_to_location.h:34
const frc::TrapezoidProfile< units::degrees >::Constraints m_rotationalConstraints
Definition: drive_to_location.h:40
const frc::Pose2d m_destination
Definition: drive_to_location.h:37
const units::degree_t m_sourceAngle
Definition: drive_to_location.h:36
Subsystem for controlling the swerve drivetrain of the robot.
Definition: swerve_drive_subsystem.h:50