VMX-PI Error Occurred

89 views
Skip to first unread message

sam

unread,
Sep 14, 2021, 6:19:48 AM9/14/21
to vmx-pi
Hello.
I keep getting errors while using VMX-PI.
Images 1, 2, and 3 below are the contents of the error that occurred while running VMX.
Currently I'm using a titan controller and I program in Java. 
The GradleRIO version is also the latest version as "2020.3.2.12".
There are a total of 4 questions. someone please help me. thank you.

캡처.PNG
캡처2.PNG
캡처3.PNG
Q1. Why am I getting an error on image?
This usually occurs between 5-10 minutes of turning on the VMX.
Q2. What is the solution?


Q3. What is the phenomenon that Shuffleboard.update() exceeds 20ms while running a VMX-PI program? (The program does not use Shuffleboard.

캡처4.png
Q4. What is the error in the image above and how to fix it?

Scott Libert

unread,
Sep 16, 2021, 1:17:56 AM9/16/21
to vmx-pi
Q1. Why am I getting an error on image?
This usually occurs between 5-10 minutes of turning on the VMX.
Q2. What is the solution?

Because the robot code is compiled using Java, and because Java is a virtual machine with "garbage collection" of memory, every 5-10 minutes Java will periodically create a "highest-priority" thread to collect now-unused memory. So when the java garbage collection thread runs periodically, it suspends lower-priority threads to ensure no software access Java-managed memory during garbage collection.  Basically, everything in the process is suspended while the garbage collection occurs.

Separately, the VMX-pi has several high priority threads which communicate between raspberry pi and VMX.  These threads have a sophisticated retry mechanism which retries transmission in case there is ever a glitch in communication.  

So the log you included shows that several communication attempts were retried.  The VMX software should recover gracefully after a retry, but it looks like you've found a bug which occurs when reading analog input values; the WPI Library throws an exception in this case, and since there's no try-catch handler around the code that gathers the analog input value, the unhandled exception causes the robot software to abort.

The solution:  we need to fix the issue with the analog input handler; we can hopefully have a fix for you early next week.

A workaround:  for now, you could add a try-catch handler around the code that reads the analog input values; that way, the robot program keeps running.  Once we have a fix for the issue, you could remove that exception handler.

Q3.  What is the phenomenon that Shuffleboard.update() exceeds 20ms while running a VMX-pi program?

The WPI Library's TimedRobot class (which I'm guessing you've used when creating your robot software) is designed to run one iteration each 20ms, and logs a warning if the execution in any one iteration takes more than 20ms.  It's only a warning, not an error.  If it occurs frequently, it suggests that some portions of your code are taking a long time to execute, and it might be an issue in your code.  If this message occurs very infrequently (e.g., every 5-10 minutes) it could be occurring because the Java garbage collection is occurring, as described above.  Again, this is not an error, and is typically used as a hit the robot code might require optimization.

Q4. What is the error in the image above and how to fix it?
I'm not sure what's causing this, and believe it's an internal debugging message (not an error) that can be ignored.  But we'll plan to investigate it, and if we find anything I can post our findings.

Scott Libert

unread,
Sep 20, 2021, 2:36:34 PM9/20/21
to vmx-pi
Hi Sam,

We have a new release of java software that addresses your issues from previous questions Q1 and Q2.

To begin using this new software, you'll need to updated your VSCode project's build.gradle file, as follows:

    id "com.kauailabs.first.GradleRIO" version "2020.3.2.14"

2020.3.2.14 is the newest version, which:
- Resolves an issue where reading an analog input during lengthy Java garbage collection can cause "Unclean Status" exception.
- Switches the Java garbage collector to the newer "Garbage First" (G1GC), which is more efficient and reduces any "stop-the-world" pauses occurring during garbage collection.  The maximum pause period is set to 25 milliseconds.

We've tested this for 24-hours, and did not experience any problems.  

Please give this a try; I believe it should resolve the issues you reported.

- scott

Message has been deleted

sam

unread,
Sep 26, 2021, 9:36:15 PM9/26/21
to vmx-pi
Hello.
Thank you for your help.
Fixed the error issue after updating the build.gradle file.

Q3. What is the phenomenon that Shuffleboard.update() exceeds 20ms while running a VMX-pi program?
Question 3 seems to have been resolved as well.
(The error has not occurred since the update.)

Thank you for your help.

Let me ask you one more question.
Can't a java Thread run over and over with the exact cycle?
Thread cycles randomly overrun.
ex) A thread that repeatedly rotates for 50ms suddenly overruns to 60ms and then repeats again for 50ms.
Does this also have to do with Java garbage collection?

Thank you.

2021년 9월 21일 화요일 오전 3시 36분 34초 UTC+9에 scott...@gmail.com님이 작성:
Reply all
Reply to author
Forward
0 new messages