FRC WPILIB Periodic? (newbie programmy)

So if I am programming a robot and I am constantly setting things in different subsystems, checking for booleans, etc using periodic, is this taxing on the RIO? What are the risks of reducing the 2ms time for periodic? If it is bad, what is an efficient way to reduce taxing the RIO? If not, please explain to me.

Should I do something weird to only check for stuff at certain times if conditions are met?

Doing basic robot tasks, you’ll be hard-pressed to lag the rio. The periodic cycle runs at 20ms (50hz) cycles by default, which is plenty for most purposes, but some teams (including mine) run everything as fast as 200hz with no problems.

Unless you are trying to run a while loop inside periodic or something that’s standard bad practice along those lines, you’re probably fine. The RIO’s limitations only come in if you try doing vision processing, dynamic trajectory generation, or anything else more advanced onboard.

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.