Skip to content

[wpilib] make opmode periodic again#8652

Open
zachwaffle4 wants to merge 10 commits intowpilibsuite:2027from
zachwaffle4:new-opmodes
Open

[wpilib] make opmode periodic again#8652
zachwaffle4 wants to merge 10 commits intowpilibsuite:2027from
zachwaffle4:new-opmodes

Conversation

@zachwaffle4
Copy link

@zachwaffle4 zachwaffle4 commented Mar 4, 2026

this does some things including but probably not limited to

  1. remove periodic opmode and upgrade the interface to an abstract class
  2. make opmoderobot secretly be timedrobot and use the opmode periodics as timedrobot periodics that just get removed from the queue when the opmode is de-selected
  3. pull the callback priority queue from timedrobot to a new class called PeriodicPriorityQueue so that the APIs can be more consistent across classes

@PeterJohnson
Copy link
Member

Generally I like the approach.

  • Refactoring CallbackQueue is a good idea and can move to a separate PR
  • I like folding PeriodicOpMode into an OpMode base class
  • Let's not rename user-facing functions (e.g. changing end to stop) as part of this

@zachwaffle4 zachwaffle4 requested a review from PeterJohnson March 5, 2026 04:15
@zachwaffle4 zachwaffle4 force-pushed the new-opmodes branch 2 times, most recently from 10f3dc4 to d7bc0ac Compare March 5, 2026 06:14
# Conflicts:
#	wpilibc/src/main/native/cpp/framework/TimedRobot.cpp
#	wpilibc/src/main/native/cpp/opmode/PeriodicOpMode.cpp
#	wpilibc/src/main/native/include/wpi/framework/OpModeRobot.hpp
#	wpilibc/src/main/native/include/wpi/framework/TimedRobot.hpp
#	wpilibc/src/main/native/include/wpi/opmode/PeriodicOpMode.hpp
@zachwaffle4 zachwaffle4 marked this pull request as ready for review March 7, 2026 04:58
@zachwaffle4 zachwaffle4 requested review from a team as code owners March 7, 2026 04:58
@zachwaffle4 zachwaffle4 force-pushed the new-opmodes branch 3 times, most recently from 872a191 to 4fc8c56 Compare March 7, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants