Skip to content

Commit

Permalink
[commands] Reset timer in quasistatic SysIdRoutine test (wpilibsuite#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchdukeTim authored Jan 28, 2024
1 parent 1016e95 commit ee15cc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public Command quasistatic(Direction direction) {
Timer timer = new Timer();
return m_mechanism
.m_subsystem
.runOnce(timer::start)
.runOnce(timer::restart)
.andThen(
m_mechanism.m_subsystem.run(
() -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@ frc2::CommandPtr SysIdRoutine::Quasistatic(Direction direction) {

double outputSign = direction == Direction::kForward ? 1.0 : -1.0;

return m_mechanism.m_subsystem
->RunOnce([this] {
timer.Reset();
timer.Start();
})
return m_mechanism.m_subsystem->RunOnce([this] { timer.Restart(); })
.AndThen(
m_mechanism.m_subsystem
->Run([this, state, outputSign] {
Expand Down

0 comments on commit ee15cc1

Please sign in to comment.