2023-Robot
Robot code for 2023 FRC season by Argos, FRC team #1756
Loading...
Searching...
No Matches
drive_to_position_absolute.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#include <units/angle.h>
11#include <units/velocity.h>
12
13#include <memory>
14
16
17class DriveToPositionAbsolute : public frc2::CommandHelper<frc2::CommandBase, DriveToPositionAbsolute> {
18 public:
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 const units::feet_per_second_t initialVelocity = 0_fps,
25 const units::feet_per_second_t finalVelocity = 0_fps);
26
27 void Initialize() override;
28
29 void Execute() override;
30
31 void End(bool interrupted) override;
32
33 bool IsFinished() override;
34
35 private:
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 const units::feet_per_second_t m_initialVelocity;
42 const units::feet_per_second_t m_finalVelocity;
43};
Definition drive_to_position_absolute.h:17
const frc::TrapezoidProfile< units::inches >::Constraints m_linearConstraints
Definition drive_to_position_absolute.h:39
const frc::Pose2d m_destination
Definition drive_to_position_absolute.h:37
bool IsFinished() override
Definition drive_to_position_absolute.cpp:53
const units::feet_per_second_t m_finalVelocity
Definition drive_to_position_absolute.h:42
const frc::TrapezoidProfile< units::degrees >::Constraints m_rotationalConstraints
Definition drive_to_position_absolute.h:40
const units::degree_t m_destAngle
Definition drive_to_position_absolute.h:38
void Execute() override
Definition drive_to_position_absolute.cpp:41
void Initialize() override
Definition drive_to_position_absolute.cpp:28
const units::feet_per_second_t m_initialVelocity
Definition drive_to_position_absolute.h:41
SwerveDriveSubsystem * m_pDrive
Definition drive_to_position_absolute.h:36
void End(bool interrupted) override
Definition drive_to_position_absolute.cpp:46
Subsystem for controlling the swerve drivetrain of the robot.
Definition swerve_drive_subsystem.h:56