Quote:
Originally Posted by Bradley Boxer
Our code this year (written in LabVIEW) runs really slow. Extremely slow. I have taken out all the refnums in teleop and in periodic tasks, but this did not seem to help. This would normally not be a problem, but we have several (4) PID loops update in teleop (running on CAN Talon SRX's), and if they are not updated every ~120ms they will tell the motor to stop spinning. Right now, teleop runs every ~100-200ms (measured with "Elapsed Times.vi"). This is a huge problem when we are shooting and need our two wheel motors to spin at exact and fast speeds. Although at this point in the season we aren't adding much code, the problem seems to be getting worse. It also may be worth noting that we are using the LabVIEW 2016 Vision Example to find the goal coordinates, although it is disabled with a global variable when not in use.
Does anyone have any fixes/ideas/suggestions/tips as to how to speed up our code?
Here is the link to Team 303's LabVIEW Robot Code if it helps anyone. Feel free to redistribute if you so please.
https://drive.google.com/file/d/0B9k...ew?usp=sharing
Thanks so much,
Bradley Boxer
Team 303 Programming
|
Okay so after doing a lot of clean up in the teleop in order to see what's going on, I noticed that there are some values that are being written in teleop to global variables but never read anywhere else. Is there any particular reason for doing that. another thing that you can do for your begin.vi is replacing the write global variable that you have going with a funcional global variable (FGV) since the only place your are needing all that information is in autonomous. Like everyone else has said though check your CPU usage and try to locate any logs that might be pertinent to this issue. The logs will answer several questions.