Files
allwpilib/wpilibcExamples/src/main/cpp/examples/RomiReference/cpp/commands/TurnTime.cpp
Tyler Veness 9bd9656871 [wpimath] Replace Speeds with Velocities (#8479)
I left "free speed" alone since that's the technical term for it. In
general, velocity is a vector quantity, and speed is a magnitude (i.e.,
a strictly positive value).

This PR also replaces the speed verbiage in MotorController with duty
cycle.

Fixes #8423.
2026-03-06 14:19:15 -08:00

25 lines
567 B
C++

// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
#include "commands/TurnTime.hpp"
void TurnTime::Initialize() {
m_timer.Start();
m_drive->ArcadeDrive(0, 0);
}
void TurnTime::Execute() {
m_drive->ArcadeDrive(0, m_velocity);
}
void TurnTime::End(bool interrupted) {
m_drive->ArcadeDrive(0, 0);
m_timer.Stop();
m_timer.Reset();
}
bool TurnTime::IsFinished() {
return m_timer.HasElapsed(m_duration);
}