Function of robotPeriodic()

If I understand the documentation within robot.java, this function is called periodically but after the autonomousPeriodic() or teleopPeriodic() functions are called and before any dashboard or LiveWindow updates.

I expect one of it’s intended purposes would be to flag changes - i.e., detect a button press from the joystick that can be acted upon in teleOp, Test or Auto.

Its main purpose was to be a function that is called every loop, regardless of mode. A lot of teams had code that wrote variables to the dashboard in both autonomousPeriodic and teleopPeriodic, and robotPeriodic was added to allow only writing that code in one place.

1 Like