mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
[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.
This commit is contained in:
@@ -20,7 +20,7 @@ public class Robot extends TimedRobot {
|
||||
private final PWMSparkMax m_leftDrive = new PWMSparkMax(0);
|
||||
private final PWMSparkMax m_rightDrive = new PWMSparkMax(1);
|
||||
private final DifferentialDrive m_robotDrive =
|
||||
new DifferentialDrive(m_leftDrive::set, m_rightDrive::set);
|
||||
new DifferentialDrive(m_leftDrive::setDutyCycle, m_rightDrive::setDutyCycle);
|
||||
private final Gamepad m_controller = new Gamepad(0);
|
||||
private final Timer m_timer = new Timer();
|
||||
|
||||
@@ -46,7 +46,7 @@ public class Robot extends TimedRobot {
|
||||
public void autonomousPeriodic() {
|
||||
// Drive for 2 seconds
|
||||
if (m_timer.get() < 2.0) {
|
||||
// Drive forwards half speed, make sure to turn input squaring off
|
||||
// Drive forwards half velocity, make sure to turn input squaring off
|
||||
m_robotDrive.arcadeDrive(0.5, 0.0, false);
|
||||
} else {
|
||||
m_robotDrive.stopMotor(); // stop robot
|
||||
|
||||
Reference in New Issue
Block a user