-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ConcurrentModificationException in VirtualStickManager
when calling sendVirtualStickAdvancedParam
with Mini 3
#405
Comments
Agent comment from yating.liao in Zendesk ticket #115256: °°° |
@dji-dev Perhaps I explained poorly. I am not using the VirtualStickManager interface outside of the onSuccess callback. I am not referencing it directly. I am calling Executors.newSingleThreadScheduledExecutor().scheduleAtFixedRate({
try {
VirtualStickManager.getInstance().sendVirtualStickAdvancedParam(vsParam)
} catch (e: Exception) {
Log.e("Error", e.message)
}
}, 0, 50, TimeUnit.MILLISECONDS) The following exception is thrown intermittently when using sendVirtualStickAdvancedParam():
This issue happens in 2 out of 10 flights. Your help would be much appreciated in resolving this issue. Thank you |
VirtualStickManager
when calling sendVirtualStickAdvancedParam
with Mini 3
@dji-dev I would really appreciate your help on this issue when you have some time. Thanks |
Agent comment from yating.liao in Zendesk ticket #115256: I have reviewed your code, and it seems there might be a bug in the SDK. You could try using a Timer to implement sending virtual joystick commands at a fixed frequency. I will report this crash to the team. °°° |
Thank you very much @dji-dev ! I look forward to hearing if there is a solution or fix to come in the future. I have tried a |
Agent comment from yating.liao in Zendesk ticket #115256: °°° |
Yes, thank you this seems to be resolved now. We have not seen any crashes related to this since updating to 5.11 either. Thanks again! |
Agent comment from yating.liao in Zendesk ticket #115256: °°° |
Issue Summary
When controlling a Mini 3 with
sendVirtualStickAdvancedParam()
, aConcurrentModificationException
is randomly thrown. This might be due to the collection being modified in an unsafe way while it is being iterated over.Environment
Expected Behavior
sendVirtualStickAdvancedParam()
should safely send virtual stick parameters without causing a ConcurrentModificationException.Actual Behavior
The following exception is thrown randomly when using sendVirtualStickAdvancedParam():
Steps to Reproduce
Use the
sendVirtualStickAdvancedParam()
function on a DJI Mini 3.Monitor for ConcurrentModificationException during the execution of this method. Although note that it happens very randomly and intermittently.
Additional Notes
I noticed that there have been other issues related to ConcurrentModificationException reported and resolved in newer SDK versions. It is possible that the VirtualStickManager module might need to be adjusted to ensure better thread safety?
The text was updated successfully, but these errors were encountered: