|
Re: Labview / Simulation
Last year, I played with LabVIEW framework code to see what would be involved to run without a cRIO.
If you move or copy the Team code from the cRIO realtime target to the PC host, and open the host Robot Main.vi, it will actually run. There is no FPGA or FRCCommunications DLL, so there will be lots of runtime errors. Even at this level, it will allow you to do some unit testing. You can type input values into the panel controls, run the VI, and probe or observe the outputs. You can also write test harnesses, something like Robot Tests.vi, to call the VIs with different test vectors, record the results, and present a summary of the tests.
In order to get more code running, I made dirty changes to Start Communications.vi so that it would process the UDP info directly rather than sharing the FRCCommunications.dll code. This allowed for the DS to work with the hostPC code. Finally, I monkeyed with where the WPILib was stored on disk. I made it so that the hostPC implementation and a cRIO implementation were independent, and the correct one was used depending on which RobotMain was opened.
Next, I started changing the hostPC WPILib to chop out the FPGA and replace it with a set of virtual registers/properties that the other layers will access. You can also open the subVI and watch the values as the code runs on the PC.
What I didn't write was code that also runs on the PC to close the loop and implement the physics model. It would read from the output registers, calculate sensor values, and write to the sensor registers.
So, to summarize, there are a couple steps involved to smooth it out so that teams could use this. It is certainly possible to do, but not documented or easy to accomplish without some in-depth knowledge about the protocols and LV target mechanisms.
Perhaps it makes sense to hear some input on what would be most useful for simulation?
Greg McKaskle
|