Skip to content

Conversation

@zachwaffle4
Copy link

Note that these are only used by PeriodicOpMode and not LinearOpMode, though internalRobotPeriodic is exposed so that users can manually call it in LinearOpMode or custom OpMode implementations if they need to.

@zachwaffle4 zachwaffle4 requested a review from a team as a code owner December 26, 2025 17:23
@github-actions github-actions bot added component: wpilibj WPILib Java 2027 2027 target labels Dec 26, 2025
*
* @param watchdog watchdog instance, typically passed in from the calling {@link PeriodicOpMode}.
*/
public final void internalRobotPeriodic(Watchdog watchdog) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I missed something while reading through chat history, but why make a separate internal method here instead of inlining it into PeriodicOpMode.loopFunc()?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure Peter has a better answer but we want to make it easy for other OpMode types (ie not just PeriodicOpMode) to be created by users if they want; for example, I will be using internalRobotPeriodic for CommandOpMode.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, but if we intend for users to call this method, why call it internal?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs to be distinguished from the robotPeriodic method that users can override in their OpModeRobot subclasses and I could not think of a better name.


m_watchdog.reset();
periodic();
m_watchdog.addEpoch("periodic()");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this intentional? C++ doesn't have this change.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it was not removed it was replaced with addEpoch("OpMode periodic") to clarify which periodic was running; I will change it for c++

@zachwaffle4
Copy link
Author

@PeterJohnson do we also want to bring back a robot-level disabledPeriodic? The design doc implies it should exist, but it does not, currently.

…isabledPeriodic and update NonePeriodic to call DisabledPeriodic by default
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.

2 participants