I was just wondering if there was any reason not to call teleopPeriodic() in autonomousPeriodic() if both are going to be the same. Would there be any issues with FMS or otherwise?
You could try this by running a practice match through your dashboard, it may work.
A live match is a different matter though, and it may not work. Presumably for integrity and security reasons FMS internals are kept opaque, or simply not discussed.
There is nothing stopping you from moving all your code in teleopPeriodic() into a new method (say sharedPeriodic()) and calling that from autonomousPeriodic() and teleopPeriodic(). I can confirm this worked for teams in live matches.
Thanks, I had considered just this but was curious anyway. Thanks for the confirmation and response!
It’s perfectly fine to call teleopPeriodic() from autonomousPeriodic(). They’re just normal functions called by the robot main loop. This is exactly equivalent to the sharedPeriodic() approach suggested by the earlier post.
Thanks, it’s good to have confirmation that either way will work!
Note that if your teleopPeriodic() requires some initialization from teleopInit(), you should also call teleopInit() from autonomousInit(), and provide some code in teleopInit() which checks to see if things are already initialized.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.