robototes / Crescendo2024

Other
8 stars 13 forks source link

Selected auto path keeps running after match starts #86

Closed jamesdooley4 closed 4 months ago

jamesdooley4 commented 4 months ago

@jbko6 - looking at the wpilog logs from E9 match at Glacier Peak, I noticed the "NT\Shuffleboard\Match\Selected auto\Robot" values keep cycling even after the match started. Can you see how to stop those once the robot is enabled, to save some CPU time and memory on the Rio?

KangarooKoala commented 4 months ago

Currently the selected auto value is updated via a call to addPeriodic(). The quickest way to fix it would probably be to make AutonomousField.update() return early if RobotBase/DriverStation.isEnabled() (which seems to be pretty cheap, just a mutex lock and some variable reads).

jbko6 commented 4 months ago

haha I was just looking at the code and came to the same conclusion

TAKBS2412 commented 4 months ago

Is @jbko6 the correct assignee, or should it be @KangarooKoala who implemented the selected auto preview earlier?

(Realistically, I think either one would do the same thing, but wondering about work distribution).