Skip to content

Commit

Permalink
Merge pull request #21 from truher/main
Browse files Browse the repository at this point in the history
fix the build
  • Loading branch information
truher authored Jan 31, 2025
2 parents 961e376 + 2356538 commit bec549f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions comp/src/test/java/org/team100/frc2025/Timeless2024.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.team100.lib.util.Memo;
import org.team100.lib.util.Takt;

import edu.wpi.first.hal.HAL;
Expand All @@ -25,6 +26,8 @@ default void resumeTiming() {
default void stepTime(double t) {
SimHooks.stepTiming(t);
Takt.update();
Memo.resetAll();
Memo.updateAll();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public OptionalDouble getPositionRad() {
OptionalDouble velocityRad_S = m_mechanism.getVelocityRad_S();
if (velocityRad_S.isEmpty())
return OptionalDouble.empty();
System.out.println("velocity " + velocityRad_S);
m_positionRad += velocityRad_S.getAsDouble() * dtS;
m_positionRad = MathUtil.angleModulus(m_positionRad);
m_timeS = nowS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public SimulatedBareMotor(LoggerFactory parent, double freeSpeedRad_S) {

@Override
public void setDutyCycle(double dutyCycle) {
System.out.println("duty cycle " + dutyCycle);
final double output = MathUtil.clamp(
Util.notNaN(dutyCycle), -1, 1);
m_log_duty.log(() -> output);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void testPosition() {
assertEquals(0, fixture.drive.getState().x().x(), kDelta);

// half wave is 2 seconds
for (int i = 0; i < 100; ++i) {
for (int i = 0; i < 101; ++i) {
stepTime(0.02);
od.execute();
fixture.drive.periodic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void testPosition() {
assertEquals(0, fixture.drive.getState().x().x(), kDelta);

// half wave is 2 seconds
for (int i = 0; i < 100; ++i) {
for (int i = 0; i < 101; ++i) {
stepTime(0.02);
od.execute();
fixture.drive.periodic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void testPosition() {
assertEquals(0, fixture.drive.getState().x().x(), kDelta);

// half wave is 2 seconds
for (int i = 0; i < 100; ++i) {
for (int i = 0; i < 101; ++i) {
stepTime(0.02);
od.execute();
fixture.drive.periodic();
Expand Down
3 changes: 3 additions & 0 deletions lib/src/test/java/org/team100/lib/testing/Timeless.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.team100.lib.util.Memo;
import org.team100.lib.util.Takt;

import edu.wpi.first.hal.HAL;
Expand Down Expand Up @@ -29,6 +30,8 @@ default void resumeTiming() {
default void stepTime(double t) {
SimHooks.stepTiming(t);
Takt.update();
Memo.resetAll();
Memo.updateAll();
}

}

0 comments on commit bec549f

Please sign in to comment.