Open tomtzook opened 2 years ago
Basically, in simulation mode we use most of the electronics the same. BUT because there is no real-world feedback, we must add some code which provides that. WPILib supplies a number of classes that are capable of doing the calculation necessary to simulate parts of the robot, but we must declare which to use and connect them all.
If you look at examples from WPILib (see links bellow), you'll notice how mixed the simulation and real robot codes are. This is a problem for 2 reasons:
Our integration for the most part needs to address those problems. However, some parts of the robot may need complete replacement, like HidInterface
. So that's a different thing, but should be simple thanks to the abstraction of FlashLib.
Our steps will be:
sourceSet
to make sure the simulation code isn't deployed on the robot.Take a look at some stuff:
Maybe make it into a project for the programming team.
It will be a good way to learn more about WPILib, about FlashLib and about code design.
@guyws @yaronkle
Currently, wpilib docs shows using the simulation while mixing real and simulated only code parts and using
if
checks (i.e.isReal
isSimulation
). This isn't really comfortable, so look for some way to separate (into classes or something).