|
Re: LabView corrupt?
At the top of teleop, there is a loop that runs forever. It has a 20 ms timeout in it, but it means teleop will not return to the framework and process the next teleop packet.
The Robot Code State instrumentation VI should just be on the diagram, not in a loop.
Speaking of which, the rest of teleop shouldn't be in a loop either. The template had a big green comment on the left explaining why it was important to return within 20ms. It has been deleted, but if you hover over the teleop icon, it still says it. You can also show the kids in RobotMain that teleop will be called each time the DS/FMS give you a teleop packet and the comments there about how it works.
If you see something that misled them into writing it this way, let me know and we'll try to improve the template. Feel free to post or have them post questions.
I second Alan's comment about the UDP read in periodic. Read is a blocking call anyway, no need to throttle the loop in parallel, especially when it can cause a backlog.
Other than that, I thought the code actually looked well written. The state machine in auto is nice, but it would typically use a shift register or a feedback node for the state variable.
Hope that clears everything up. Be sure to build and run as startup.
Greg McKaskle
|