Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions vendordep/src/test/native/cpp/mechs/SwerveDriveTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ struct SwerveDriveTestFixture {
InitializeHardware();
SchedulerHelper::CancelAll();
m_simGyro = 0_deg;
// The motors are shared by every test, so stop them and point the wheels forward again rather
// than starting from wherever the last test left them.
for (auto* smc : {hw.flDriveSMC, hw.frDriveSMC, hw.blDriveSMC, hw.brDriveSMC, hw.flAzimuthSMC,
hw.frAzimuthSMC, hw.blAzimuthSMC, hw.brAzimuthSMC}) {
smc->SetDutyCycle(0.0);
if (auto* sim = smc->GetSimSupplier()) sim->SetMechanismVelocity(0_tps);
smc->SetEncoderPosition(0_tr);
}

auto makeModuleCfg = [](remote::TalonFXWrapper* drive, remote::TalonFXWrapper* azimuth,
wpi::units::meter_t front, wpi::units::meter_t left,
Expand Down
Loading