[commands] Add C++ Requirements struct (#5504)

This commit is contained in:
Joseph Eng
2023-09-17 20:48:39 -07:00
committed by GitHub
parent b265a68eea
commit 633c5a8a22
43 changed files with 273 additions and 1112 deletions

View File

@@ -8,7 +8,7 @@
CloseClaw::CloseClaw(Claw& claw) : m_claw(&claw) {
SetName("CloseClaw");
AddRequirements({m_claw});
AddRequirements(m_claw);
}
// Called just before this Command runs the first time

View File

@@ -9,7 +9,7 @@
OpenClaw::OpenClaw(Claw& claw)
: frc2::CommandHelper<frc2::WaitCommand, OpenClaw>(1_s), m_claw(&claw) {
SetName("OpenClaw");
AddRequirements({m_claw});
AddRequirements(m_claw);
}
// Called just before this Command runs the first time

View File

@@ -11,7 +11,7 @@
SetElevatorSetpoint::SetElevatorSetpoint(double setpoint, Elevator& elevator)
: m_setpoint(setpoint), m_elevator(&elevator) {
SetName("SetElevatorSetpoint");
AddRequirements({m_elevator});
AddRequirements(m_elevator);
}
// Called just before this Command runs the first time

View File

@@ -9,7 +9,7 @@
SetWristSetpoint::SetWristSetpoint(double setpoint, Wrist& wrist)
: m_setpoint(setpoint), m_wrist(&wrist) {
SetName("SetWristSetpoint");
AddRequirements({m_wrist});
AddRequirements(m_wrist);
}
// Called just before this Command runs the first time

View File

@@ -14,7 +14,7 @@ TankDrive::TankDrive(std::function<double()> left,
m_right(std::move(right)),
m_drivetrain(&drivetrain) {
SetName("TankDrive");
AddRequirements({m_drivetrain});
AddRequirements(m_drivetrain);
}
// Called repeatedly when this Command is scheduled to run