diff --git a/Opencv/.cxx/Debug/p1g6s634/arm64-v8a/configure_fingerprint.bin b/Opencv/.cxx/Debug/p1g6s634/arm64-v8a/configure_fingerprint.bin
index 386866a1..b114844d 100644
--- a/Opencv/.cxx/Debug/p1g6s634/arm64-v8a/configure_fingerprint.bin
+++ b/Opencv/.cxx/Debug/p1g6s634/arm64-v8a/configure_fingerprint.bin
@@ -2,28 +2,28 @@ C/C++ Structured Logx
 v
 tC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\additional_project_files.txtC
 A
-?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint	��ƶ�3 ����3u
+?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint	����3 ����3u
 s
-qC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\android_gradle_build.json	��ƶ�3�
+qC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\android_gradle_build.json	����3�
  ����3z
 x
-vC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\android_gradle_build_mini.json	��ƶ�3� ����3g
+vC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\android_gradle_build_mini.json	����3� ����3g
 e
-cC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\build.ninja	��ƶ�3�� ����3k
+cC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\build.ninja	����3�� ����3k
 i
-gC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\build.ninja.txt	��ƶ�3p
+gC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\build.ninja.txt	����3p
 n
-lC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\build_file_index.txt	��ƶ�3
V ����3q
+lC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\build_file_index.txt	����3
V ����3q
 o
-mC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\compile_commands.json	��ƶ�3� ����3u
+mC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\compile_commands.json	����3� ����3u
 s
-qC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\compile_commands.json.bin	��ƶ�3	� ����3{
+qC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\compile_commands.json.bin	����3	� ����3{
 y
-wC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\metadata_generation_command.txt	��ƶ�3
+wC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\metadata_generation_command.txt	����3
 � ����3n
 l
-jC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\prefab_config.json	��ƶ�3
( ����3s
+jC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\prefab_config.json	����3
( ����3s
 q
-oC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\symbol_folder_index.txt	��ƶ�3
n ����3Z
+oC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\arm64-v8a\symbol_folder_index.txt	����3
n ����3Z
 X
-VC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\libcxx_helper\CMakeLists.txt	��ƶ�3
� �֝��3
\ No newline at end of file
+VC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\libcxx_helper\CMakeLists.txt	����3
� �֝��3
\ No newline at end of file
diff --git a/Opencv/.cxx/Debug/p1g6s634/armeabi-v7a/configure_fingerprint.bin b/Opencv/.cxx/Debug/p1g6s634/armeabi-v7a/configure_fingerprint.bin
index fac0a6b4..11cd9f78 100644
--- a/Opencv/.cxx/Debug/p1g6s634/armeabi-v7a/configure_fingerprint.bin
+++ b/Opencv/.cxx/Debug/p1g6s634/armeabi-v7a/configure_fingerprint.bin
@@ -2,28 +2,28 @@ C/C++ Structured Logz
 x
 vC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\additional_project_files.txtC
 A
-?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint	��ƶ�3 �ש��3w
+?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint	ċ���3 �ש��3w
 u
-sC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\android_gradle_build.json	��ƶ�3�
+sC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\android_gradle_build.json	ċ���3�
  �ש��3|
 z
-xC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\android_gradle_build_mini.json	��ƶ�3� �ש��3i
+xC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\android_gradle_build_mini.json	ċ���3� �ש��3i
 g
-eC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\build.ninja	��ƶ�3�� �֩��3m
+eC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\build.ninja	ċ���3�� �֩��3m
 k
-iC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\build.ninja.txt	��ƶ�3r
+iC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\build.ninja.txt	ċ���3r
 p
-nC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\build_file_index.txt	��ƶ�3
V �ש��3s
+nC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\build_file_index.txt	ċ���3
V �ש��3s
 q
-oC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\compile_commands.json	��ƶ�3� �֩��3w
+oC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\compile_commands.json	ċ���3� �֩��3w
 u
-sC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\compile_commands.json.bin	��ƶ�3	� �֩��3}
+sC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\compile_commands.json.bin	ċ���3	� �֩��3}
 {
-yC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\metadata_generation_command.txt	��ƶ�3
+yC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\metadata_generation_command.txt	ċ���3
 � �ש��3p
 n
-lC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\prefab_config.json	��ƶ�3
( �ש��3u
+lC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\prefab_config.json	ċ���3
( �ש��3u
 s
-qC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\symbol_folder_index.txt	��ƶ�3
p �ש��3Z
+qC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\armeabi-v7a\symbol_folder_index.txt	ċ���3
p �ש��3Z
 X
-VC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\libcxx_helper\CMakeLists.txt	��ƶ�3
� �֝��3
\ No newline at end of file
+VC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\libcxx_helper\CMakeLists.txt	ċ���3
� �֝��3
\ No newline at end of file
diff --git a/Opencv/.cxx/Debug/p1g6s634/x86/configure_fingerprint.bin b/Opencv/.cxx/Debug/p1g6s634/x86/configure_fingerprint.bin
index adb8f059..fcfc5aed 100644
--- a/Opencv/.cxx/Debug/p1g6s634/x86/configure_fingerprint.bin
+++ b/Opencv/.cxx/Debug/p1g6s634/x86/configure_fingerprint.bin
@@ -2,28 +2,28 @@ C/C++ Structured Logr
 p
 nC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\additional_project_files.txtC
 A
-?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint	��ƶ�3 ��ʛ�3o
+?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint	����3 ��ʛ�3o
 m
-kC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\android_gradle_build.json	��ƶ�3�
+kC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\android_gradle_build.json	����3�
  ��ʛ�3t
 r
-pC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\android_gradle_build_mini.json	��ƶ�3� ��ʛ�3a
+pC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\android_gradle_build_mini.json	����3� ��ʛ�3a
 _
-]C:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\build.ninja	��ƶ�3�� ��ʛ�3e
+]C:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\build.ninja	����3�� ��ʛ�3e
 c
-aC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\build.ninja.txt	��ƶ�3j
+aC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\build.ninja.txt	����3j
 h
-fC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\build_file_index.txt	��ƶ�3
V ��ʛ�3k
+fC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\build_file_index.txt	����3
V ��ʛ�3k
 i
-gC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\compile_commands.json	��ƶ�3� ��ʛ�3o
+gC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\compile_commands.json	����3� ��ʛ�3o
 m
-kC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\compile_commands.json.bin	��ƶ�3	� ��ʛ�3u
+kC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\compile_commands.json.bin	����3	� ��ʛ�3u
 s
-qC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\metadata_generation_command.txt	��ƶ�3
+qC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\metadata_generation_command.txt	����3
 � ��ʛ�3h
 f
-dC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\prefab_config.json	��ƶ�3
( ��ʛ�3m
+dC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\prefab_config.json	����3
( ��ʛ�3m
 k
-iC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\symbol_folder_index.txt	��ƶ�3
h ��ʛ�3Z
+iC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86\symbol_folder_index.txt	����3
h ��ʛ�3Z
 X
-VC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\libcxx_helper\CMakeLists.txt	��ƶ�3
� �֝��3
\ No newline at end of file
+VC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\libcxx_helper\CMakeLists.txt	����3
� �֝��3
\ No newline at end of file
diff --git a/Opencv/.cxx/Debug/p1g6s634/x86_64/configure_fingerprint.bin b/Opencv/.cxx/Debug/p1g6s634/x86_64/configure_fingerprint.bin
index 6526e76c..545bdf64 100644
--- a/Opencv/.cxx/Debug/p1g6s634/x86_64/configure_fingerprint.bin
+++ b/Opencv/.cxx/Debug/p1g6s634/x86_64/configure_fingerprint.bin
@@ -2,28 +2,28 @@ C/C++ Structured Logu
 s
 qC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\additional_project_files.txtC
 A
-?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint	��ƶ�3 �婜�3r
+?com.android.build.gradle.internal.cxx.io.EncodedFileFingerPrint	⎯��3 �婜�3r
 p
-nC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\android_gradle_build.json	��ƶ�3�
+nC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\android_gradle_build.json	⎯��3�
  �婜�3w
 u
-sC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\android_gradle_build_mini.json	��ƶ�3� �婜�3d
+sC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\android_gradle_build_mini.json	⎯��3� �婜�3d
 b
-`C:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\build.ninja	��ƶ�3�� �䩜�3h
+`C:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\build.ninja	⎯��3�� �䩜�3h
 f
-dC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\build.ninja.txt	��ƶ�3m
+dC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\build.ninja.txt	⎯��3m
 k
-iC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\build_file_index.txt	��ƶ�3
V �婜�3n
+iC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\build_file_index.txt	⎯��3
V �婜�3n
 l
-jC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\compile_commands.json	��ƶ�3� �䩜�3r
+jC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\compile_commands.json	⎯��3� �䩜�3r
 p
-nC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\compile_commands.json.bin	��ƶ�3	� �䩜�3x
+nC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\compile_commands.json.bin	⎯��3	� �䩜�3x
 v
-tC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\metadata_generation_command.txt	��ƶ�3
+tC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\metadata_generation_command.txt	⎯��3
 � �婜�3k
 i
-gC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\prefab_config.json	��ƶ�3
( �婜�3p
+gC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\prefab_config.json	⎯��3
( �婜�3p
 n
-lC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\symbol_folder_index.txt	��ƶ�3
k �婜�3Z
+lC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\.cxx\Debug\p1g6s634\x86_64\symbol_folder_index.txt	⎯��3
k �婜�3Z
 X
-VC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\libcxx_helper\CMakeLists.txt	��ƶ�3
� �֝��3
\ No newline at end of file
+VC:\Users\24171\OneDrive\Desktop\msdk\400apiqwq\ams\Opencv\libcxx_helper\CMakeLists.txt	⎯��3
� �֝��3
\ No newline at end of file
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/build_model.json b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/build_model.json
index 5c5feac2..bf8de94d 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/build_model.json
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/build_model.json
@@ -25,10 +25,7 @@
     "variantName": "debug",
     "isDebuggableEnabled": true,
     "validAbiList": [
-      "ARMEABI_V7A",
-      "ARM64_V8A",
-      "X86",
-      "X86_64"
+      "ARM64_V8A"
     ],
     "buildTargetSet": [
       "opencv_jni_shared"
@@ -135,6 +132,7 @@
         "rootBuildGradleFolder": "C:\\Users\\24171\\OneDrive\\Desktop\\msdk\\400apiqwq\\ams",
         "sdkFolder": "D:\\androidstudio\\sdk",
         "isBuildOnlyTargetAbiEnabled": true,
+        "ideBuildTargetAbi": "arm64-v8a,armeabi-v7a,armeabi",
         "isCmakeBuildCohabitationEnabled": false,
         "isPrefabEnabled": false
       },
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1130_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1130_timing.txt
index 74954b98..79e965a7 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1130_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1130_timing.txt
@@ -5,3 +5,6 @@ generate_cxx_metadata
   [gap of 41ms]
 generate_cxx_metadata completed in 149ms
 
+# C/C++ build system timings
+generate_cxx_metadata 18ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1354_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1354_timing.txt
index 82f406be..f9355f5c 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1354_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1354_timing.txt
@@ -4,3 +4,17 @@ generate_cxx_metadata
   [gap of 15ms]
 generate_cxx_metadata completed in 35ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 59ms]
+  create-invalidation-state 105ms
+  [gap of 37ms]
+  write-metadata-json-to-file 10ms
+generate_cxx_metadata completed in 211ms
+
+# C/C++ build system timings
+generate_cxx_metadata
+  create-invalidation-state 19ms
+  [gap of 18ms]
+generate_cxx_metadata completed in 40ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1384_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1384_timing.txt
index 56c80132..0adef113 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1384_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1384_timing.txt
@@ -4,3 +4,9 @@ generate_cxx_metadata
   [gap of 14ms]
 generate_cxx_metadata completed in 29ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  create-invalidation-state 12ms
+  [gap of 15ms]
+generate_cxx_metadata completed in 30ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1386_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1386_timing.txt
index 641d2b03..b8d44875 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1386_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1386_timing.txt
@@ -1,3 +1,6 @@
 # C/C++ build system timings
 generate_cxx_metadata 20ms
 
+# C/C++ build system timings
+generate_cxx_metadata 13ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1437_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1437_timing.txt
index a617a697..c2e6703a 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1437_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1437_timing.txt
@@ -1,3 +1,6 @@
 # C/C++ build system timings
 generate_cxx_metadata 21ms
 
+# C/C++ build system timings
+generate_cxx_metadata 15ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1866_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1866_timing.txt
index 87dbd27e..6e2c0543 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1866_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_1866_timing.txt
@@ -4,3 +4,6 @@ generate_cxx_metadata
   [gap of 14ms]
 generate_cxx_metadata completed in 32ms
 
+# C/C++ build system timings
+generate_cxx_metadata 13ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_219_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_219_timing.txt
index 7eb15ac8..53b29857 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_219_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_219_timing.txt
@@ -5,3 +5,11 @@ generate_cxx_metadata
   [gap of 31ms]
 generate_cxx_metadata completed in 97ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 21ms]
+  create-invalidation-state 84ms
+  [gap of 43ms]
+  write-metadata-json-to-file 15ms
+generate_cxx_metadata completed in 164ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_222_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_222_timing.txt
index f5c27adc..528b0e11 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_222_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_222_timing.txt
@@ -19,3 +19,18 @@ generate_cxx_metadata
   [gap of 28ms]
 generate_cxx_metadata completed in 67ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 18ms]
+  create-invalidation-state 58ms
+  [gap of 26ms]
+  write-metadata-json-to-file 10ms
+generate_cxx_metadata completed in 113ms
+
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 18ms]
+  create-invalidation-state 57ms
+  [gap of 39ms]
+generate_cxx_metadata completed in 114ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_223_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_223_timing.txt
index b47e0d85..8e5662e3 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_223_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_223_timing.txt
@@ -20,3 +20,17 @@ generate_cxx_metadata
   write-metadata-json-to-file 11ms
 generate_cxx_metadata completed in 102ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 19ms]
+  create-invalidation-state 63ms
+  [gap of 45ms]
+generate_cxx_metadata completed in 127ms
+
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 21ms]
+  create-invalidation-state 61ms
+  [gap of 37ms]
+generate_cxx_metadata completed in 119ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_224_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_224_timing.txt
index 5979d4f5..69796eb9 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_224_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_224_timing.txt
@@ -33,3 +33,11 @@ generate_cxx_metadata
   [gap of 27ms]
 generate_cxx_metadata completed in 75ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 24ms]
+  create-invalidation-state 60ms
+  [gap of 28ms]
+  write-metadata-json-to-file 12ms
+generate_cxx_metadata completed in 125ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_228_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_228_timing.txt
index d82e6b40..9b399324 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_228_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_228_timing.txt
@@ -12,3 +12,17 @@ generate_cxx_metadata
   [gap of 27ms]
 generate_cxx_metadata completed in 81ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 12ms]
+  create-invalidation-state 37ms
+  [gap of 31ms]
+generate_cxx_metadata completed in 80ms
+
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 17ms]
+  create-invalidation-state 44ms
+  [gap of 31ms]
+generate_cxx_metadata completed in 92ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_232_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_232_timing.txt
index 5cd13cce..1da33d54 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_232_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_232_timing.txt
@@ -21,3 +21,24 @@ generate_cxx_metadata
   [gap of 37ms]
 generate_cxx_metadata completed in 156ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 21ms]
+  create-invalidation-state 49ms
+  [gap of 34ms]
+generate_cxx_metadata completed in 104ms
+
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 14ms]
+  create-invalidation-state 44ms
+  [gap of 28ms]
+generate_cxx_metadata completed in 86ms
+
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 16ms]
+  create-invalidation-state 48ms
+  [gap of 37ms]
+generate_cxx_metadata completed in 101ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_233_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_233_timing.txt
index d8a6608a..d27fea17 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_233_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_233_timing.txt
@@ -20,3 +20,10 @@ generate_cxx_metadata
   [gap of 28ms]
 generate_cxx_metadata completed in 84ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 17ms]
+  create-invalidation-state 50ms
+  [gap of 44ms]
+generate_cxx_metadata completed in 111ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_427_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_427_timing.txt
index b0a121f4..84f9748c 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_427_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_427_timing.txt
@@ -1,3 +1,6 @@
 # C/C++ build system timings
 generate_cxx_metadata 29ms
 
+# C/C++ build system timings
+generate_cxx_metadata 27ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_477_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_477_timing.txt
index 7bebd1c7..d75f071b 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_477_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_477_timing.txt
@@ -1,3 +1,9 @@
 # C/C++ build system timings
 generate_cxx_metadata 27ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  create-invalidation-state 21ms
+  [gap of 29ms]
+generate_cxx_metadata completed in 54ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_487_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_487_timing.txt
index 72ba2799..0173b896 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_487_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_487_timing.txt
@@ -4,3 +4,9 @@ generate_cxx_metadata
   [gap of 13ms]
 generate_cxx_metadata completed in 24ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  create-invalidation-state 11ms
+  [gap of 14ms]
+generate_cxx_metadata completed in 28ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_961_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_961_timing.txt
index 63b73708..8c4548ea 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_961_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/generate_cxx_metadata_961_timing.txt
@@ -4,3 +4,6 @@ generate_cxx_metadata
   [gap of 28ms]
 generate_cxx_metadata completed in 54ms
 
+# C/C++ build system timings
+generate_cxx_metadata 19ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/metadata_generation_record.json b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/metadata_generation_record.json
index 406a7f61..27363b98 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/metadata_generation_record.json
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/arm64-v8a/metadata_generation_record.json
@@ -11,7 +11,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 967786548
+    "memoizedHashCode": 376961765
   },
   {
     "level_": 0,
@@ -25,7 +25,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 399304576
+    "memoizedHashCode": -191520207
   },
   {
     "level_": 0,
@@ -39,6 +39,6 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -985324270
+    "memoizedHashCode": -1576149053
   }
 ]
\ No newline at end of file
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_1354_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_1354_timing.txt
index a01da157..1d2507ef 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_1354_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_1354_timing.txt
@@ -1,3 +1,9 @@
 # C/C++ build system timings
 generate_cxx_metadata 17ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  create-invalidation-state 11ms
+  [gap of 11ms]
+generate_cxx_metadata completed in 27ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_222_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_222_timing.txt
index b0316126..dc8cb3ae 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_222_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_222_timing.txt
@@ -1,3 +1,6 @@
 # C/C++ build system timings
 generate_cxx_metadata 19ms
 
+# C/C++ build system timings
+generate_cxx_metadata 21ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_223_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_223_timing.txt
index d1d6deec..47bb158c 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_223_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_223_timing.txt
@@ -10,3 +10,9 @@ generate_cxx_metadata
   [gap of 14ms]
 generate_cxx_metadata completed in 31ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  create-invalidation-state 10ms
+  [gap of 16ms]
+generate_cxx_metadata completed in 29ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_227_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_227_timing.txt
index 641d2b03..8563ea73 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_227_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/generate_cxx_metadata_227_timing.txt
@@ -1,3 +1,12 @@
 # C/C++ build system timings
 generate_cxx_metadata 20ms
 
+# C/C++ build system timings
+generate_cxx_metadata 24ms
+
+# C/C++ build system timings
+generate_cxx_metadata
+  create-invalidation-state 10ms
+  [gap of 12ms]
+generate_cxx_metadata completed in 26ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/metadata_generation_record.json b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/metadata_generation_record.json
index cec9f007..b18e8c4f 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/metadata_generation_record.json
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/armeabi-v7a/metadata_generation_record.json
@@ -11,7 +11,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -1485904816
+    "memoizedHashCode": -1605359535
   },
   {
     "level_": 0,
@@ -25,7 +25,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 1481472412
+    "memoizedHashCode": 1362017693
   },
   {
     "level_": 0,
@@ -39,6 +39,6 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 127295664
+    "memoizedHashCode": 7840945
   }
 ]
\ No newline at end of file
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_1354_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_1354_timing.txt
index 6443fc50..0c841ec2 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_1354_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_1354_timing.txt
@@ -1,3 +1,6 @@
 # C/C++ build system timings
 generate_cxx_metadata 14ms
 
+# C/C++ build system timings
+generate_cxx_metadata 18ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_222_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_222_timing.txt
index b0316126..42b09bb9 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_222_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_222_timing.txt
@@ -1,3 +1,6 @@
 # C/C++ build system timings
 generate_cxx_metadata 19ms
 
+# C/C++ build system timings
+generate_cxx_metadata 18ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_223_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_223_timing.txt
index 8f829b5c..6bbdd417 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_223_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_223_timing.txt
@@ -7,3 +7,6 @@ generate_cxx_metadata
   [gap of 16ms]
 generate_cxx_metadata completed in 31ms
 
+# C/C++ build system timings
+generate_cxx_metadata 20ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_227_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_227_timing.txt
index 25e3adc5..949d11ab 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_227_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_227_timing.txt
@@ -1,3 +1,9 @@
 # C/C++ build system timings
 generate_cxx_metadata 26ms
 
+# C/C++ build system timings
+generate_cxx_metadata 19ms
+
+# C/C++ build system timings
+generate_cxx_metadata 22ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_231_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_231_timing.txt
index 5e2a36b0..9a997150 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_231_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_231_timing.txt
@@ -1,3 +1,9 @@
 # C/C++ build system timings
 generate_cxx_metadata 18ms
 
+# C/C++ build system timings
+generate_cxx_metadata 20ms
+
+# C/C++ build system timings
+generate_cxx_metadata 18ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_32_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_32_timing.txt
index a0ad098a..617c98f3 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_32_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/generate_cxx_metadata_32_timing.txt
@@ -46,3 +46,11 @@ generate_cxx_metadata
   write-metadata-json-to-file 17ms
 generate_cxx_metadata completed in 221ms
 
+# C/C++ build system timings
+generate_cxx_metadata
+  [gap of 42ms]
+  create-invalidation-state 104ms
+  [gap of 65ms]
+  write-metadata-json-to-file 20ms
+generate_cxx_metadata completed in 233ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/metadata_generation_record.json b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/metadata_generation_record.json
index 1b16e4b9..b55c6ba4 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/metadata_generation_record.json
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86/metadata_generation_record.json
@@ -11,7 +11,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 1702625976
+    "memoizedHashCode": 1583171257
   },
   {
     "level_": 0,
@@ -25,7 +25,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 1233117444
+    "memoizedHashCode": 1113662725
   },
   {
     "level_": 0,
@@ -39,6 +39,6 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -177698748
+    "memoizedHashCode": -297153467
   }
 ]
\ No newline at end of file
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_1354_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_1354_timing.txt
index edd333d6..ccf4bdf0 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_1354_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_1354_timing.txt
@@ -1,3 +1,6 @@
 # C/C++ build system timings
 generate_cxx_metadata 16ms
 
+# C/C++ build system timings
+generate_cxx_metadata 21ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_1612_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_1612_timing.txt
index edd333d6..fee0eb5e 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_1612_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_1612_timing.txt
@@ -1,3 +1,6 @@
 # C/C++ build system timings
 generate_cxx_metadata 16ms
 
+# C/C++ build system timings
+generate_cxx_metadata 16ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_223_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_223_timing.txt
index 67efcfd1..c4a0f65f 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_223_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_223_timing.txt
@@ -1,3 +1,9 @@
 # C/C++ build system timings
 generate_cxx_metadata 15ms
 
+# C/C++ build system timings
+generate_cxx_metadata 21ms
+
+# C/C++ build system timings
+generate_cxx_metadata 21ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_224_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_224_timing.txt
index 5e2a36b0..baaff49d 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_224_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_224_timing.txt
@@ -1,3 +1,6 @@
 # C/C++ build system timings
 generate_cxx_metadata 18ms
 
+# C/C++ build system timings
+generate_cxx_metadata 20ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_225_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_225_timing.txt
index 7db66159..e4c7f6ad 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_225_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_225_timing.txt
@@ -13,3 +13,6 @@ generate_cxx_metadata 19ms
 # C/C++ build system timings
 generate_cxx_metadata 15ms
 
+# C/C++ build system timings
+generate_cxx_metadata 18ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_226_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_226_timing.txt
index 4f4a399e..eb75d795 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_226_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_226_timing.txt
@@ -13,3 +13,6 @@ generate_cxx_metadata 15ms
 # C/C++ build system timings
 generate_cxx_metadata 14ms
 
+# C/C++ build system timings
+generate_cxx_metadata 15ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_229_timing.txt b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_229_timing.txt
index e6897288..cd872cfc 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_229_timing.txt
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/generate_cxx_metadata_229_timing.txt
@@ -4,3 +4,6 @@ generate_cxx_metadata 23ms
 # C/C++ build system timings
 generate_cxx_metadata 18ms
 
+# C/C++ build system timings
+generate_cxx_metadata 16ms
+
diff --git a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/metadata_generation_record.json b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/metadata_generation_record.json
index bbe01ee0..38b0f6a0 100644
--- a/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/metadata_generation_record.json
+++ b/Opencv/build/intermediates/cxx/Debug/p1g6s634/logs/x86_64/metadata_generation_record.json
@@ -11,7 +11,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 143760438
+    "memoizedHashCode": 24305719
   },
   {
     "level_": 0,
@@ -25,7 +25,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -1753781090
+    "memoizedHashCode": -1873235809
   },
   {
     "level_": 0,
@@ -39,6 +39,6 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 970676435
+    "memoizedHashCode": 851221716
   }
 ]
\ No newline at end of file
diff --git a/Opencv/build/intermediates/cxx/abi_configuration_4s4k1647.log b/Opencv/build/intermediates/cxx/abi_configuration_4s4k1647.log
index b3a8e383..3e4a1d89 100644
--- a/Opencv/build/intermediates/cxx/abi_configuration_4s4k1647.log
+++ b/Opencv/build/intermediates/cxx/abi_configuration_4s4k1647.log
@@ -11,6 +11,6 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -931797841
+    "memoizedHashCode": -1522622624
   }
 ]
\ No newline at end of file
diff --git a/Opencv/build/intermediates/cxx/create_cxx_tasks_1185_timing.txt b/Opencv/build/intermediates/cxx/create_cxx_tasks_1185_timing.txt
index c9e73295..42c3bf0f 100644
--- a/Opencv/build/intermediates/cxx/create_cxx_tasks_1185_timing.txt
+++ b/Opencv/build/intermediates/cxx/create_cxx_tasks_1185_timing.txt
@@ -12,3 +12,12 @@ create_cxx_tasks
   [gap of 17ms]
 create_cxx_tasks completed in 124ms
 
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    [gap of 43ms]
+    create-module-model 10ms
+    [gap of 34ms]
+  create-initial-cxx-model completed in 87ms
+create_cxx_tasks completed in 96ms
+
diff --git a/Opencv/build/intermediates/cxx/create_cxx_tasks_1271_timing.txt b/Opencv/build/intermediates/cxx/create_cxx_tasks_1271_timing.txt
index bdc96ccd..6f20d337 100644
--- a/Opencv/build/intermediates/cxx/create_cxx_tasks_1271_timing.txt
+++ b/Opencv/build/intermediates/cxx/create_cxx_tasks_1271_timing.txt
@@ -3,3 +3,8 @@ create_cxx_tasks
   create-initial-cxx-model 55ms
 create_cxx_tasks completed in 60ms
 
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model 61ms
+create_cxx_tasks completed in 68ms
+
diff --git a/Opencv/build/intermediates/cxx/create_cxx_tasks_302_timing.txt b/Opencv/build/intermediates/cxx/create_cxx_tasks_302_timing.txt
index 1160a2a7..75be5b5d 100644
--- a/Opencv/build/intermediates/cxx/create_cxx_tasks_302_timing.txt
+++ b/Opencv/build/intermediates/cxx/create_cxx_tasks_302_timing.txt
@@ -21,3 +21,48 @@ create_cxx_tasks
   [gap of 10ms]
 create_cxx_tasks completed in 111ms
 
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 13ms
+    [gap of 12ms]
+    create-ARMEABI_V7A-model 12ms
+    create-ARM64_V8A-model 11ms
+    create-X86-model 12ms
+    create-module-model 16ms
+    create-variant-model 11ms
+    create-ARMEABI_V7A-model 11ms
+    create-ARM64_V8A-model 11ms
+    create-X86-model 15ms
+    create-X86_64-model 11ms
+  create-initial-cxx-model completed in 156ms
+  [gap of 14ms]
+create_cxx_tasks completed in 170ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 19ms
+    create-variant-model 10ms
+    create-ARMEABI_V7A-model 12ms
+    create-ARM64_V8A-model 10ms
+    create-X86-model 14ms
+    create-X86_64-model 13ms
+    create-module-model 15ms
+    create-variant-model 14ms
+    create-ARMEABI_V7A-model 11ms
+    create-ARM64_V8A-model 11ms
+    create-X86-model 11ms
+    create-X86_64-model 10ms
+  create-initial-cxx-model completed in 160ms
+  [gap of 16ms]
+create_cxx_tasks completed in 176ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 12ms
+    [gap of 76ms]
+  create-initial-cxx-model completed in 88ms
+create_cxx_tasks completed in 95ms
+
diff --git a/Opencv/build/intermediates/cxx/create_cxx_tasks_321_timing.txt b/Opencv/build/intermediates/cxx/create_cxx_tasks_321_timing.txt
index 19008250..e6477da3 100644
--- a/Opencv/build/intermediates/cxx/create_cxx_tasks_321_timing.txt
+++ b/Opencv/build/intermediates/cxx/create_cxx_tasks_321_timing.txt
@@ -38,3 +38,18 @@ create_cxx_tasks
   create-initial-cxx-model 54ms
 create_cxx_tasks completed in 61ms
 
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 11ms
+    [gap of 17ms]
+    create-ARM64_V8A-model 10ms
+    [gap of 17ms]
+    create-module-model 12ms
+    create-ARMEABI_V7A-model 12ms
+    [gap of 10ms]
+    create-X86-model 11ms
+  create-initial-cxx-model completed in 117ms
+  [gap of 11ms]
+create_cxx_tasks completed in 128ms
+
diff --git a/Opencv/build/intermediates/cxx/create_cxx_tasks_32_timing.txt b/Opencv/build/intermediates/cxx/create_cxx_tasks_32_timing.txt
index 086c04ac..605c7bfa 100644
--- a/Opencv/build/intermediates/cxx/create_cxx_tasks_32_timing.txt
+++ b/Opencv/build/intermediates/cxx/create_cxx_tasks_32_timing.txt
@@ -1357,3 +1357,349 @@ create_cxx_tasks
   [gap of 48ms]
 create_cxx_tasks completed in 172ms
 
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 13ms
+    [gap of 28ms]
+    create-X86-model 10ms
+    create-X86_64-model 10ms
+    create-module-model 13ms
+    create-ARMEABI_V7A-model 10ms
+    create-X86-model 10ms
+  create-initial-cxx-model completed in 123ms
+  [gap of 47ms]
+create_cxx_tasks completed in 172ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 13ms
+    [gap of 29ms]
+    create-X86-model 10ms
+    create-module-model 10ms
+    [gap of 35ms]
+  create-initial-cxx-model completed in 106ms
+  [gap of 72ms]
+create_cxx_tasks completed in 178ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 15ms
+    [gap of 10ms]
+    create-ARMEABI_V7A-model 10ms
+    create-ARM64_V8A-model 12ms
+    create-X86-model 10ms
+    create-X86_64-model 10ms
+    create-module-model 13ms
+    [gap of 11ms]
+    create-ARMEABI_V7A-model 10ms
+    create-X86-model 11ms
+    create-X86_64-model 10ms
+  create-initial-cxx-model completed in 136ms
+  [gap of 11ms]
+create_cxx_tasks completed in 147ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 13ms
+    [gap of 44ms]
+    create-module-model 11ms
+    create-ARMEABI_V7A-model 10ms
+    [gap of 10ms]
+    create-X86-model 11ms
+    create-X86_64-model 12ms
+  create-initial-cxx-model completed in 122ms
+  [gap of 51ms]
+create_cxx_tasks completed in 173ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 11ms
+    [gap of 42ms]
+    create-module-model 13ms
+    [gap of 36ms]
+  create-initial-cxx-model completed in 102ms
+  [gap of 90ms]
+create_cxx_tasks completed in 192ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 14ms
+    [gap of 13ms]
+    create-ARMEABI_V7A-model 12ms
+    [gap of 17ms]
+    create-X86_64-model 12ms
+    create-module-model 16ms
+    create-variant-model 10ms
+    create-ARMEABI_V7A-model 10ms
+    [gap of 15ms]
+    create-X86_64-model 10ms
+  create-initial-cxx-model completed in 131ms
+  [gap of 13ms]
+create_cxx_tasks completed in 144ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 12ms
+    [gap of 31ms]
+    create-X86-model 11ms
+    [gap of 11ms]
+    create-module-model 10ms
+    [gap of 12ms]
+    create-ARMEABI_V7A-model 10ms
+    [gap of 25ms]
+  create-initial-cxx-model completed in 122ms
+  [gap of 51ms]
+create_cxx_tasks completed in 173ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 16ms
+    [gap of 17ms]
+    create-ARMEABI_V7A-model 11ms
+    create-ARM64_V8A-model 13ms
+    create-X86_64-model 11ms
+    create-module-model 13ms
+    [gap of 42ms]
+  create-initial-cxx-model completed in 133ms
+  [gap of 43ms]
+create_cxx_tasks completed in 176ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 10ms
+    create-variant-model 10ms
+    [gap of 73ms]
+  create-initial-cxx-model completed in 98ms
+  [gap of 36ms]
+create_cxx_tasks completed in 134ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 10ms
+    [gap of 56ms]
+    create-ARMEABI_V7A-model 10ms
+    [gap of 26ms]
+  create-initial-cxx-model completed in 102ms
+  [gap of 45ms]
+create_cxx_tasks completed in 147ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 12ms
+    [gap of 13ms]
+    create-ARMEABI_V7A-model 10ms
+    [gap of 16ms]
+    create-X86_64-model 12ms
+    create-module-model 13ms
+    [gap of 36ms]
+  create-initial-cxx-model completed in 113ms
+  [gap of 46ms]
+create_cxx_tasks completed in 160ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 12ms
+    [gap of 35ms]
+    create-module-model 11ms
+    [gap of 28ms]
+  create-initial-cxx-model completed in 86ms
+  [gap of 29ms]
+create_cxx_tasks completed in 115ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 11ms
+    [gap of 36ms]
+    create-module-model 10ms
+    [gap of 33ms]
+  create-initial-cxx-model completed in 90ms
+  [gap of 37ms]
+create_cxx_tasks completed in 127ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model 71ms
+create_cxx_tasks completed in 77ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model 66ms
+  [gap of 43ms]
+create_cxx_tasks completed in 110ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 11ms
+    [gap of 28ms]
+    create-X86-model 14ms
+    create-module-model 13ms
+    [gap of 24ms]
+    create-X86-model 12ms
+  create-initial-cxx-model completed in 120ms
+  [gap of 51ms]
+create_cxx_tasks completed in 172ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 15ms
+    [gap of 23ms]
+    create-ARM64_V8A-model 10ms
+    [gap of 10ms]
+    create-X86_64-model 12ms
+    create-module-model 14ms
+    [gap of 18ms]
+    create-ARM64_V8A-model 10ms
+    [gap of 10ms]
+    create-X86_64-model 10ms
+  create-initial-cxx-model completed in 135ms
+  [gap of 47ms]
+create_cxx_tasks completed in 182ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 12ms
+    [gap of 48ms]
+    create-module-model 15ms
+    [gap of 40ms]
+  create-initial-cxx-model completed in 115ms
+  [gap of 45ms]
+create_cxx_tasks completed in 161ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 12ms
+    [gap of 44ms]
+    create-module-model 12ms
+    [gap of 38ms]
+  create-initial-cxx-model completed in 106ms
+  [gap of 42ms]
+create_cxx_tasks completed in 149ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 15ms
+    create-variant-model 13ms
+    create-ARMEABI_V7A-model 10ms
+    create-ARM64_V8A-model 11ms
+    create-X86-model 11ms
+    create-X86_64-model 14ms
+    create-module-model 14ms
+    create-ARMEABI_V7A-model 11ms
+    [gap of 27ms]
+  create-initial-cxx-model completed in 141ms
+  [gap of 14ms]
+create_cxx_tasks completed in 155ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 13ms
+    create-variant-model 11ms
+    create-ARMEABI_V7A-model 10ms
+    [gap of 10ms]
+    create-X86-model 10ms
+    [gap of 10ms]
+    create-module-model 15ms
+    [gap of 10ms]
+    create-ARMEABI_V7A-model 13ms
+    [gap of 11ms]
+    create-X86-model 10ms
+    create-X86_64-model 11ms
+  create-initial-cxx-model completed in 139ms
+  [gap of 16ms]
+create_cxx_tasks completed in 155ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 12ms
+    [gap of 34ms]
+    create-X86-model 10ms
+    [gap of 10ms]
+    create-module-model 12ms
+    [gap of 26ms]
+    create-X86-model 10ms
+    [gap of 10ms]
+  create-initial-cxx-model completed in 124ms
+  [gap of 54ms]
+create_cxx_tasks completed in 180ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 11ms
+    [gap of 41ms]
+    create-module-model 12ms
+    [gap of 35ms]
+  create-initial-cxx-model completed in 99ms
+  [gap of 33ms]
+create_cxx_tasks completed in 133ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 14ms
+    [gap of 44ms]
+    create-module-model 13ms
+    [gap of 37ms]
+  create-initial-cxx-model completed in 108ms
+  [gap of 42ms]
+create_cxx_tasks completed in 151ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 13ms
+    [gap of 44ms]
+    create-module-model 11ms
+    [gap of 32ms]
+    create-X86_64-model 13ms
+  create-initial-cxx-model completed in 114ms
+  [gap of 40ms]
+create_cxx_tasks completed in 155ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 15ms
+    [gap of 13ms]
+    create-ARMEABI_V7A-model 11ms
+    create-ARM64_V8A-model 10ms
+    [gap of 11ms]
+    create-X86_64-model 12ms
+    create-module-model 15ms
+    [gap of 26ms]
+    create-X86-model 11ms
+    create-X86_64-model 10ms
+  create-initial-cxx-model completed in 139ms
+  [gap of 53ms]
+create_cxx_tasks completed in 192ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 10ms
+    [gap of 36ms]
+    create-module-model 10ms
+    [gap of 34ms]
+  create-initial-cxx-model completed in 90ms
+create_cxx_tasks completed in 99ms
+
diff --git a/Opencv/build/intermediates/cxx/create_cxx_tasks_443_timing.txt b/Opencv/build/intermediates/cxx/create_cxx_tasks_443_timing.txt
index 1b011f17..3d03c453 100644
--- a/Opencv/build/intermediates/cxx/create_cxx_tasks_443_timing.txt
+++ b/Opencv/build/intermediates/cxx/create_cxx_tasks_443_timing.txt
@@ -28,3 +28,31 @@ create_cxx_tasks
   [gap of 16ms]
 create_cxx_tasks completed in 116ms
 
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model 71ms
+  [gap of 10ms]
+create_cxx_tasks completed in 81ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 12ms
+    [gap of 36ms]
+    create-module-model 12ms
+    [gap of 33ms]
+  create-initial-cxx-model completed in 93ms
+create_cxx_tasks completed in 102ms
+
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model
+    create-module-model 10ms
+    create-variant-model 29ms
+    create-ARMEABI_V7A-model 13ms
+    create-ARM64_V8A-model 13ms
+    [gap of 57ms]
+  create-initial-cxx-model completed in 125ms
+  [gap of 10ms]
+create_cxx_tasks completed in 135ms
+
diff --git a/Opencv/build/intermediates/cxx/create_cxx_tasks_783_timing.txt b/Opencv/build/intermediates/cxx/create_cxx_tasks_783_timing.txt
index 8f5bcf9f..f70f6506 100644
--- a/Opencv/build/intermediates/cxx/create_cxx_tasks_783_timing.txt
+++ b/Opencv/build/intermediates/cxx/create_cxx_tasks_783_timing.txt
@@ -4,3 +4,8 @@ create_cxx_tasks
   [gap of 12ms]
 create_cxx_tasks completed in 81ms
 
+# C/C++ build system timings
+create_cxx_tasks
+  create-initial-cxx-model 69ms
+create_cxx_tasks completed in 77ms
+
diff --git a/Opencv/build/intermediates/cxx/ndk_locator_record_463t1h4l.log b/Opencv/build/intermediates/cxx/ndk_locator_record_463t1h4l.log
index 718f81c6..d0444e71 100644
--- a/Opencv/build/intermediates/cxx/ndk_locator_record_463t1h4l.log
+++ b/Opencv/build/intermediates/cxx/ndk_locator_record_463t1h4l.log
@@ -11,7 +11,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -89763223
+    "memoizedHashCode": -1730642888
   },
   {
     "level_": 0,
@@ -25,7 +25,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 702424880
+    "memoizedHashCode": -938454785
   },
   {
     "level_": 0,
@@ -39,7 +39,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 242680835
+    "memoizedHashCode": -1398198830
   },
   {
     "level_": 0,
@@ -53,7 +53,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -1025267153
+    "memoizedHashCode": 1628820478
   },
   {
     "level_": 0,
@@ -67,7 +67,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -456555122
+    "memoizedHashCode": -2097434787
   },
   {
     "level_": 0,
@@ -81,7 +81,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -91644864
+    "memoizedHashCode": -1732524529
   },
   {
     "level_": 0,
@@ -95,7 +95,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 215496370
+    "memoizedHashCode": -1425383295
   },
   {
     "level_": 0,
@@ -109,7 +109,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -342651350
+    "memoizedHashCode": -1983531015
   },
   {
     "level_": 0,
@@ -123,7 +123,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 326151403
+    "memoizedHashCode": -1314728262
   },
   {
     "level_": 0,
@@ -137,7 +137,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 1030612596
+    "memoizedHashCode": -610267069
   },
   {
     "level_": 0,
@@ -151,7 +151,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -1401540630
+    "memoizedHashCode": 1252547001
   },
   {
     "level_": 0,
@@ -165,7 +165,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -832828599
+    "memoizedHashCode": 1821259032
   },
   {
     "level_": 0,
@@ -179,7 +179,7 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": 72921464
+    "memoizedHashCode": -1567958201
   },
   {
     "level_": 2,
@@ -193,6 +193,6 @@
       "fieldsDescending": {}
     },
     "memoizedSize": -1,
-    "memoizedHashCode": -1770630388
+    "memoizedHashCode": 883457243
   }
 ]
\ No newline at end of file
diff --git a/app/build.gradle b/app/build.gradle
index 30cf79d6..b5eff94e 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -119,6 +119,12 @@ android {
         // 与其他库重复引用了，因此选其中一个即可
         pickFirst 'lib/arm64-v8a/libc++_shared.so'
         pickFirst 'lib/armeabi-v7a/libc++_shared.so'
+
+
+        pickFirst 'lib/x86/libc++_shared.so'
+        pickFirst 'lib/x86_64/libc++_shared.so'
+        pickFirst 'lib/armeabi-v7a/libc++_shared.so'
+        pickFirst 'lib/arm64-v8a/libc++_shared.so'
     }
 
     packagingOptions {
@@ -234,6 +240,11 @@ dependencies {
      //implementation 'com.quickbirdstudios:opencv-contrib:3.4.5'
     implementation project(path: ':android-sdk-v5-uxsdk')
 
+
+    //vlc拉流
+    implementation 'org.videolan.android:libvlc-all:3.6.0'
+
+
     //TTS
 
     implementation files('libs/AIKit.aar')
diff --git a/app/src/main/java/com/aros/apron/activity/ConfigActivity.kt b/app/src/main/java/com/aros/apron/activity/ConfigActivity.kt
index 5c2999c9..fd05ed82 100644
--- a/app/src/main/java/com/aros/apron/activity/ConfigActivity.kt
+++ b/app/src/main/java/com/aros/apron/activity/ConfigActivity.kt
@@ -127,6 +127,7 @@ class ConfigActivity : BaseActivity() {
         configBinding.rbBeidou.isChecked = PreferenceUtils.getInstance().satelliteSystem == 2
         configBinding.rbCameraCenter.isChecked = PreferenceUtils.getInstance().cameraLocationType ==1//中间
         configBinding.rbCameraRight.isChecked = PreferenceUtils.getInstance().cameraLocationType ==2//右边
+        configBinding.rbCameraNull.isChecked = PreferenceUtils.getInstance().cameraLocationType ==0//右边
         configBinding.btnConfig.setOnClickListener { config() }
 
 
@@ -233,7 +234,7 @@ class ConfigActivity : BaseActivity() {
             }
         }
 
-        if (!configBinding.rbCameraRight.isChecked && !configBinding.rbCameraCenter.isChecked) {
+        if (!configBinding.rbCameraRight.isChecked && !configBinding.rbCameraCenter.isChecked && !configBinding.rbCameraNull.isChecked) {
             ToastUtil.showToast("未配置主相机位置")
             return
         }
@@ -371,9 +372,12 @@ class ConfigActivity : BaseActivity() {
         }
         if (configBinding.rbCameraCenter.isChecked) {
             PreferenceUtils.getInstance().cameraLocationType = 1
-        } else {
+        } else if (configBinding.rbCameraRight.isChecked) {
             PreferenceUtils.getInstance().cameraLocationType = 2
+        } else if (configBinding.rbCameraNull.isChecked) {
+            PreferenceUtils.getInstance().cameraLocationType = 0
         }
+
         ToastUtil.showToast("配置已保存")
         Handler().postDelayed(Runnable {
             restartApp()
diff --git a/app/src/main/java/com/aros/apron/activity/MainActivity.kt b/app/src/main/java/com/aros/apron/activity/MainActivity.kt
index f72a12d8..87d8c752 100644
--- a/app/src/main/java/com/aros/apron/activity/MainActivity.kt
+++ b/app/src/main/java/com/aros/apron/activity/MainActivity.kt
@@ -1,4 +1,5 @@
 package com.aros.apron.activity
+
 import android.annotation.SuppressLint
 import android.graphics.Color
 import android.graphics.drawable.ColorDrawable
@@ -6,6 +7,7 @@ import android.os.Build
 import android.os.Bundle
 import android.os.Handler
 import android.os.Looper
+import android.util.Log
 import android.view.View
 import android.view.Window
 import android.view.WindowManager
@@ -34,16 +36,20 @@ import com.aros.apron.manager.LTEManager
 import com.aros.apron.manager.MediaManager
 import com.aros.apron.manager.MissionV3Manager
 import com.aros.apron.manager.OSDManager
-import com.aros.apron.manager.PayloadWidgetManager
 import com.aros.apron.manager.StickManager
 import com.aros.apron.manager.StreamManager
+import com.aros.apron.manager.VlcRtspManager
+import com.aros.apron.manager.VlcRtspManager.OnRtspCheckListener
 import com.aros.apron.manager.WirelessLinkManager
 import com.aros.apron.tools.AlternateArucoDetect
 import com.aros.apron.tools.ApronArucoDetect
+import com.aros.apron.tools.ApronArucoStatus
 import com.aros.apron.tools.DroneHelper
+import com.aros.apron.tools.DualCaptureHelper
 import com.aros.apron.tools.LogUtil
 import com.aros.apron.tools.MqttManager
 import com.aros.apron.tools.PreferenceUtils
+import com.aros.apron.tools.SimplePortScanner
 import com.dji.wpmzsdk.manager.WPMZManager
 import com.google.gson.Gson
 import dji.sdk.keyvalue.key.DJIKey
@@ -104,7 +110,6 @@ import io.reactivex.rxjava3.functions.Consumer
 import org.eclipse.paho.client.mqttv3.MqttException
 import org.greenrobot.eventbus.Subscribe
 import org.greenrobot.eventbus.ThreadMode
-import org.opencv.android.OpenCVLoader
 import org.opencv.objdetect.Dictionary
 import org.opencv.objdetect.Objdetect
 import java.util.concurrent.TimeUnit
@@ -142,6 +147,8 @@ open class MainActivity : BaseActivity() {
     private var gimbalAdjustDone: TextView? = null
     private var btn_test: Button? = null
     private var btn_test1: Button? = null
+    private var btn_test2: Button? = null
+    private var btn_test3: Button? = null
 
     private var gimbalFineTuneWidget: GimbalFineTuneWidget? = null
     private var lastDevicePosition = ComponentIndexType.UNKNOWN
@@ -174,29 +181,28 @@ open class MainActivity : BaseActivity() {
         }
 
 
-    private var cameraManager: ICameraStreamManager = MediaDataCenter.getInstance().cameraStreamManager
+    private var cameraManager: ICameraStreamManager =
+        MediaDataCenter.getInstance().cameraStreamManager
 
     private var startArucoType = 0  //1执行机库二维码识别  2执行备降点二维码识别
     private var dictionary: Dictionary? = null
     override fun useEventBus(): Boolean {
         return true
     }
+
     override fun onResume() {
         super.onResume()
 
-
-        while (!OpenCVLoader.initLocal()) {
-            LogUtil.log("qwq", "opencv 初始化失败，阻塞等待重试...")
-            try {
-                Thread.sleep(300) // 休眠 300ms 再试，防止 CPU 爆炸
-            } catch (e: InterruptedException) {
-                LogUtil.log("qwq", "初始化被中断，跳出循环")
-                break
-            }
-        }
-
-
-        LogUtil.log("qwq", "opencv 初始化完成，继续执行后续代码")
+//        while (!OpenCVLoader.initLocal()) {
+//            LogUtil.log("qwq", "opencv 初始化失败，阻塞等待重试...")
+//            try {
+//                Thread.sleep(300) // 休眠 300ms 再试，防止 CPU 爆炸
+//            } catch (e: InterruptedException) {
+//                LogUtil.log("qwq", "初始化被中断，跳出循环")
+//                break
+//            }
+//        }
+//        LogUtil.log("qwq", "opencv 初始化完成，继续执行后续代码")
 
         dictionary = Objdetect.getPredefinedDictionary(Objdetect.DICT_6X6_250)
 
@@ -228,14 +234,15 @@ open class MainActivity : BaseActivity() {
                     runOnUiThread { onCameraSourceUpdated(result.devicePosition, result.lensType) }
                 })
         )
-        compositeDisposable!!.add(ObservableInMemoryKeyedStore.getInstance()
-            .addObserver(UXKeys.create(GlobalPreferenceKeys.GIMBAL_ADJUST_CLICKED))
-            .observeOn(ui())
-            .subscribe { broadcastValues: BroadcastValues? ->
-                isGimableAdjustClicked(
-                    broadcastValues!!
-                )
-            })
+        compositeDisposable!!.add(
+            ObservableInMemoryKeyedStore.getInstance()
+                .addObserver(UXKeys.create(GlobalPreferenceKeys.GIMBAL_ADJUST_CLICKED))
+                .observeOn(ui())
+                .subscribe { broadcastValues: BroadcastValues? ->
+                    isGimableAdjustClicked(
+                        broadcastValues!!
+                    )
+                })
         ViewUtil.setKeepScreen(this, true)
     }
 
@@ -249,7 +256,7 @@ open class MainActivity : BaseActivity() {
     }
 
     //endregion
-    private  fun hideOtherPanels(widget: View?) {
+    private fun hideOtherPanels(widget: View?) {
         val panels = arrayOf<View>(
             simulatorControlWidget!!
         )
@@ -362,7 +369,7 @@ open class MainActivity : BaseActivity() {
         }
     }
 
-    private  fun updateViewVisibility(
+    private fun updateViewVisibility(
         devicePosition: ComponentIndexType,
         lensType: CameraLensType
     ) {
@@ -401,7 +408,7 @@ open class MainActivity : BaseActivity() {
     /**
      * Swap the video sources of the FPV and secondary FPV widgets.
      */
-    private  fun swapVideoSource() {
+    private fun swapVideoSource() {
         val primarySource = primaryFpvWidget!!.widgetModel.getCameraIndex()
         val secondarySource = secondaryFPVWidget!!.widgetModel.getCameraIndex()
         //两个source都存在的情况下才进行切换
@@ -421,6 +428,7 @@ open class MainActivity : BaseActivity() {
         val devicePosition: ComponentIndexType,
         val lensType: CameraLensType
     )
+
     override fun onBackPressed() {
         if (mDrawerLayout!!.isDrawerOpen(GravityCompat.END)) {
             mDrawerLayout!!.closeDrawers()
@@ -455,42 +463,53 @@ open class MainActivity : BaseActivity() {
         initDJIManager()
         initCameraStream()
         initView()
+
+
     }
 
     private fun initView() {
-        fpvParentView = findViewById( R.id.fpv_holder)
-        mDrawerLayout = findViewById( R.id.root_view)
-        topBarPanel = findViewById( R.id.panel_top_bar)
+        fpvParentView = findViewById(R.id.fpv_holder)
+        mDrawerLayout = findViewById(R.id.root_view)
+        topBarPanel = findViewById(R.id.panel_top_bar)
         settingWidget = topBarPanel?.settingWidget
-        primaryFpvWidget = findViewById( R.id.widget_primary_fpv)
-        fpvInteractionWidget = findViewById( R.id.widget_fpv_interaction)
-        secondaryFPVWidget = findViewById( R.id.widget_secondary_fpv)
-        systemStatusListPanelWidget = findViewById( R.id.widget_panel_system_status_list)
-        simulatorControlWidget = findViewById( R.id.widget_simulator_control)
-        lensControlWidget = findViewById<LensControlWidget>( R.id.widget_lens_control)
-        ndviCameraPanel = findViewById( R.id.panel_ndvi_camera)
-        visualCameraPanel = findViewById( R.id.panel_visual_camera)
-        autoExposureLockWidget = findViewById( R.id.widget_auto_exposure_lock)
-        focusModeWidget = findViewById( R.id.widget_focus_mode)
-        focusExposureSwitchWidget = findViewById( R.id.widget_focus_exposure_switch)
-        pfvFlightDisplayWidget = findViewById( R.id.widget_fpv_flight_display_widget)
-        focalZoomWidget = findViewById( R.id.widget_focal_zoom)
-        cameraControlsWidget = findViewById( R.id.widget_camera_controls)
+        primaryFpvWidget = findViewById(R.id.widget_primary_fpv)
+        fpvInteractionWidget = findViewById(R.id.widget_fpv_interaction)
+        secondaryFPVWidget = findViewById(R.id.widget_secondary_fpv)
+        systemStatusListPanelWidget = findViewById(R.id.widget_panel_system_status_list)
+        simulatorControlWidget = findViewById(R.id.widget_simulator_control)
+        lensControlWidget = findViewById<LensControlWidget>(R.id.widget_lens_control)
+        ndviCameraPanel = findViewById(R.id.panel_ndvi_camera)
+        visualCameraPanel = findViewById(R.id.panel_visual_camera)
+        autoExposureLockWidget = findViewById(R.id.widget_auto_exposure_lock)
+        focusModeWidget = findViewById(R.id.widget_focus_mode)
+        focusExposureSwitchWidget = findViewById(R.id.widget_focus_exposure_switch)
+        pfvFlightDisplayWidget = findViewById(R.id.widget_fpv_flight_display_widget)
+        focalZoomWidget = findViewById(R.id.widget_focal_zoom)
+        cameraControlsWidget = findViewById(R.id.widget_camera_controls)
         horizontalSituationIndicatorWidget =
             findViewById(R.id.widget_horizontal_situation_indicator)
 //        gimbalAdjustDone = findViewById<TextView>( R.id.fpv_gimbal_ok_btn)
-        gimbalFineTuneWidget = findViewById( R.id.setting_menu_gimbal_fine_tune)
-        btn_test = findViewById( R.id.btn_test)
-        btn_test1 = findViewById( R.id.btn_test1)
+        gimbalFineTuneWidget = findViewById(R.id.setting_menu_gimbal_fine_tune)
+        btn_test = findViewById(R.id.btn_test)
+        btn_test1 = findViewById(R.id.btn_test1)
+        btn_test2 = findViewById(R.id.btn_test2)
+        btn_test3 = findViewById(R.id.btn_test3)
         btn_test?.setOnClickListener {
-//            MissionManager.getInstance().test()
-            FlightManager.getInstance().startPropellerRotation(null)
+            DualCaptureHelper.getInstance().captureNextFrame()
+
         }
         btn_test1?.setOnClickListener {
-            FlightManager.getInstance().stopPropellerRotation(null)
+            SimplePortScanner.getInstance().stopScan()
+
         }
+        btn_test2?.setOnClickListener {
+            StreamManager.getInstance().stopstream()
 
+        }
+        btn_test3?.setOnClickListener {
+            StreamManager.getInstance().startstream()
 
+        }
 
 
         initClickListener()
@@ -519,11 +538,9 @@ open class MainActivity : BaseActivity() {
         DJINetworkManager.getInstance().addNetworkStatusListener(networkStatusListener)
 
 
-
-
     }
 
-    private  fun isGimableAdjustClicked(broadcastValues: BroadcastValues) {
+    private fun isGimableAdjustClicked(broadcastValues: BroadcastValues) {
         if (mDrawerLayout!!.isDrawerOpen(GravityCompat.END)) {
             mDrawerLayout!!.closeDrawers()
         }
@@ -533,7 +550,7 @@ open class MainActivity : BaseActivity() {
         }
     }
 
-    private  fun initClickListener() {
+    private fun initClickListener() {
         secondaryFPVWidget!!.setOnClickListener { v: View? -> swapVideoSource() }
         if (settingWidget != null) {
             settingWidget!!.setOnClickListener { v: View? -> toggleRightDrawer() }
@@ -552,12 +569,13 @@ open class MainActivity : BaseActivity() {
 //        }
     }
 
-    private  fun toggleRightDrawer() {
+    private fun toggleRightDrawer() {
         mDrawerLayout!!.openDrawer(GravityCompat.END)
     }
 
 
     override fun onDestroy() {
+
         super.onDestroy()
         isAppStarted = false
         try {
@@ -575,25 +593,21 @@ open class MainActivity : BaseActivity() {
     }
 
     private val handler: Handler = Handler(Looper.getMainLooper())
-    private var initTimes=0
+    private var initTimes = 0
 
     private fun initDJIManager() {
-        //如果没有云台修改这里
-        // 初始化 OpenCV
-        
         val isFlightControllerConnect =
             KeyManager.getInstance().getValue(DJIKey.create(FlightControllerKey.KeyConnection))
 //        val isCameraConnect =
 //            KeyManager.getInstance().getValue(KeyTools.createKey(CameraKey.KeyConnection, ComponentIndexType.PORT_1))
-      //  LogUtil.log(TAG,isCameraConnect.toString())
-        if ((isFlightControllerConnect == null || !isFlightControllerConnect)) {
+        //  LogUtil.log(TAG,isCameraConnect.toString())
+        if (isFlightControllerConnect == null || !isFlightControllerConnect) {
             handler.postDelayed({
                 initDJIManager()
-            }, 1000)
+            }, 8000)
         } else {
             initTimes++
             LogUtil.log(TAG, "初始化$initTimes")
-            MissionV3Manager.getInstance().initMissionManager()
             FlightManager.getInstance().initFlightInfo()
             BatteryManager.getInstance().initBatteryInfo()
             StickManager.getInstance().initStickInfo()
@@ -605,26 +619,29 @@ open class MainActivity : BaseActivity() {
             StreamManager.getInstance().initStreamManager()
             LEDsSettingsManager.getInstance().initLEDsInfo()
             //负载
-            PayloadWidgetManager.getInstance().initPayloadInfo()
+            //PayloadWidgetManager.getInstance().initPayloadInfo()
             //初始化上报
             LTEManager.getInstance().initLTEInfo()
             WirelessLinkManager.getInstance().initWirelessLink()
             CameraManager.getInstance().initCameraInfo()
 
+            MissionV3Manager.getInstance().initMissionManager()
 
             MediaDataCenter.getInstance().cameraStreamManager.setVisionAssistViewDirection(
-                VisionAssistDirection.DOWN,object:CommonCallbacks.CompletionCallback{
+                VisionAssistDirection.DOWN, object : CommonCallbacks.CompletionCallback {
                     override fun onSuccess() {
-                        LogUtil.log(TAG,"开启成功")
+                        LogUtil.log(TAG, "开启成功")
                     }
 
                     override fun onFailure(p0: IDJIError) {
-                        LogUtil.log(TAG,"开启失败"+p0)
+                        LogUtil.log(TAG, "开启失败" + p0)
                     }
                 })
 
             val leDsSettings = LEDsSettings()
             leDsSettings.setNavigationLEDsOn(false)
+            leDsSettings.setStatusIndicatorLEDsOn(true)
+            leDsSettings.setFrontLEDsOn(true)
             KeyManager.getInstance().setValue<LEDsSettings?>(
                 KeyTools.createKey<LEDsSettings?>(FlightControllerKey.KeyLEDsSettings),
                 leDsSettings,
@@ -638,56 +655,99 @@ open class MainActivity : BaseActivity() {
                     }
                 })
 
+            LogUtil.log(TAG, "自定义推流方式:" + PreferenceUtils.getInstance().customStreamType)
 
-            LogUtil.log(TAG,"自定义推流方式:"+PreferenceUtils.getInstance().customStreamType)
-            Handler().postDelayed(Runnable {
-                    if (PreferenceUtils.getInstance().customStreamType==1){
-                        StreamManager.getInstance()
-                            .startLiveWithRTSP()
-                    }else if (PreferenceUtils.getInstance().customStreamType==2){
-                        StreamManager.getInstance()
-                            .startLiveWithCustom()
-                    }else {
-                        StreamManager.getInstance()
-                            .startLiveWithCustom()
-                    }
 
-                }, 5000)
-            LogUtil.log(TAG,"推流类型:"+PreferenceUtils.getInstance().customStreamType)
+            val scanner = SimplePortScanner.getInstance()
+
+
+            scanner.setOnPortCheckListener(object : SimplePortScanner.OnPortCheckListener {
+                override fun onPortOpen() {
+                    //LogUtil.log("qwq","✅ 本地8554端口已开启（每3秒扫描）")
+                }
+                override fun onPortClosed() {
+                    LogUtil.log("qwq","❌ 本地8554端口已关闭（每3秒扫描）")
+                    //重新开启这个rtp
+                    StreamManager.getInstance().startLiveWithRTSP();
+                }
+            })
+
+
+
+            Handler(Looper.getMainLooper()).postDelayed({
+                when (PreferenceUtils.getInstance().customStreamType) {
+                    1 -> StreamManager.getInstance().startLiveWithRTSP()
+                    2 -> StreamManager.getInstance().startLiveWithCustom()
+                    else -> StreamManager.getInstance().startLiveWithCustom()
+                }
+            }, 5000)  // 参数别改：5秒延迟确保相机就绪
+
+
+
+
+            LogUtil.log(TAG, "推流类型:" + PreferenceUtils.getInstance().customStreamType)
         }
     }
 
 
-
     @SuppressLint("SuspiciousIndentation")
     private fun initCameraStream() {
-
         cameraManager.addFrameListener(
             ComponentIndexType.FPV,
             ICameraStreamManager.FrameFormat.YUV420_888
         ) { frameData, _, _, width, height, _ ->
-            Movement.getInstance().isVtx=true
+            Movement.getInstance().isVtx = true
             //检测到图传
-            streamReceive=true
+            streamReceive = true
+            DualCaptureHelper.getInstance().onFrame(height, width, frameData)
 //            if (shouldExecute) {
-                if (startArucoType == 1) {
-                    ApronArucoDetect.getInstance()?.detectArucoTags(
-                        height,
-                        width,
-                        frameData,
-                        dictionary
-                    )
-                } else if (startArucoType == 2) {
-                    AlternateArucoDetect.getInstance()?.detectArucoTags(
-                        height,
-                        width,
-                        frameData,
-                        dictionary
-                    )
-                }
-//            }
-//            shouldExecute = !shouldExecute
+            if (startArucoType == 1&& ApronArucoStatus.getInstance().canProcess(ApronArucoStatus.CameraSource.DOWNWARD)) {
+                ApronArucoDetect.getInstance()?.detectArucoTags(
+                    height,
+                    width,
+                    frameData,
+                    dictionary
+                )
+            } else if (startArucoType == 2) {
+                AlternateArucoDetect.getInstance()?.detectArucoTags(
+                    height,
+                    width,
+                    frameData,
+                    dictionary
+                )
+            }
         }
+
+        //云台
+        cameraManager.addFrameListener(
+            ComponentIndexType.PORT_1,
+            ICameraStreamManager.FrameFormat.YUV420_888
+        ) { frameData, _, _, width, height, _ ->
+            Movement.getInstance().isVtx = true
+            //检测到图传
+            streamReceive = true
+            DualCaptureHelper.getInstance().onFrame(height, width, frameData)
+//            if (shouldExecute) {
+            if (startArucoType == 1&&ApronArucoStatus.getInstance().canProcess(ApronArucoStatus.CameraSource.GIMBAL)) {
+                ApronArucoDetect.getInstance()?.detectArucoTags(
+                    height,
+                    width,
+                    frameData,
+                    dictionary
+                )
+            } else if (startArucoType == 2) {
+                AlternateArucoDetect.getInstance()?.detectArucoTags(
+                    height,
+                    width,
+                    frameData,
+                    dictionary
+                )
+            }
+        }
+
+
+
+
     }
 
 //    private val mLoaderCallback: BaseLoaderCallback = object : BaseLoaderCallback(this) {
@@ -738,7 +798,7 @@ open class MainActivity : BaseActivity() {
                             ApronArucoDetect.getInstance().setDetectedBigMarkers()
                             DroneHelper.getInstance().setGimbalPitchDegree()
                             //每次触发识别二维码时，为避免获取控制权失败,使多次获取控制权
-                            DroneHelper.getInstance().isVirtualStickEnable=false
+                            DroneHelper.getInstance().isVirtualStickEnable = false
                             DroneHelper.getInstance().setVerticalModeToVelocity()
                         }
                     })
@@ -777,7 +837,7 @@ open class MainActivity : BaseActivity() {
                             )
                             DroneHelper.getInstance().setGimbalPitchDegree()
                             //每次触发识别二维码时，为避免获取控制权失败,使多次获取控制权
-                            DroneHelper.getInstance().isVirtualStickEnable=false
+                            DroneHelper.getInstance().isVirtualStickEnable = false
                             DroneHelper.getInstance().setVerticalModeToVelocity()
                         }
                     })
@@ -805,8 +865,6 @@ open class MainActivity : BaseActivity() {
     }
 
 
-
-
     private fun setViewVisibilityWithCleanMode() {
         if (PreferenceUtils.getInstance().isCleanMode) {
             fpvInteractionWidget?.visibility = View.GONE
diff --git a/app/src/main/java/com/aros/apron/callback/MqttCallBack.java b/app/src/main/java/com/aros/apron/callback/MqttCallBack.java
index 07c358ae..a9a2ace4 100644
--- a/app/src/main/java/com/aros/apron/callback/MqttCallBack.java
+++ b/app/src/main/java/com/aros/apron/callback/MqttCallBack.java
@@ -15,6 +15,7 @@ import com.aros.apron.entity.ApronExecutionStatus;
 import com.aros.apron.entity.MessageDown;
 import com.aros.apron.entity.Movement;
 import com.aros.apron.entity.SpeakerAudioPlayProgress;
+import com.aros.apron.entity.Synchronizedstatus;
 import com.aros.apron.manager.CameraManager;
 import com.aros.apron.manager.FlightManager;
 import com.aros.apron.manager.FlyToPointManager;
@@ -50,7 +51,7 @@ import dji.v5.manager.KeyManager;
 public class MqttCallBack extends BaseManager implements MqttCallbackExtended  {
 
     private String TAG = "MqttCallBack";
-
+    Object lock = Synchronizedstatus.LOCK_OBJ;
 
     @Override
     public void connectionLost(Throwable cause) {
@@ -154,16 +155,28 @@ public class MqttCallBack extends BaseManager implements MqttCallbackExtended  {
                     CameraManager.getInstance().setCameraVideoStreamSource(message);
                     break;
                 case Constant.FLIGHTTASK_EXECUTE:
-                    LogUtil.log(TAG, "收到：航线" + jsonString);
-                    //关闭避障
-                    PerceptionManager.getInstance().setPerceptionEnable(false);
-                    PerceptionManager.getInstance().setObstacleAvoidanceHorizontalEnabled(false);
-                    //设置modecode
-                    Movement.getInstance().setMode_code(1);
-                    sendFlightTaskProgress2Server();
-                    //设置标志为
-                    Movement.getInstance().setFlightmode(1);
-                    MissionV3Manager.getInstance().taskExecute(message);
+                    synchronized(lock){
+                        if(!Synchronizedstatus.getFlighttaskExecuteStatus()){
+                            Synchronizedstatus.setFlighttaskExecuteStatus(true);
+
+                            LogUtil.log(TAG, "收到：航线" + jsonString);
+                            //关闭避障
+                            PerceptionManager.getInstance().setPerceptionEnable(false);
+                            LogUtil.log(TAG,"关闭避障");
+                            PerceptionManager.getInstance().setObstacleAvoidanceHorizontalEnabled(false);
+                            //设置modecode
+                            Movement.getInstance().setMode_code(1);
+                            //设置标志为
+                            Movement.getInstance().setFlightmode(1);
+                            //回复
+                            sendMsg2Server(message);
+                            MissionV3Manager.getInstance().taskExecute(message);
+                        }else{
+                            //直接回复
+                            sendMsg2Server(message);
+                            return;
+                        }
+                    }
                     break;
                 case Constant.FLIGHTTASK_PAUSE:
                     LogUtil.log(TAG, "收到：航线暂停" + jsonString);
@@ -178,8 +191,9 @@ public class MqttCallBack extends BaseManager implements MqttCallbackExtended  {
                     LogUtil.log(TAG, "收到：返航" + jsonString);
                     //自动返航 (如果调用方法失败了 这个设置就有一个问题但是为了方便看懂我就放这里了没放成功的回调里面)
                     Movement.getInstance().setMode_code(9);
-                    sendFlightTaskProgress2Server();
-                    FlightManager.getInstance().startGoHome(message);
+                    if(!Movement.getInstance().isAlternate()){
+                        FlightManager.getInstance().startGoHome(message);
+                    }
                     break;
                 case Constant.INBOUND:
                     LogUtil.log(TAG, "收到：服务端响应入库" + jsonString);
@@ -191,7 +205,7 @@ public class MqttCallBack extends BaseManager implements MqttCallbackExtended  {
                     break;
                 case Constant.CLOSE_DOOR:
                     LogUtil.log(TAG, "收到：服务端响应关舱门" + jsonString);
-//                ApronExecutionStatus.getInstance().setServerReplyDockIn(true);
+                    ApronExecutionStatus.getInstance().setServerReplyDockIn(true);
                     break;
                 case Constant.OPEN_DOOR:
                     LogUtil.log(TAG, "收到：服务端响应开舱门" + jsonString);
@@ -201,16 +215,15 @@ public class MqttCallBack extends BaseManager implements MqttCallbackExtended  {
                     LogUtil.log(TAG, "收到：服务端响应TaskFail" + jsonString);
                     ApronExecutionStatus.getInstance().setServerReplyTaskFail(true);
                     break;
-
                 case Constant.TAKEOFF_TO_POINT:
                     LogUtil.log(TAG, "收到：一键起飞" + jsonString);
                     //设置modecode
                     Movement.getInstance().setMode_code(1);
-                    sendFlightTaskProgress2Server();
                     //设置标志为指令飞行
                     Movement.getInstance().setFlightmode(2);
-                    TakeoffProgressScheduler.getInstance().startReporting();
 
+
+                    TakeoffProgressScheduler.getInstance().startReporting();
                     TakeOffToPointManager.getInstance().taskExecute(message);
                     break;
                 case Constant.FLY_TO_POINT:
@@ -372,12 +385,12 @@ public class MqttCallBack extends BaseManager implements MqttCallbackExtended  {
                     SpeakerManager.getInstance().speakerTTSPlayStart(message, 1);
                     break;
                 case Constant.UAV_LIVE_FPV:
-                    LogUtil.log(TAG, "收到：切换推流fpv" + jsonString);
-                    StreamManager.getInstance().switchptsp(ComponentIndexType.FPV,message);
+                    //LogUtil.log(TAG, "收到：切换推流fpv" + jsonString);
+                    StreamManager.getInstance().switchptspfpv(ComponentIndexType.FPV,message);
                     break;
                 case Constant.UAV_LIVE_CAMERA:
-                    LogUtil.log(TAG, "收到：切换推流camera" + jsonString);
-                    StreamManager.getInstance().switchptsp(ComponentIndexType.PORT_1,message);
+                    //LogUtil.log(TAG, "收到：切换推流camera" + jsonString);
+                    StreamManager.getInstance().switchptspport(ComponentIndexType.PORT_1,message);
                     break;
 
 //            //获取控制权
diff --git a/app/src/main/java/com/aros/apron/entity/Movement.java b/app/src/main/java/com/aros/apron/entity/Movement.java
index 699d184d..af9124d5 100644
--- a/app/src/main/java/com/aros/apron/entity/Movement.java
+++ b/app/src/main/java/com/aros/apron/entity/Movement.java
@@ -114,6 +114,7 @@ public class Movement {
     private boolean virtualcontrollget=false;//是否已经获得过控制权
 
     private int GPSSatelliteCount; //卫星个数
+    private boolean Alternate=false;
 
 
     //适配上云格式参数，拿到后再进行组装
@@ -199,7 +200,7 @@ public class Movement {
     private int temperature;
     private double x;
     private double y;
-    private int ir_zoom_factor;
+    private int ir_zoom_factor=2;
     private double bottom;
     private double left;
     private double right;
@@ -275,6 +276,34 @@ public class Movement {
     private String gnd_quality_4g;
     private String sdr_freq_band;
     private String freq_band_4g;
+    private boolean istakeoffex=false;
+
+
+    public boolean isAlternate() {
+        return Alternate;
+    }
+
+    public void setAlternate(boolean alternate) {
+        Alternate = alternate;
+    }
+
+    public boolean isIstakeoffex() {
+        return istakeoffex;
+    }
+
+    public void setIstakeoffex(boolean istakeoffex) {
+        this.istakeoffex = istakeoffex;
+    }
+
+    private String waylinename; //航线名字
+
+    public String getWaylinename() {
+        return waylinename;
+    }
+
+    public void setWaylinename(String waylinename) {
+        this.waylinename = waylinename;
+    }
 
     //航线上报状态
     private int result=0;
@@ -293,8 +322,15 @@ public class Movement {
     private double takeofftargetlongitude;
     private double takeofftargetheight;
 
+    private  int  mission_type;
 
+    public int getMission_type() {
+        return mission_type;
+    }
 
+    public void setMission_type(int mission_type) {
+        this.mission_type = mission_type;
+    }
 
     // ========== 上报拍照进度 ==========(全景)
     private String photo_status;             // in_progress/ok/fail
diff --git a/app/src/main/java/com/aros/apron/manager/AlternateLandingManager.java b/app/src/main/java/com/aros/apron/manager/AlternateLandingManager.java
index 5e6a7835..9c351e13 100644
--- a/app/src/main/java/com/aros/apron/manager/AlternateLandingManager.java
+++ b/app/src/main/java/com/aros/apron/manager/AlternateLandingManager.java
@@ -367,6 +367,7 @@ public class AlternateLandingManager extends BaseManager {
                 new Handler().postDelayed(new Runnable() {
                     @Override
                     public void run() {
+                        Movement.getInstance().setWaylinename("alternate");
                         missionManager.startMission("alternate", new CommonCallbacks.CompletionCallback() {
                             @Override
                             public void onSuccess() {
diff --git a/app/src/main/java/com/aros/apron/manager/CameraManager.java b/app/src/main/java/com/aros/apron/manager/CameraManager.java
index b7634e22..3ad4d3da 100644
--- a/app/src/main/java/com/aros/apron/manager/CameraManager.java
+++ b/app/src/main/java/com/aros/apron/manager/CameraManager.java
@@ -17,6 +17,7 @@ import com.aros.apron.tools.LogUtil;
 import com.google.gson.Gson;
 
 import dji.sdk.keyvalue.key.CameraKey;
+import dji.sdk.keyvalue.key.FlightControllerKey;
 import dji.sdk.keyvalue.key.KeyTools;
 import dji.sdk.keyvalue.key.ProductKey;
 import dji.sdk.keyvalue.value.camera.CameraExposureCompensation;
@@ -102,7 +103,9 @@ public static CameraManager getInstance() {
 }
 
 public void initCameraInfo() {
-    Boolean isConnect = KeyManager.getInstance().getValue(KeyTools.createKey(CameraKey.KeyConnection, ComponentIndexType.PORT_1));
+
+    Boolean isConnect = KeyManager.getInstance().getValue(createKey(FlightControllerKey.KeyConnection));
+    LogUtil.log(TAG,"isConnect"+isConnect);
     if (isConnect != null && isConnect) {
         //全局画面中测量的最高温度
         KeyManager.getInstance().listen(KeyTools.createCameraKey(CameraKey.KeyThermalGlobalMinTemperature,
@@ -428,8 +431,9 @@ public void initCameraInfo() {
                 ComponentIndexType.PORT_1, CameraLensType.CAMERA_LENS_WIDE), this, new CommonCallbacks.KeyListener<CameraExposureCompensation>() {
             @Override
             public void onValueChange(@Nullable CameraExposureCompensation cameraExposureCompensation, @Nullable CameraExposureCompensation t1) {
-                if (cameraExposureCompensation != null) {
-                    Movement.getInstance().setWide_exposure_value(cameraExposureCompensation.value());
+                if (t1!= null) {
+                    LogUtil.log(TAG, "监听曝光范围:" + t1.value());
+                    Movement.getInstance().setWide_exposure_value(t1.value());
                 }
             }
         });
diff --git a/app/src/main/java/com/aros/apron/manager/FlightManager.java b/app/src/main/java/com/aros/apron/manager/FlightManager.java
index 7f875c7d..3727402e 100644
--- a/app/src/main/java/com/aros/apron/manager/FlightManager.java
+++ b/app/src/main/java/com/aros/apron/manager/FlightManager.java
@@ -23,6 +23,7 @@ import com.aros.apron.tools.LocationUtils;
 import com.aros.apron.tools.LogUtil;
 import com.aros.apron.tools.MqttManager;
 import com.aros.apron.tools.PreferenceUtils;
+import com.aros.apron.tools.TakeoffProgressScheduler;
 import com.google.gson.Gson;
 
 import org.greenrobot.eventbus.EventBus;
@@ -39,6 +40,7 @@ import dji.sdk.keyvalue.value.common.EmptyMsg;
 import dji.sdk.keyvalue.value.common.LocationCoordinate2D;
 import dji.sdk.keyvalue.value.common.LocationCoordinate3D;
 import dji.sdk.keyvalue.value.common.Velocity3D;
+import dji.sdk.keyvalue.value.flightassistant.VisionAssistDirection;
 import dji.sdk.keyvalue.value.flightcontroller.FailsafeAction;
 import dji.sdk.keyvalue.value.flightcontroller.FlightMode;
 import dji.sdk.keyvalue.value.flightcontroller.GPSSignalLevel;
@@ -60,6 +62,7 @@ import dji.v5.manager.aircraft.perception.data.PerceptionInfo;
 import dji.v5.manager.aircraft.perception.listener.PerceptionInformationListener;
 import dji.v5.manager.aircraft.virtualstick.VirtualStickManager;
 import dji.v5.manager.aircraft.waypoint3.WaypointMissionManager;
+import dji.v5.manager.datacenter.MediaDataCenter;
 import dji.v5.manager.diagnostic.DJIDeviceHealthInfo;
 import dji.v5.manager.diagnostic.DJIDeviceHealthInfoChangeListener;
 import dji.v5.manager.diagnostic.DJIDeviceStatus;
@@ -90,631 +93,641 @@ public class FlightManager extends BaseManager {
 
     public void initFlightInfo() {
         Boolean isConnect = KeyManager.getInstance().getValue(createKey(FlightControllerKey.KeyConnection));
+        if (isConnect!=null&&isConnect){
+            //添加飞机连接状态的mode
+            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyConnection), this, new CommonCallbacks.KeyListener<Boolean>() {
+                @Override
+                public void onValueChange(@Nullable Boolean oldValue, @Nullable Boolean newValue) {
+                    if (newValue != null) {
+                        if (!newValue) {
 
-        //添加飞机连接状态的mode
-        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyConnection), this, new CommonCallbacks.KeyListener<Boolean>() {
-            @Override
-            public void onValueChange(@Nullable Boolean oldValue, @Nullable Boolean newValue) {
-                if (newValue != null) {
-                    if (!newValue) {
+                            LogUtil.log(TAG, "遥控器断开连接");
+                            // 飞机未连接时设置未连接状态
+                            Movement.getInstance().setMode_code(14);
+                            OSDManager.getInstance().pushFlightAttitude();
 
-                        LogUtil.log(TAG, "遥控器断开连接");
-                        // 飞机未连接时设置未连接状态
-                        Movement.getInstance().setMode_code(14);
-                        OSDManager.getInstance().pushFlightAttitude();
-
-                        Movement.getInstance().setMissionFinish(true);
+                            Movement.getInstance().setMissionFinish(true);
 
 
-                    } else {
+                        } else {
+
+                            PerceptionManager.getInstance().setPerceptionEnable(false);
+                            LogUtil.log(TAG,"关闭避障");
+                            PerceptionManager.getInstance().setObstacleAvoidanceHorizontalEnabled(false);
+                            //连上就待机
+                            MediaDataCenter.getInstance().getCameraStreamManager().setVisionAssistViewDirection(VisionAssistDirection.DOWN, new CommonCallbacks.CompletionCallback() {
+                                @Override
+                                public void onSuccess() {
+                                    LogUtil.log(TAG, "设置下视辅助视频成功");
+                                }
+
+                                @Override
+                                public void onFailure(@NonNull IDJIError idjiError) {
+                                    LogUtil.log(TAG, "设置下视辅助视频失败");
+                                }
+                            });
+
+                            Movement.getInstance().setMissionFinish(false);
+                            Movement.getInstance().setMode_code(0);
+                        }
 
-                        LogUtil.log(TAG, "setMode_code1(0)");
-                        //连上就待机
-                        Movement.getInstance().setMissionFinish(false);
-                        Movement.getInstance().setMode_code(0);
                     }
-
                 }
-            }
-        });
+            });
         //重新复制一下如果一直断开这个回调会不执行
-        if (isConnect) {
+        if (isConnect != null && isConnect) {
             LogUtil.log(TAG, "setMode_code2(0)");
             Movement.getInstance().setMode_code(0);
         } else {
             Movement.getInstance().setMode_code(14);
         }
 
-        if (isConnect != null && isConnect) {
+        // 直接注册所有监听器，不依赖于FlightController的连接状态
+        if (!TextUtils.isEmpty(PreferenceUtils.getInstance().getAlternatePointLon())
+                && !TextUtils.isEmpty(PreferenceUtils.getInstance().getAlternatePointLat())) {
+            Movement.getInstance().setAlternatePointLon(PreferenceUtils.getInstance().getAlternatePointLon());
+            Movement.getInstance().setAlternatePointLat(PreferenceUtils.getInstance().getAlternatePointLat());
+        }
 
-            if (!TextUtils.isEmpty(PreferenceUtils.getInstance().getAlternatePointLon())
-                    && !TextUtils.isEmpty(PreferenceUtils.getInstance().getAlternatePointLat())) {
-                Movement.getInstance().setAlternatePointLon(PreferenceUtils.getInstance().getAlternatePointLon());
-                Movement.getInstance().setAlternatePointLat(PreferenceUtils.getInstance().getAlternatePointLat());
+        iDeviceStatusManager = dji.v5.manager.diagnostic.DeviceStatusManager.getInstance();
+        LogUtil.log(TAG, "iDeviceStatusManager" + "设置成功");
+        iDeviceStatusManager.addDJIDeviceStatusChangeListener(new DJIDeviceStatusChangeListener() {
+            @Override
+            public void onDeviceStatusUpdate(DJIDeviceStatus from, DJIDeviceStatus to) {
+                if (to != null && !TextUtils.isEmpty(to.description())) {
+                    LogUtil.log(TAG, "setPlaneMessage" + to.description());
+                    Movement.getInstance().setPlaneMessage(to.description());
+                    pushFlightAttitude();
+                }
             }
+        });
 
-            iDeviceStatusManager = dji.v5.manager.diagnostic.DeviceStatusManager.getInstance();
-            LogUtil.log(TAG,"iDeviceStatusManager"+"设置成功");
-            iDeviceStatusManager.addDJIDeviceStatusChangeListener(new DJIDeviceStatusChangeListener() {
-                @Override
-                public void onDeviceStatusUpdate(DJIDeviceStatus from, DJIDeviceStatus to) {
-                    if (to != null && !TextUtils.isEmpty(to.description())) {
-                        LogUtil.log(TAG,"setPlaneMessage"+to.description());
-                        Movement.getInstance().setPlaneMessage(to.description());
+        //避障状态
+        IPerceptionManager perceptionManager = dji.v5.manager.aircraft.perception.PerceptionManager.getInstance();
+        perceptionManager.addPerceptionInformationListener(new PerceptionInformationListener() {
+            @Override
+            public void onUpdate(@NonNull PerceptionInfo information) {
+                if (information != null) {
+                    if (information.getDownwardObstacleAvoidanceWorking() != null) {
+                        Movement.getInstance().setDownside(information.getDownwardObstacleAvoidanceWorking() ? 1 : 0);
+                    }
+                    Movement.getInstance().setHorizon(information.isHorizontalObstacleAvoidanceEnabled() ? 1 : 0);
+                    if (information.getUpwardObstacleAvoidanceWorking() != null) {
+                        Movement.getInstance().setUpside(information.getUpwardObstacleAvoidanceWorking() ? 1 : 0);
+                    }
+                    pushFlightAttitude();
+
+                }
+            }
+        });
+
+        iDeviceHealthManager = dji.v5.manager.diagnostic.DeviceHealthManager.getInstance();
+        iDeviceHealthManager.addDJIDeviceHealthInfoChangeListener(new DJIDeviceHealthInfoChangeListener() {
+            @Override
+            public void onDeviceHealthInfoUpdate(List<DJIDeviceHealthInfo> infos) {
+                if (infos != null && infos.size() > 0) {
+                    String warningMessage = infos.get(0).description();
+                    if (!TextUtils.isEmpty(warningMessage)) {
+                        Movement.getInstance().setWarningMessage(warningMessage);
                         pushFlightAttitude();
                     }
+                } else {
+                    Log.e(TAG, "监听设备健康,无异常");
+                    Movement.getInstance().setWarningMessage("");
+                    pushFlightAttitude();
                 }
-            });
+            }
+        });
 
-            //避障状态
-            IPerceptionManager perceptionManager = dji.v5.manager.aircraft.perception.PerceptionManager.getInstance();
-            perceptionManager.addPerceptionInformationListener(new PerceptionInformationListener() {
-                @Override
-                public void onUpdate(@NonNull PerceptionInfo information) {
-                    if (information != null) {
-                        if (information.getDownwardObstacleAvoidanceWorking() != null) {
-                            Movement.getInstance().setDownside(information.getDownwardObstacleAvoidanceWorking() ? 1 : 0);
-                        }
-                        Movement.getInstance().setHorizon(information.isHorizontalObstacleAvoidanceEnabled() ? 1 : 0);
-                        if (information.getUpwardObstacleAvoidanceWorking() != null) {
-                            Movement.getInstance().setUpside(information.getUpwardObstacleAvoidanceWorking() ? 1 : 0);
-                        }
-                        pushFlightAttitude();
 
-                    }
-                }
-            });
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyIsFlying), this, new CommonCallbacks.KeyListener<Boolean>() {
+            @Override
+            public void onValueChange(@Nullable Boolean oldValue, @Nullable Boolean newValue) {
+                if (newValue != null) {
+                    if (newValue) {
+                        ApronExecutionStatus.getInstance().setAircraftWaitShutDown(false);
+                        //起飞了这个状态就看这里
 
-            iDeviceHealthManager = dji.v5.manager.diagnostic.DeviceHealthManager.getInstance();
-            iDeviceHealthManager.addDJIDeviceHealthInfoChangeListener(new DJIDeviceHealthInfoChangeListener() {
-                @Override
-                public void onDeviceHealthInfoUpdate(List<DJIDeviceHealthInfo> infos) {
-                    if (infos != null && infos.size() > 0) {
-                        String warningMessage = infos.get(0).description();
-                        if (!TextUtils.isEmpty(warningMessage)) {
-                            Movement.getInstance().setWarningMessage(warningMessage);
-                            pushFlightAttitude();
+                        if (Movement.getInstance().getFlightmode() == 1) {
+                            Movement.getInstance().setMode_code(5);
+                        } else if (Movement.getInstance().getFlightmode() == 2) {
+                            Movement.getInstance().setMode_code(17);
                         }
                     } else {
-                        Log.e(TAG, "监听设备健康,无异常");
-                        Movement.getInstance().setWarningMessage("");
-                        pushFlightAttitude();
-                    }
-                }
-            });
-
-
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyIsFlying), this, new CommonCallbacks.KeyListener<Boolean>() {
-                @Override
-                public void onValueChange(@Nullable Boolean oldValue, @Nullable Boolean newValue) {
-                    if (newValue != null) {
-                        if (newValue) {
-                            ApronExecutionStatus.getInstance().setAircraftWaitShutDown(false);
-                            //起飞了这个状态就看这里
-
-                            if (Movement.getInstance().getFlightmode() == 1) {
-                                Movement.getInstance().setMode_code(5);
-                            } else if (Movement.getInstance().getFlightmode() == 2) {
-                                Movement.getInstance().setMode_code(17);
-                            }
-                        } else {
-                            LogUtil.log(TAG, "setMode_code3(0)");
-                            Movement.getInstance().setMode_code(0);
-                            OSDManager.getInstance().pushFlightAttitude();
-
-                        }
-
-                        isFlying = newValue;
-                        Movement.getInstance().setPlaneWing(newValue);
-                        pushFlightAttitude();
-
+                        LogUtil.log(TAG, "setMode_code3(0)");
+                        Movement.getInstance().setMode_code(0);
+                        OSDManager.getInstance().pushFlightAttitude();
 
                     }
-                }
-            });
 
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAreMotorsOn), this, new CommonCallbacks.KeyListener<Boolean>() {
-                @Override
-                public void onValueChange(@Nullable Boolean oldValue, @Nullable Boolean newValue) {
-                    if (newValue != null) {
-
-                        if (newValue == false) {
-                            //电机不转待机
-                            Movement.getInstance().setMode_code(0);
-                            OSDManager.getInstance().pushFlightAttitude();
-                        }
-
-                        isMotorsOn = newValue;
-                        pushFlightAttitude();
-                        Movement.getInstance().setMotorsOn(newValue);
-                    }
-
-                }
-            });
-            //挡位
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyRemoteControllerFlightMode), this, new CommonCallbacks.KeyListener<RemoteControllerFlightMode>() {
-                @Override
-                public void onValueChange(@Nullable RemoteControllerFlightMode remoteControllerFlightMode, @Nullable RemoteControllerFlightMode t1) {
-                    if (remoteControllerFlightMode != null) {
-                        Movement.getInstance().setGear(remoteControllerFlightMode.value());
-                        pushFlightAttitude();
-                    }
-                }
-            });
-            KeyManager.getInstance().listen(KeyTools.createKey(ProductKey.KeyProductType), this, new CommonCallbacks.KeyListener<ProductType>() {
-                @Override
-                public void onValueChange(@Nullable ProductType productType, @Nullable ProductType t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setProductName(t1.name());
-                        pushFlightAttitude();
-                    }
-                }
-            });
-            //飞机SN号
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeySerialNumber), this, new CommonCallbacks.KeyListener<String>() {
-                @Override
-                public void onValueChange(@Nullable String s, @Nullable String t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setFirmware_version(t1);
-                        pushFlightAttitude();
-                    }
-                }
-            });
-            //RID状态
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyRidWorkingStatusPush), this, new CommonCallbacks.KeyListener<RidWorkingStatusPushMsg>() {
-                @Override
-                public void onValueChange(@Nullable RidWorkingStatusPushMsg ridWorkingStatusPushMsg, @Nullable RidWorkingStatusPushMsg t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setRid_state(t1.getIsRidSupport());
-                        pushFlightAttitude();
-
-                    }
-                }
-            });
-            //rtk起飞高度(计算海拔高度使用)
-            KeyManager.getInstance().listen(createKey(RtkMobileStationKey.KeyRTKTakeoffAltitudeInfo), this, new CommonCallbacks.KeyListener<RTKTakeoffAltitudeInfo>() {
-                @Override
-                public void onValueChange(@Nullable RTKTakeoffAltitudeInfo rtkTakeoffAltitudeInfo, @Nullable RTKTakeoffAltitudeInfo t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setRtk_takeoff_altitude(t1.getAltitude());
-                        pushFlightAttitude();
-                    }
-                }
-            });
-
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftLocation3D), this, new CommonCallbacks.KeyListener<LocationCoordinate3D>() {
-                @Override
-                public void onValueChange(@Nullable LocationCoordinate3D oldValue, @Nullable LocationCoordinate3D newValue) {
-                    if (newValue != null) {
-                        if (newValue.getAltitude() != null) {
-                            Movement.getInstance().setElevation(newValue.getAltitude());
-                            Movement.getInstance().setTask_height(newValue.getAltitude());
-                        }
-
-                        double distance = LocationUtils.getDistance(String.valueOf(Movement.getInstance().getHomepoint_longitude()),
-                                String.valueOf(Movement.getInstance().getHomepoint_latitude()),
-                                String.valueOf(newValue.getLongitude()),
-                                String.valueOf(newValue.getLatitude()));
-                        Movement.getInstance().setHome_distance(distance);
-
-                        Movement.getInstance().setHeight(GpsUtils.egm96Altitude((Movement.getInstance().getRtk_takeoff_altitude() +
-                                        Movement.getInstance().getElevation()),
-                                newValue.getLatitude(), newValue.getLongitude()));
-
-                        Movement.getInstance().setLatitude(newValue.getLatitude());
-                        Movement.getInstance().setLongitude(newValue.getLongitude());
-                        pushFlightAttitude();
-
-
-
-                    }
-                }
-            });
-
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftVelocity), this, new CommonCallbacks.KeyListener<Velocity3D>() {
-                @Override
-                public void onValueChange(@Nullable Velocity3D velocity3D, @Nullable Velocity3D t1) {
-
-                }
-            });
-
-            //水平&垂直速度
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftVelocity), this, new CommonCallbacks.KeyListener<Velocity3D>() {
-                @Override
-                public void onValueChange(@Nullable Velocity3D oldValue, @Nullable Velocity3D newValue) {
-                    if (newValue != null) {
-                        if (newValue.getZ() != null) {
-                            Movement.getInstance().setVertical_speed(newValue.getZ());
-                        }
-                        if (newValue.getY() != null && newValue.getX() != null) {
-                            Movement.getInstance().setHorizontal_speed(Math.abs(Math.sqrt((newValue.getX() * newValue.getX()) + (newValue.getY() * newValue.getY()))));
-                        }
-                        pushFlightAttitude();
-
-                    }
-                }
-            });
-
-            //卫星数
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyGPSSatelliteCount), this, new CommonCallbacks.KeyListener<Integer>() {
-                @Override
-                public void onValueChange(@Nullable Integer oldValue, @Nullable Integer newValue) {
-                    if (newValue != null) {
-                        Movement.getInstance().setGps_number(newValue);
-                        Movement.getInstance().setRtk_number(newValue);
-                        pushFlightAttitude();
-                    }
-                }
-            });
-
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyGPSSatelliteCount), this, new CommonCallbacks.KeyListener<Integer>() {
-                @Override
-                public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
-                    if(t1!=null){
-                        Movement.getInstance().setGPSSatelliteCount(t1);
-                    }
-                }
-            });
-
-
-
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyGPSSignalLevel), this, new CommonCallbacks.KeyListener<GPSSignalLevel>() {
-                @Override
-                public void onValueChange(@Nullable GPSSignalLevel gpsSignalLevel, @Nullable GPSSignalLevel t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setQuality(t1.value());
-                        pushFlightAttitude();
-
-                    }
-                }
-            });
-
-            //返航位置
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyHomeLocation), this, new CommonCallbacks.KeyListener<LocationCoordinate2D>() {
-                @Override
-                public void onValueChange(@Nullable LocationCoordinate2D oldValue, @Nullable LocationCoordinate2D newValue) {
-                    if (newValue != null) {
-                        Movement.getInstance().setHomepoint_latitude(newValue.getLatitude());
-                        Movement.getInstance().setHomepoint_longitude(newValue.getLongitude());
-                        pushFlightAttitude();
-
-                    }
-                }
-            });
-
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyDistanceLimitEnabled), this, new CommonCallbacks.KeyListener<Boolean>() {
-                @Override
-                public void onValueChange(@Nullable Boolean aBoolean, @Nullable Boolean t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setDistanceLimitEnabled(t1);
-                        pushFlightAttitude();
-                    }
-                }
-            });
-
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyWindSpeed), this, new CommonCallbacks.KeyListener<Integer>() {
-                @Override
-                public void onValueChange(@Nullable Integer oldValue, @Nullable Integer newValue) {
-                    if (newValue != null) {
-                        Movement.getInstance().setWind_speed(newValue);
-                        pushFlightAttitude();
-                    }
-                }
-            });
-
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyWindDirection), this, new CommonCallbacks.KeyListener<WindDirection>() {
-                @Override
-                public void onValueChange(@Nullable WindDirection windDirection, @Nullable WindDirection t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setWind_direction(t1.value());
-                        pushFlightAttitude();
-                    }
-                }
-            });
-
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyCompassHeading), this, new CommonCallbacks.KeyListener<Double>() {
-                @Override
-                public void onValueChange(@Nullable Double oldValue, @Nullable Double newValue) {
-                    if (newValue != null) {
-                        Movement.getInstance().setAngleYaw(newValue.intValue());
-                        pushFlightAttitude();
-                    }
-                }
-            });
-
-            //飞行器夜航灯状态
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyLEDsSettings), this, new CommonCallbacks.KeyListener<LEDsSettings>() {
-                @Override
-                public void onValueChange(@Nullable LEDsSettings leDsSettings, @Nullable LEDsSettings t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setNight_lights_state(t1.getNavigationLEDsOn() ? 1 : 0);
-                        pushFlightAttitude();
-
-                    }
-                }
-            });
-
-            //飞行器状态	(未找到类似上云api的枚举格式，先用FlightMode替代)
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyFlightMode), this, new CommonCallbacks.KeyListener<FlightMode>() {
-                @Override
-                public void onValueChange(@Nullable FlightMode oldValue, @Nullable FlightMode newValue) {
-                    if (newValue != null) {
-                        if (newValue == FlightMode.MOTOR_START) {
-                            //刚起飞时，重置保存的状态
-                            PreferenceUtils.getInstance().setNeedTriggerAlterArucoLand(false);
-                            PreferenceUtils.getInstance().setNeedTriggerApronArucoLand(false);
-                            PreferenceUtils.getInstance().setTriggerToAlternatePoint(false);
-
-                        }
-                        Movement.getInstance().setPlaneMode(newValue.name());
-                        pushFlightAttitude();
-
-                        switch (newValue) {
-                            case TAKE_OFF_READY:
-                                //Movement.getInstance().setMode_code(2);
-                                break;
-                            case VIRTUAL_STICK:
-                                //Movement.getInstance().setMode_code(3);
-                                break;
-                            case AUTO_TAKE_OFF:
-                                //我觉得可能会重复设置
-                                //Movement.getInstance().setMode_code(4);
-                                break;
-                            case WAYPOINT:
-                                //Movement.getInstance().setMode_code(5);
-                                break;
-                            case PANO:
-                                Movement.getInstance().setMode_code(6);
-                                break;
-                            case FOLLOW_ME:
-                                Movement.getInstance().setMode_code(7);
-                                break;
-                            case AUTO_AVOIDANCE:
-                                Movement.getInstance().setMode_code(8);
-                                break;
-                            case GO_HOME:
-                                Movement.getInstance().setMode_code(9);
-                                break;
-                            case AUTO_LANDING:
-                                Movement.getInstance().setMode_code(10);
-                                //重置这个飞行状态
-                                Movement.getInstance().setFlightmode(0);
-                                break;
-                            case FORCE_LANDING:
-                                Movement.getInstance().setMode_code(11);
-                                break;
-                            case POI:
-                                Movement.getInstance().setMode_code(20);
-                                break;
-
-                        }
-                    }
-                }
-            });
-
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftAttitude), this, new CommonCallbacks.KeyListener<Attitude>() {
-                @Override
-                public void onValueChange(@Nullable Attitude attitude, @Nullable Attitude t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setAttitude_pitch(t1.getPitch());
-                        Movement.getInstance().setAttitude_head(t1.getYaw());
-                        Movement.getInstance().setTask_attitude_head(t1.getYaw());
-                        Movement.getInstance().setAttitude_roll(t1.getRoll());
-                    }
+                    isFlying = newValue;
+                    Movement.getInstance().setPlaneWing(newValue);
                     pushFlightAttitude();
-                }
-            });
 
-            KeyManager.getInstance().listen(createKey(AirLinkKey.KeyUpLinkQuality), this, new CommonCallbacks.KeyListener<Integer>() {
-                @Override
-                public void onValueChange(@Nullable Integer oldValue, @Nullable Integer newValue) {
-                    if (newValue != null) {
-                        Movement.getInstance().setRemoteControlSignal(newValue);
-                    }
-                    pushFlightAttitude();
-                }
-            });
 
-            KeyManager.getInstance().listen(createKey(AirLinkKey.KeyDownLinkQuality), this, new CommonCallbacks.KeyListener<Integer>() {
-                @Override
-                public void onValueChange(@Nullable Integer oldValue, @Nullable Integer newValue) {
-                    if (newValue != null) {
-                        Movement.getInstance().setPictureBiographySignal(newValue);
-                    }
-                    pushFlightAttitude();
                 }
-            });
-
-            GoHomeState goHomeState = KeyManager.getInstance().getValue(createKey(FlightControllerKey.KeyGoHomeStatus));
-            if (goHomeState != null) {
-                Movement.getInstance().setGoHomeState(goHomeState.value());
             }
+        });
 
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyGoHomeStatus), this, new CommonCallbacks.KeyListener<GoHomeState>() {
-                @Override
-                public void onValueChange(@Nullable GoHomeState oldValue, @Nullable GoHomeState newValue) {
-                    if (newValue != null) {
-                        Movement.getInstance().setGoHomeState(newValue.value());
-                        LogUtil.log(TAG, "GoHomeStatus:" + newValue.name());
-                        goHomeExecutionState = newValue.value();
-                        //返航或降落中不允许恢复断点航线
-                        if (newValue.value() == 1 || newValue.value() == 2 || newValue.value() == 3) {
-                            Movement.getInstance().setCurrentWaypointIndex(0);
-                        }
-                        //返航后触发可入库条件
-                        if (newValue.value() == 2) {
-                            triggerLandOrGoHome = true;
-                            Movement.getInstance().setVirtualStickQuitMission(false);
-                        }
-                        pushFlightAttitude();
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAreMotorsOn), this, new CommonCallbacks.KeyListener<Boolean>() {
+            @Override
+            public void onValueChange(@Nullable Boolean oldValue, @Nullable Boolean newValue) {
+                if (newValue != null) {
+
+                    if (newValue == false) {
+                        //电机不转待机
+                        Movement.getInstance().setMode_code(0);
+                        OSDManager.getInstance().pushFlightAttitude();
                     }
+
+                    isMotorsOn = newValue;
+                    pushFlightAttitude();
+                    Movement.getInstance().setMotorsOn(newValue);
                 }
-            });
 
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyUltrasonicHeight), this, new CommonCallbacks.KeyListener<Integer>() {
-                @Override
-                public void onValueChange(@Nullable Integer oldValue, @Nullable Integer newValue) {
-                    if (newValue != null) {
-                        Movement.getInstance().setUltrasonicHeight(newValue);
-                    }
+            }
+        });
+        //挡位
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyRemoteControllerFlightMode), this, new CommonCallbacks.KeyListener<RemoteControllerFlightMode>() {
+            @Override
+            public void onValueChange(@Nullable RemoteControllerFlightMode remoteControllerFlightMode, @Nullable RemoteControllerFlightMode t1) {
+                if (remoteControllerFlightMode != null) {
+                    Movement.getInstance().setGear(remoteControllerFlightMode.value());
                     pushFlightAttitude();
                 }
-            });
-
-            //总里程(单位m)
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftTotalFlightDistance), this, new CommonCallbacks.KeyListener<Double>() {
-                @Override
-                public void onValueChange(@Nullable Double aDouble, @Nullable Double t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setTotal_flight_distance(t1);
-                    }
+            }
+        });
+        KeyManager.getInstance().listen(KeyTools.createKey(ProductKey.KeyProductType), this, new CommonCallbacks.KeyListener<ProductType>() {
+            @Override
+            public void onValueChange(@Nullable ProductType productType, @Nullable ProductType t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setProductName(t1.name());
                     pushFlightAttitude();
                 }
-            });
-
-            //航迹 ID
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyTrackId), this, new CommonCallbacks.KeyListener<String>() {
-                @Override
-                public void onValueChange(@Nullable String s, @Nullable String t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setTrack_id(t1);
-                        Movement.getInstance().setTask_track_id(t1);
-                    }
+            }
+        });
+        //飞机SN号
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeySerialNumber), this, new CommonCallbacks.KeyListener<String>() {
+            @Override
+            public void onValueChange(@Nullable String s, @Nullable String t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setFirmware_version(t1);
                     pushFlightAttitude();
                 }
-            });
+            }
+        });
+        //RID状态
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyRidWorkingStatusPush), this, new CommonCallbacks.KeyListener<RidWorkingStatusPushMsg>() {
+            @Override
+            public void onValueChange(@Nullable RidWorkingStatusPushMsg ridWorkingStatusPushMsg, @Nullable RidWorkingStatusPushMsg t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setRid_state(t1.getIsRidSupport());
+                    pushFlightAttitude();
 
-            //总航时
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftTotalFlightDuration), this, new CommonCallbacks.KeyListener<Double>() {
-                @Override
-                public void onValueChange(@Nullable Double aDouble, @Nullable Double t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setTotal_flight_time(t1);
-                    }
+                }
+            }
+        });
+        //rtk起飞高度(计算海拔高度使用)
+        KeyManager.getInstance().listen(createKey(RtkMobileStationKey.KeyRTKTakeoffAltitudeInfo), this, new CommonCallbacks.KeyListener<RTKTakeoffAltitudeInfo>() {
+            @Override
+            public void onValueChange(@Nullable RTKTakeoffAltitudeInfo rtkTakeoffAltitudeInfo, @Nullable RTKTakeoffAltitudeInfo t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setRtk_takeoff_altitude(t1.getAltitude());
                     pushFlightAttitude();
                 }
-            });
+            }
+        });
 
-            //总架次
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftTotalFlightTimes), this, new CommonCallbacks.KeyListener<Integer>() {
-                @Override
-                public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setTotal_flight_sorties(t1);
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftLocation3D), this, new CommonCallbacks.KeyListener<LocationCoordinate3D>() {
+            @Override
+            public void onValueChange(@Nullable LocationCoordinate3D oldValue, @Nullable LocationCoordinate3D newValue) {
+                if (newValue != null) {
+                    if (newValue.getAltitude() != null) {
+                        Movement.getInstance().setElevation(newValue.getAltitude());
+                        Movement.getInstance().setTask_height(newValue.getAltitude());
+
+                    }
+
+                    double distance = LocationUtils.getDistance(String.valueOf(Movement.getInstance().getHomepoint_longitude()),
+                            String.valueOf(Movement.getInstance().getHomepoint_latitude()),
+                            String.valueOf(newValue.getLongitude()),
+                            String.valueOf(newValue.getLatitude()));
+                    Movement.getInstance().setHome_distance(distance);
+
+                    Movement.getInstance().setHeight(GpsUtils.egm96Altitude((Movement.getInstance().getRtk_takeoff_altitude() +
+                                    Movement.getInstance().getElevation()),
+                            newValue.getLatitude(), newValue.getLongitude()));
+
+                    Movement.getInstance().setLatitude(newValue.getLatitude());
+                    Movement.getInstance().setLongitude(newValue.getLongitude());
+                    pushFlightAttitude();
+
+
+                }
+            }
+        });
+
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftVelocity), this, new CommonCallbacks.KeyListener<Velocity3D>() {
+            @Override
+            public void onValueChange(@Nullable Velocity3D velocity3D, @Nullable Velocity3D t1) {
+
+            }
+        });
+
+        //水平&垂直速度
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftVelocity), this, new CommonCallbacks.KeyListener<Velocity3D>() {
+            @Override
+            public void onValueChange(@Nullable Velocity3D oldValue, @Nullable Velocity3D newValue) {
+                if (newValue != null) {
+                    if (newValue.getZ() != null) {
+                        Movement.getInstance().setVertical_speed(newValue.getZ());
+                    }
+                    if (newValue.getY() != null && newValue.getX() != null) {
+                        Movement.getInstance().setHorizontal_speed(Math.abs(Math.sqrt((newValue.getX() * newValue.getX()) + (newValue.getY() * newValue.getY()))));
                     }
                     pushFlightAttitude();
-                }
-            });
 
-            //失联动作
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyFailsafeAction), this, new CommonCallbacks.KeyListener<FailsafeAction>() {
-                @Override
-                public void onValueChange(@Nullable FailsafeAction failsafeAction, @Nullable FailsafeAction t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setRc_lost_action(t1.value());
-                    }
+                }
+            }
+        });
+
+        //卫星数
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyGPSSatelliteCount), this, new CommonCallbacks.KeyListener<Integer>() {
+            @Override
+            public void onValueChange(@Nullable Integer oldValue, @Nullable Integer newValue) {
+                if (newValue != null) {
+                    Movement.getInstance().setGps_number(newValue);
+                    Movement.getInstance().setRtk_number(newValue);
                     pushFlightAttitude();
                 }
-            });
+            }
+        });
 
-            //返航高度
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyGoHomeHeight), this, new CommonCallbacks.KeyListener<Integer>() {
-                @Override
-                public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setRth_altitude(t1);
-                    }
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyGPSSatelliteCount), this, new CommonCallbacks.KeyListener<Integer>() {
+            @Override
+            public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setGPSSatelliteCount(t1);
+                }
+            }
+        });
+
+
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyGPSSignalLevel), this, new CommonCallbacks.KeyListener<GPSSignalLevel>() {
+            @Override
+            public void onValueChange(@Nullable GPSSignalLevel gpsSignalLevel, @Nullable GPSSignalLevel t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setQuality(t1.value());
+                    pushFlightAttitude();
+
+                }
+            }
+        });
+
+        //返航位置
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyHomeLocation), this, new CommonCallbacks.KeyListener<LocationCoordinate2D>() {
+            @Override
+            public void onValueChange(@Nullable LocationCoordinate2D oldValue, @Nullable LocationCoordinate2D newValue) {
+                if (newValue != null) {
+                    Movement.getInstance().setHomepoint_latitude(newValue.getLatitude());
+                    Movement.getInstance().setHomepoint_longitude(newValue.getLongitude());
+                    pushFlightAttitude();
+
+                }
+            }
+        });
+
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyDistanceLimitEnabled), this, new CommonCallbacks.KeyListener<Boolean>() {
+            @Override
+            public void onValueChange(@Nullable Boolean aBoolean, @Nullable Boolean t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setDistanceLimitEnabled(t1);
                     pushFlightAttitude();
                 }
-            });
+            }
+        });
 
-            //限高
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyHeightLimit), this, new CommonCallbacks.KeyListener<Integer>() {
-                @Override
-                public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setHeight_limit(t1);
-                    }
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyWindSpeed), this, new CommonCallbacks.KeyListener<Integer>() {
+            @Override
+            public void onValueChange(@Nullable Integer oldValue, @Nullable Integer newValue) {
+                if (newValue != null) {
+                    Movement.getInstance().setWind_speed(newValue);
                     pushFlightAttitude();
                 }
-            });
+            }
+        });
 
-            //是否接近限高
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyIsNearHeightLimit), this, new CommonCallbacks.KeyListener<Boolean>() {
-                @Override
-                public void onValueChange(@Nullable Boolean aBoolean, @Nullable Boolean t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setIs_near_height_limit(t1 ? 1 : 0);
-                    }
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyWindDirection), this, new CommonCallbacks.KeyListener<WindDirection>() {
+            @Override
+            public void onValueChange(@Nullable WindDirection windDirection, @Nullable WindDirection t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setWind_direction(t1.value());
                     pushFlightAttitude();
                 }
-            });
+            }
+        });
 
-            //是否接近设定的限制距离
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyIsNearDistanceLimit), this, new CommonCallbacks.KeyListener<Boolean>() {
-                @Override
-                public void onValueChange(@Nullable Boolean aBoolean, @Nullable Boolean t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setIs_near_distance_limit(t1 ? 1 : 0);
-                        Movement.getInstance().setIs_near_area_limit(t1 ? 1 : 0);
-                    }
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyCompassHeading), this, new CommonCallbacks.KeyListener<Double>() {
+            @Override
+            public void onValueChange(@Nullable Double oldValue, @Nullable Double newValue) {
+                if (newValue != null) {
+                    Movement.getInstance().setAngleYaw(newValue.intValue());
                     pushFlightAttitude();
                 }
-            });
+            }
+        });
 
-            //是否开启限远
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyDistanceLimitEnabled), this, new CommonCallbacks.KeyListener<Boolean>() {
-                @Override
-                public void onValueChange(@Nullable Boolean aBoolean, @Nullable Boolean t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setIs_near_distance_limit(t1 ? 1 : 0);
-                    }
+        //飞行器夜航灯状态
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyLEDsSettings), this, new CommonCallbacks.KeyListener<LEDsSettings>() {
+            @Override
+            public void onValueChange(@Nullable LEDsSettings leDsSettings, @Nullable LEDsSettings t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setNight_lights_state(t1.getNavigationLEDsOn() ? 1 : 0);
                     pushFlightAttitude();
-                }
-            });
 
-            //限远
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyDistanceLimit), this, new CommonCallbacks.KeyListener<Integer>() {
-                @Override
-                public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setDistance_limit(t1);
+                }
+            }
+        });
+
+        //飞行器状态	(未找到类似上云api的枚举格式，先用FlightMode替代)
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyFlightMode), this, new CommonCallbacks.KeyListener<FlightMode>() {
+            @Override
+            public void onValueChange(@Nullable FlightMode oldValue, @Nullable FlightMode newValue) {
+                if (newValue != null) {
+                    if (newValue == FlightMode.MOTOR_START) {
+                        //刚起飞时，重置保存的状态
+                        PreferenceUtils.getInstance().setNeedTriggerAlterArucoLand(false);
+                        PreferenceUtils.getInstance().setNeedTriggerApronArucoLand(false);
+                        PreferenceUtils.getInstance().setTriggerToAlternatePoint(false);
+
                     }
+                    Movement.getInstance().setPlaneMode(newValue.name());
                     pushFlightAttitude();
-                }
-            });
 
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyLowBatteryWarningThreshold), this, new CommonCallbacks.KeyListener<Integer>() {
-                @Override
-                public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setLowBatteryWarningThreshold(t1);
-                        pushFlightAttitude();
-                    }
-                }
-            });
+                    switch (newValue) {
+                        case TAKE_OFF_READY:
+                            //Movement.getInstance().setMode_code(2);
+                            break;
+                        case VIRTUAL_STICK:
+                            //Movement.getInstance().setMode_code(3);
+                            break;
+                        case AUTO_TAKE_OFF:
+                            //我觉得可能会重复设置
+                            //Movement.getInstance().setMode_code(4);
+                            break;
+                        case WAYPOINT:
+                            //Movement.getInstance().setMode_code(5);
+                            break;
+                        case PANO:
+                            Movement.getInstance().setMode_code(6);
+                            break;
+                        case FOLLOW_ME:
+                            Movement.getInstance().setMode_code(7);
+                            break;
+                        case AUTO_AVOIDANCE:
+                            Movement.getInstance().setMode_code(8);
+                            break;
+                        case GO_HOME:
+                            Movement.getInstance().setMode_code(9);
+                            break;
+                        case AUTO_LANDING:
+                            Movement.getInstance().setMode_code(10);
+                            //重置这个飞行状态
+                            Movement.getInstance().setFlightmode(0);
+                            break;
+                        case FORCE_LANDING:
+                            Movement.getInstance().setMode_code(11);
+                            break;
+                        case POI:
+                            Movement.getInstance().setMode_code(20);
+                            break;
 
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeySeriousLowBatteryWarningThreshold), this, new CommonCallbacks.KeyListener<Integer>() {
-                @Override
-                public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setSeriousLowBatteryWarningThreshold(t1);
-                        pushFlightAttitude();
                     }
                 }
-            });
-            KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyLowBatteryRTHEnabled), this, new CommonCallbacks.KeyListener<Boolean>() {
-                @Override
-                public void onValueChange(@Nullable Boolean aBoolean, @Nullable Boolean t1) {
-                    if (t1 != null) {
-                        Movement.getInstance().setLowBatteryRTHEnabled(t1 ? 1 : 0);
-                        pushFlightAttitude();
-                    }
+            }
+        });
+
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftAttitude), this, new CommonCallbacks.KeyListener<Attitude>() {
+            @Override
+            public void onValueChange(@Nullable Attitude attitude, @Nullable Attitude t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setAttitude_pitch(t1.getPitch());
+                    Movement.getInstance().setAttitude_head(t1.getYaw());
+                    Movement.getInstance().setTask_attitude_head(t1.getYaw());
+                    Movement.getInstance().setAttitude_roll(t1.getRoll());
                 }
-            });
-        } else {
-            LogUtil.log(TAG, "初始化飞控失败" + "flight controller is null");
+                pushFlightAttitude();
+            }
+        });
+
+        KeyManager.getInstance().listen(createKey(AirLinkKey.KeyUpLinkQuality), this, new CommonCallbacks.KeyListener<Integer>() {
+            @Override
+            public void onValueChange(@Nullable Integer oldValue, @Nullable Integer newValue) {
+                if (newValue != null) {
+                    Movement.getInstance().setRemoteControlSignal(newValue);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        KeyManager.getInstance().listen(createKey(AirLinkKey.KeyDownLinkQuality), this, new CommonCallbacks.KeyListener<Integer>() {
+            @Override
+            public void onValueChange(@Nullable Integer oldValue, @Nullable Integer newValue) {
+                if (newValue != null) {
+                    Movement.getInstance().setPictureBiographySignal(newValue);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        GoHomeState goHomeState = KeyManager.getInstance().getValue(createKey(FlightControllerKey.KeyGoHomeStatus));
+        if (goHomeState != null) {
+            Movement.getInstance().setGoHomeState(goHomeState.value());
         }
+
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyGoHomeStatus), this, new CommonCallbacks.KeyListener<GoHomeState>() {
+            @Override
+            public void onValueChange(@Nullable GoHomeState oldValue, @Nullable GoHomeState newValue) {
+                if (newValue != null) {
+                    Movement.getInstance().setGoHomeState(newValue.value());
+                    LogUtil.log(TAG, "GoHomeStatus:" + newValue.name());
+                    goHomeExecutionState = newValue.value();
+                    //返航或降落中不允许恢复断点航线
+                    if (newValue.value() == 1 || newValue.value() == 2 || newValue.value() == 3) {
+                        Movement.getInstance().setCurrentWaypointIndex(0);
+                    }
+                    //返航后触发可入库条件
+                    if (newValue.value() == 2) {
+                        triggerLandOrGoHome = true;
+                        Movement.getInstance().setVirtualStickQuitMission(false);
+                    }
+                    pushFlightAttitude();
+                }
+            }
+        });
+
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyUltrasonicHeight), this, new CommonCallbacks.KeyListener<Integer>() {
+            @Override
+            public void onValueChange(@Nullable Integer oldValue, @Nullable Integer newValue) {
+                if (newValue != null) {
+                    Movement.getInstance().setUltrasonicHeight(newValue);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        //总里程(单位m)
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftTotalFlightDistance), this, new CommonCallbacks.KeyListener<Double>() {
+            @Override
+            public void onValueChange(@Nullable Double aDouble, @Nullable Double t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setTotal_flight_distance(t1);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        //航迹 ID
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyTrackId), this, new CommonCallbacks.KeyListener<String>() {
+            @Override
+            public void onValueChange(@Nullable String s, @Nullable String t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setTrack_id(t1);
+                    Movement.getInstance().setTask_track_id(t1);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        //总航时
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftTotalFlightDuration), this, new CommonCallbacks.KeyListener<Double>() {
+            @Override
+            public void onValueChange(@Nullable Double aDouble, @Nullable Double t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setTotal_flight_time(t1);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        //总架次
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyAircraftTotalFlightTimes), this, new CommonCallbacks.KeyListener<Integer>() {
+            @Override
+            public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setTotal_flight_sorties(t1);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        //失联动作
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyFailsafeAction), this, new CommonCallbacks.KeyListener<FailsafeAction>() {
+            @Override
+            public void onValueChange(@Nullable FailsafeAction failsafeAction, @Nullable FailsafeAction t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setRc_lost_action(t1.value());
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        //返航高度
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyGoHomeHeight), this, new CommonCallbacks.KeyListener<Integer>() {
+            @Override
+            public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setRth_altitude(t1);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        //限高
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyHeightLimit), this, new CommonCallbacks.KeyListener<Integer>() {
+            @Override
+            public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setHeight_limit(t1);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        //是否接近限高
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyIsNearHeightLimit), this, new CommonCallbacks.KeyListener<Boolean>() {
+            @Override
+            public void onValueChange(@Nullable Boolean aBoolean, @Nullable Boolean t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setIs_near_height_limit(t1 ? 1 : 0);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        //是否接近设定的限制距离
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyIsNearDistanceLimit), this, new CommonCallbacks.KeyListener<Boolean>() {
+            @Override
+            public void onValueChange(@Nullable Boolean aBoolean, @Nullable Boolean t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setIs_near_distance_limit(t1 ? 1 : 0);
+                    Movement.getInstance().setIs_near_area_limit(t1 ? 1 : 0);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        //是否开启限远
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyDistanceLimitEnabled), this, new CommonCallbacks.KeyListener<Boolean>() {
+            @Override
+            public void onValueChange(@Nullable Boolean aBoolean, @Nullable Boolean t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setIs_near_distance_limit(t1 ? 1 : 0);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        //限远
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyDistanceLimit), this, new CommonCallbacks.KeyListener<Integer>() {
+            @Override
+            public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setDistance_limit(t1);
+                }
+                pushFlightAttitude();
+            }
+        });
+
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyLowBatteryWarningThreshold), this, new CommonCallbacks.KeyListener<Integer>() {
+            @Override
+            public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setLowBatteryWarningThreshold(t1);
+                    pushFlightAttitude();
+                }
+            }
+        });
+
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeySeriousLowBatteryWarningThreshold), this, new CommonCallbacks.KeyListener<Integer>() {
+            @Override
+            public void onValueChange(@Nullable Integer integer, @Nullable Integer t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setSeriousLowBatteryWarningThreshold(t1);
+                    pushFlightAttitude();
+                }
+            }
+        });
+        KeyManager.getInstance().listen(createKey(FlightControllerKey.KeyLowBatteryRTHEnabled), this, new CommonCallbacks.KeyListener<Boolean>() {
+            @Override
+            public void onValueChange(@Nullable Boolean aBoolean, @Nullable Boolean t1) {
+                if (t1 != null) {
+                    Movement.getInstance().setLowBatteryRTHEnabled(t1 ? 1 : 0);
+                    pushFlightAttitude();
+                }
+            }
+        });
+    }
     }
 
     //标识是否降落后触发关舱门
@@ -754,7 +767,7 @@ public class FlightManager extends BaseManager {
         //降落时将云台朝下
         gimbalDownwards();
         //返航时将云台归中,曝光ISO降低
-        //gimbalAndCameraReset();
+        gimbalAndCameraReset();
         //开始视觉识别降落
         checkAndStartVisionLanding();
         //触发入库
@@ -800,7 +813,7 @@ public class FlightManager extends BaseManager {
 
     private void closeCabinDoor() {
         // 获取飞行状态和航线状态
-        boolean isFlyingAndHeightOk = isFlying && Movement.getInstance().getElevation() > 10;
+        boolean isFlyingAndHeightOk = isFlying && Movement.getInstance().getElevation() > 10 && Movement.getInstance().getElevation()>30;
         boolean isDebugMode = PreferenceUtils.getInstance().getIsDebugMode();
         String missionState = Movement.getInstance().getWaypointMissionExecuteState();
         boolean isMissionExecuting = (!TextUtils.isEmpty(missionState) &&
@@ -882,7 +895,7 @@ public class FlightManager extends BaseManager {
     }
 
 
-    private static final double FLYING_HEIGHT_THRESHOLD_MAX = 6;
+    private static final double FLYING_HEIGHT_THRESHOLD_MAX = 15;
     private static final double FLYING_HEIGHT_THRESHOLD_MAX_ALTERNATE = 10;
     private static final double FLYING_HEIGHT_THRESHOLD_MIN = -2;
     private static final double FLYING_HEIGHT_THRESHOLD_MIN_ALTERNATE = 2.0;
@@ -895,7 +908,7 @@ public class FlightManager extends BaseManager {
         boolean needTriggerAlterArucoLand = PreferenceUtils.getInstance().getNeedTriggerAlterArucoLand();
         double thresholdMax = triggerToAlternatePoint ? FLYING_HEIGHT_THRESHOLD_MAX_ALTERNATE : FLYING_HEIGHT_THRESHOLD_MAX;
 
-        if (isFlying && (Movement.getInstance().getElevation() < thresholdMax || Movement.getInstance().getUltrasonicHeight()<45)&& !isSendDetect) {
+        if (isFlying && (Movement.getInstance().getElevation() < thresholdMax && Movement.getInstance().getUltrasonicHeight()<50)&& !isSendDetect) {
             double flyingHeight = Movement.getInstance().getElevation();
             double thresholdMin = triggerToAlternatePoint ? FLYING_HEIGHT_THRESHOLD_MIN_ALTERNATE : FLYING_HEIGHT_THRESHOLD_MIN;
 
@@ -981,7 +994,6 @@ public class FlightManager extends BaseManager {
      * @return
      */
     private boolean shouldStopVisionAndLanding() {
-
         //记录isFlying || isMotorsOn可能桨叶在转但是飞机不在飞的情况，可能导致不触发landing
         if (PreferenceUtils.getInstance().getNeedTriggerAlterArucoLand()) {
             return !isTriggerLanding && (isFlying || isMotorsOn) && AlternateArucoDetect.getInstance().isCanLanding();
@@ -991,13 +1003,10 @@ public class FlightManager extends BaseManager {
                             && ApronArucoDetect.getInstance().getCheckThrowingErrorsTimes() > 100));
         }
     }
-
     private void logLandingHeight(int i) {
         LogUtil.log(TAG, "降落高度" + Movement.getInstance().getElevation() + "米---"
                 + Movement.getInstance().getUltrasonicHeight() + "分米");
     }
-
-
     private void droneStorage() {
         boolean isDebugMode = PreferenceUtils.getInstance().getIsDebugMode();
         // 检查无人机是否满足降落和入库的条件
@@ -1022,6 +1031,9 @@ public class FlightManager extends BaseManager {
                 }
                 // 上传媒体文件
                 SystemManager.getInstance().upLoadMedia(MqttManager.getInstance().mqttAndroidClient);
+                sendEvent2Server("开始上传日志文件",1);
+                //上传日志文件
+                LogUploadManager.getInstance().uploadTodayLog();
             }
             // 避免在下次起飞时触发视觉识别
             PreferenceUtils.getInstance().setNeedTriggerApronArucoLand(false);
@@ -1036,6 +1048,14 @@ public class FlightManager extends BaseManager {
             //原有那个替换
             Movement.getInstance().setMissionFinish1(true);
 
+            //再发送一遍这个一键起飞事件的结果
+            if(Movement.getInstance().isIstakeoffex()==true){
+                Movement.getInstance().setTakeoff_status("task_finish");
+                TakeoffProgressScheduler.getInstance().sendProgressReport();
+            }
+
+
+
             Movement.getInstance().setTask_current_step(25);
             sendOpenCabinDoorMsg = false;
         }
@@ -1275,7 +1295,6 @@ public class FlightManager extends BaseManager {
                 Movement.getInstance().setMode_code(3);
                 OSDManager.getInstance().pushFlightAttitude();
             }
-
             @Override
             public void onFailure(@NonNull IDJIError error) {
                 sendFailMsg2Server(message, "紧急悬停获得控制权失败" + getIDJIErrorMsg(error));
diff --git a/app/src/main/java/com/aros/apron/manager/FlightTaskProgressManager.java b/app/src/main/java/com/aros/apron/manager/FlightTaskProgressManager.java
index 4dd22180..ea95e338 100644
--- a/app/src/main/java/com/aros/apron/manager/FlightTaskProgressManager.java
+++ b/app/src/main/java/com/aros/apron/manager/FlightTaskProgressManager.java
@@ -31,17 +31,17 @@ public class FlightTaskProgressManager extends BaseManager {
             lastExecuteTime = now;
 
             //如果是一键起飞航线或之后的指点飞行，这个就不用发，除此之外航线以及指点飞行都要发
-//            if (PreferenceUtils.getInstance().getMissionType()==0 &&(Movement.getInstance().isPlaneWing()
-//                    || Movement.getInstance().isMotorsOn()
-//                    || Movement.getInstance().isMissionFinish1())) {
-//
-//                sendFlightTaskProgress2Server();
-//
-//            }
-            //只要一个满足就上报
-            if (Movement.getInstance().isPlaneWing() || Movement.getInstance().isMotorsOn()) {
+            if (Movement.getInstance().getMission_type()==0&&(Movement.getInstance().isPlaneWing()
+                    || Movement.getInstance().isMotorsOn()
+                    || Movement.getInstance().isMissionFinish1())) {
+
                 sendFlightTaskProgress2Server();
+
             }
+////            //只要一个满足就上报
+//            if (Movement.getInstance().isPlaneWing() || Movement.getInstance().isMotorsOn()) {
+//                sendFlightTaskProgress2Server();
+//            }
             if (Movement.getInstance().isMissionFinish1()) {
                 sendFlightTaskProgress2Server();
                 handler.removeCallbacks(this);
diff --git a/app/src/main/java/com/aros/apron/manager/FlyToPointManager.java b/app/src/main/java/com/aros/apron/manager/FlyToPointManager.java
index 39fb3f56..06f58ace 100644
--- a/app/src/main/java/com/aros/apron/manager/FlyToPointManager.java
+++ b/app/src/main/java/com/aros/apron/manager/FlyToPointManager.java
@@ -177,7 +177,7 @@ public class FlyToPointManager extends BaseManager {
                     sendEvent2Server("指点航线上传失败:"+ Utils.getIDJIErrorMsg(error),2);
                    //待机
                     Movement.getInstance().setMode_code(0);
-                   sendFlightTaskProgress2Server();
+
                 }
             });
         }
@@ -200,12 +200,10 @@ public class FlyToPointManager extends BaseManager {
                     Movement.getInstance().setTask_status("paused");
                     sendEvent2Server("任务开始执行", 1);
                     Movement.getInstance().setTask_current_step(23);
-                    sendFlightTaskProgress2Server();
 //                    Movement.getInstance().setMode_code(5);
-
                     //指令飞行( 指点前置不需要起飞准备这些因为没有指点起飞的航线)
                      Movement.getInstance().setMode_code(17);
-                     sendFlightTaskProgress2Server();
+
                 }
 
                 @Override
@@ -214,7 +212,7 @@ public class FlyToPointManager extends BaseManager {
                     sendEvent2Server("指点航线执行失败:" + new Gson().toJson(error),2);
                     //待机
                     Movement.getInstance().setMode_code(0);
-                    sendFlightTaskProgress2Server();
+
 
                 }
             };
@@ -235,7 +233,7 @@ public class FlyToPointManager extends BaseManager {
                     sendMsg2Server(message);
                     LogUtil.log(TAG, "指点任务终止成功");
                     Movement.getInstance().setTask_status("paused");
-                    sendFlightTaskProgress2Server();
+
                 }
 
                 @Override
diff --git a/app/src/main/java/com/aros/apron/manager/GimbalManager.java b/app/src/main/java/com/aros/apron/manager/GimbalManager.java
index f1b5ead8..b32b70f1 100644
--- a/app/src/main/java/com/aros/apron/manager/GimbalManager.java
+++ b/app/src/main/java/com/aros/apron/manager/GimbalManager.java
@@ -16,6 +16,7 @@ import com.aros.apron.tools.LogUtil;
 import com.aros.apron.tools.PreferenceUtils;
 import com.google.gson.Gson;
 
+import dji.sdk.keyvalue.key.CameraKey;
 import dji.sdk.keyvalue.key.FlightControllerKey;
 import dji.sdk.keyvalue.key.GimbalKey;
 import dji.sdk.keyvalue.key.KeyTools;
@@ -57,8 +58,9 @@ public class GimbalManager extends BaseManager {
     public void initGimbalInfo() {
         ApronArucoDetect.getInstance().setDoublePayload(PreferenceUtils.getInstance().getCameraLocationType() == 2);
         LogUtil.log(TAG, "主摄像头位置:" + PreferenceUtils.getInstance().getCameraLocationType());
-        Boolean gimBalIsConnect = KeyManager.getInstance().getValue(createKey(GimbalKey.KeyConnection, ComponentIndexType.PORT_1));
-        if (gimBalIsConnect != null && gimBalIsConnect) {
+        Boolean isConnect = KeyManager.getInstance().getValue(KeyTools.createKey(FlightControllerKey.KeyConnection));
+
+        if (isConnect != null && isConnect) {
             KeyManager.getInstance().listen(createKey(GimbalKey.KeyGimbalAttitude, ComponentIndexType.PORT_1), this, new CommonCallbacks.KeyListener<Attitude>() {
                 @Override
                 public void onValueChange(@Nullable Attitude oldValue, @Nullable Attitude newValue) {
diff --git a/app/src/main/java/com/aros/apron/manager/MissionV3Manager.java b/app/src/main/java/com/aros/apron/manager/MissionV3Manager.java
index 369359b3..e83a3ddf 100644
--- a/app/src/main/java/com/aros/apron/manager/MissionV3Manager.java
+++ b/app/src/main/java/com/aros/apron/manager/MissionV3Manager.java
@@ -17,6 +17,7 @@ import com.aros.apron.constant.ErrorCode;
 import com.aros.apron.entity.CurrentWayline;
 import com.aros.apron.entity.MessageDown;
 import com.aros.apron.entity.Movement;
+import com.aros.apron.entity.Synchronizedstatus;
 import com.aros.apron.tools.LogUtil;
 import com.aros.apron.tools.PreferenceUtils;
 import com.aros.apron.tools.RestartAPPTool;
@@ -76,13 +77,68 @@ public class MissionV3Manager extends BaseManager {
     //在ENTER_WAYLINE后10秒，航线状态变为FINISH，此时无人机不起飞/悬停
     private long enterWayLineTime;
     private long finishWayLineTime;
+    private boolean istakeoff_ok = false;
+    private int taskRestartFailTimes = 0;
+
+    private int totalretryStartMissiontimes = 0;
+
+    /**
+     * 重试启动任务
+     */
+    private void retryStartMission() {
+        if (totalretryStartMissiontimes > 51) {
+            LogUtil.log(TAG, "尝试重启总次数大于50");
+            sendEvent2Server("尝试重启总次数大于50", 2);
+            if (!Movement.getInstance().isPlaneWing() || !Movement.getInstance().isMotorsOn()) {
+                TaskFailManager.getInstance().sendTaskFailMsg2Server(-1);
+            }
+            return;
+        }
+        if (taskRestartFailTimes >= 50) {
+            LogUtil.log(TAG, "任务重启失败次数达到上限，发送任务失败");
+            sendEvent2Server("任务非正常结束，重启失败", 2);
+            TaskFailManager.getInstance().sendTaskFailMsg2Server(-1);
+            return;
+        }
+
+        taskRestartFailTimes++;
+        LogUtil.log(TAG, "任务非正常结束，第" + taskRestartFailTimes + "次尝试重新启动");
+        sendEvent2Server("任务非正常结束，第" + taskRestartFailTimes + "次尝试重新启动", 1);
+
+        WaypointMissionManager.getInstance().startMission(Movement.getInstance().getWaylinename(), new CommonCallbacks.CompletionCallback() {
+            @Override
+            public void onSuccess() {
+                isMissionStart = true;
+                taskRestartFailTimes = 0;
+                LogUtil.log(TAG, "任务非正常结束，重启成功");
+                sendEvent2Server("任务非正常结束，重启成功", 1);
+            }
+
+            @Override
+            public void onFailure(@NonNull IDJIError idjiError) {
+                LogUtil.log(TAG, "任务非正常结束，第" + taskRestartFailTimes + "次重启失败：" + idjiError.toString());
+                sendEvent2Server("任务非正常结束，第" + taskRestartFailTimes + "次重启失败", 1);
+
+                // 延迟后再次尝试
+                mainHandler.postDelayed(new Runnable() {
+                    @Override
+                    public void run() {
+                        retryStartMission();
+                    }
+                }, 3000);
+            }
+        });
+    }
 
     public void initMissionManager() {
-
         Boolean isConnect = KeyManager.getInstance().getValue(KeyTools.createKey(FlightControllerKey.
                 KeyConnection));
-        if (isConnect != null && isConnect) {
-            WaypointMissionManager waypointMissionManager = WaypointMissionManager.getInstance();
+        WaypointMissionManager waypointMissionManager = WaypointMissionManager.getInstance();
+        waypointMissionManager.init();
+
+        // 延迟2s后注册监听
+        new Handler(Looper.getMainLooper()).postDelayed(() -> {
+
             waypointMissionManager.addWaypointMissionExecuteStateListener(new WaypointMissionExecuteStateListener() {
                 @Override
                 public void onMissionStateUpdate(WaypointMissionExecuteState missionState) {
@@ -102,14 +158,13 @@ public class MissionV3Manager extends BaseManager {
                                 //这个是原来可控制那个发送最终状态的逻辑
                                 Movement.getInstance().setMissionFinish1(false);
 
-                                sendFlightTaskProgress2Server();
+
                                 break;
                             case READY:
-                                if(Movement.getInstance().getFlightmode()==2){
+                                if (Movement.getInstance().getFlightmode() == 2 && istakeoff_ok == false) {
                                     Movement.getInstance().setTakeoff_status("task_ready");
                                 }
-
-                                if (PreferenceUtils.getInstance().getMissionType()==2
+                                if (PreferenceUtils.getInstance().getMissionType() == 2
                                 ) {
                                     Movement.getInstance().setTask_status("paused");
                                 } else {
@@ -118,11 +173,11 @@ public class MissionV3Manager extends BaseManager {
                                 sendEvent2Server("任务状态:准备中", 1);
                                 break;
                             case UPLOADING:
-                                if (PreferenceUtils.getInstance().getMissionType()==2
+                                if (PreferenceUtils.getInstance().getMissionType() == 2
                                 ) {
                                     Movement.getInstance().setTask_status("paused");
                                 } else {
-                                    Movement.getInstance().setTask_status("sent");
+                                    Movement.getInstance().setTask_status("in_progress");
                                 }
                                 sendEvent2Server("任务状态:上传中", 1);
                                 Movement.getInstance().setVirtualStickQuitMission(false);
@@ -131,10 +186,10 @@ public class MissionV3Manager extends BaseManager {
                                 //这个是原来可控制那个发送最终状态的逻辑
                                 Movement.getInstance().setMissionFinish1(false);
 
-                                sendFlightTaskProgress2Server();
+
                                 break;
                             case PREPARING:
-                                if (PreferenceUtils.getInstance().getMissionType()==2
+                                if (PreferenceUtils.getInstance().getMissionType() == 2
                                 ) {
                                     Movement.getInstance().setTask_status("paused");
                                 } else {
@@ -147,35 +202,35 @@ public class MissionV3Manager extends BaseManager {
                                 //这个是原来可控制那个发送最终状态的逻辑
                                 Movement.getInstance().setMissionFinish1(false);
 
-                                sendFlightTaskProgress2Server();
+
                                 break;
                             case ENTER_WAYLINE:
                                 enterWayLineTime = System.currentTimeMillis();
-                                if(Movement.getInstance().getFlightmode()==2){
+                                if (Movement.getInstance().getFlightmode() == 2) {
                                     Movement.getInstance().setTakeoff_status("wayline_progress");
                                 }
 
-
-                                if (PreferenceUtils.getInstance().getMissionType()==2
+                                if (PreferenceUtils.getInstance().getMissionType() == 2
                                 ) {
                                     Movement.getInstance().setTask_status("paused");
                                 } else {
                                     Movement.getInstance().setTask_status("in_progress");
                                 }
+
                                 Movement.getInstance().setVirtualStickQuitMission(false);
                                 sendEvent2Server("任务状态:进入航线飞行,飞往指定航线的第一个航点", 1);
-                                sendFlightTaskProgress2Server();
+
                                 Movement.getInstance().setMissionFinish(false);
 
                                 //这个是原来可控制那个发送最终状态的逻辑
                                 Movement.getInstance().setMissionFinish1(false);
-                                sendFlightTaskProgress2Server();
+
 
                                 //航线飞行
-                                if(Movement.getInstance().getFlightmode()==1){
+                                if (Movement.getInstance().getFlightmode() == 1) {
 
                                     Movement.getInstance().setMode_code(5);
-                                }else if(Movement.getInstance().getFlightmode()==2){
+                                } else if (Movement.getInstance().getFlightmode() == 2) {
                                     //指令飞行
                                     Movement.getInstance().setMode_code(17);
                                 }
@@ -184,7 +239,7 @@ public class MissionV3Manager extends BaseManager {
                             case EXECUTING:
                                 sendEvent2Server("任务状态:航线任务执行中", 1);
 
-                                if (PreferenceUtils.getInstance().getMissionType()==2
+                                if (PreferenceUtils.getInstance().getMissionType() == 2
                                 ) {
                                     Movement.getInstance().setTask_status("paused");
                                 } else {
@@ -195,11 +250,10 @@ public class MissionV3Manager extends BaseManager {
 
                                 //这个是原来可控制那个发送最终状态的逻辑
                                 Movement.getInstance().setMissionFinish1(false);
-                                sendFlightTaskProgress2Server();
+
                                 break;
                             case INTERRUPTED:
-
-                                if(Movement.getInstance().getFlightmode()==2){
+                                if (Movement.getInstance().getFlightmode() == 2) {
                                     Movement.getInstance().setTakeoff_status("wayline_cancel");
                                 }
 
@@ -210,7 +264,7 @@ public class MissionV3Manager extends BaseManager {
 
                                 //这个是原来可控制那个发送最终状态的逻辑
                                 Movement.getInstance().setMissionFinish1(false);
-                                sendFlightTaskProgress2Server();
+
 
                                 //切换成手动飞行
                                 //Movement.getInstance().setMode_code(3);
@@ -219,7 +273,7 @@ public class MissionV3Manager extends BaseManager {
                             case RECOVERING:
                                 Movement.getInstance().setVirtualStickQuitMission(false);
                                 sendEvent2Server("任务状态:航线任务恢复中", 1);
-                                if (PreferenceUtils.getInstance().getMissionType()==2
+                                if (PreferenceUtils.getInstance().getMissionType() == 2
                                 ) {
                                     Movement.getInstance().setTask_status("paused");
                                 } else {
@@ -229,50 +283,60 @@ public class MissionV3Manager extends BaseManager {
 
                                 //这个是原来可控制那个发送最终状态的逻辑
                                 Movement.getInstance().setMissionFinish1(false);
-                                sendFlightTaskProgress2Server();
+
                                 break;
                             case FINISHED:
+                                //释放锁
+                                Synchronizedstatus.setFlighttaskExecuteStatus(false);
+
+
 
                                 //如果是虚拟摇杆导致的退出应该要可恢复
-                                if(Movement.getInstance().getMode_code()==16){
+                                if (Movement.getInstance().getMode_code() == 16) {
                                     PreferenceUtils.getInstance().setMissionType(2);
-                                }else{
+                                } else {
 
                                 }
-                                if(Movement.getInstance().getFlightmode()==2){
-                                    Movement.getInstance().setTakeoff_status("task_finish");
-                                    Movement.getInstance().setTakeoff_status("wayline_ok");
 
+                                if (Movement.getInstance().getFlightmode() == 2) {
+                                    //
+                                    LogUtil.log(TAG, "设置成mode3");
+                                    Movement.getInstance().setMode_code(3);
+                                    istakeoff_ok = true;
+                                    Movement.getInstance().setTakeoff_status("wayline_ok");
                                     new Handler(Looper.getMainLooper()).postDelayed(new Runnable() {
                                         @Override
                                         public void run() {
                                             TakeoffProgressScheduler.getInstance().stopReporting();
                                         }
-                                    }, 1000); // 1000ms = 1秒
+                                    }, 2000); // 1000ms = 1秒
                                 }
 
                                 finishWayLineTime = System.currentTimeMillis();
+
                                 mainHandler.postDelayed(new Runnable() {
                                     @Override
                                     public void run() {
-                                        if (finishWayLineTime - enterWayLineTime <= 11000 && !Movement.getInstance().isPlaneWing()
+                                        if (finishWayLineTime - enterWayLineTime <= 8000 && !Movement.getInstance().isPlaneWing()
                                         ) {
-                                            sendEvent2Server("任务非正常结束", 2);
-                                            TaskFailManager.getInstance().sendTaskFailMsg2Server(-1);
+                                            isMissionStart = false;
+                                            totalretryStartMissiontimes++;
+                                            retryStartMission();
                                         }
                                     }
                                 }, 5000);
+
                                 //需要在这里保存下来机头角度，index等断点，在降落后若查询到断点，在拼接起来
-                                PreferenceUtils.getInstance().setAttitudeHead(Movement.getInstance().getAttitude_head()+"");
-                                PreferenceUtils.getInstance().setWaypointIndex(Movement.getInstance().getCurrentWaypointIndex()+"");
+                                PreferenceUtils.getInstance().setAttitudeHead(Movement.getInstance().getAttitude_head() + "");
+                                PreferenceUtils.getInstance().setWaypointIndex(Movement.getInstance().getCurrentWaypointIndex() + "");
                                 queryBreakPoint();
-                                sendFlightTaskProgress2Server();
+
                                 break;
                             case RETURN_TO_START_POINT:
                                 //自动返航
                                 Movement.getInstance().setMode_code(9);
 
-                                if (PreferenceUtils.getInstance().getMissionType()==2
+                                if (PreferenceUtils.getInstance().getMissionType() == 2
                                 ) {
                                     Movement.getInstance().setTask_status("paused");
                                 } else {
@@ -282,7 +346,7 @@ public class MissionV3Manager extends BaseManager {
 
                                 //这个是原来可控制那个发送最终状态的逻辑
                                 Movement.getInstance().setMissionFinish1(false);
-                                sendFlightTaskProgress2Server();
+
                                 break;
                         }
                         LogUtil.log(TAG, "WaypointMissionExecuteState:" + missionState.name());
@@ -292,6 +356,7 @@ public class MissionV3Manager extends BaseManager {
                     }
                 }
             });
+
             waypointMissionManager.addWaylineExecutingInfoListener(new WaylineExecutingInfoListener() {
                 @Override
                 public void onWaylineExecutingInfoUpdate(WaylineExecutingInfo excutingWaylineInfo) {
@@ -330,13 +395,14 @@ public class MissionV3Manager extends BaseManager {
                 }
             });
 
-        }
+        }, 2000); // 参数别改：2s延迟
     }
 
     //收到航线
     public void taskExecute(MessageDown message) {
 
         PreferenceUtils.getInstance().setMissionType(0);
+        Movement.getInstance().setMission_type(0);
         PreferenceUtils.getInstance().setFlightId(message.getData().getFlight_id());
         PreferenceUtils.getInstance().setAlternatePointLon(message.getData().getAlternate_land_point().getLongitude() + "");
         PreferenceUtils.getInstance().setAlternatePointLat(message.getData().getAlternate_land_point().getLatitude() + "");
@@ -346,12 +412,12 @@ public class MissionV3Manager extends BaseManager {
         KeyManager.getInstance().setValue(KeyTools.createKey(FlightControllerKey.KeyGoHomeHeight), message.getData().getRth_altitude(), new CommonCallbacks.CompletionCallback() {
             @Override
             public void onSuccess() {
-                LogUtil.log(TAG,"设置全局返航高度成功");
+                LogUtil.log(TAG, "设置全局返航高度成功");
             }
 
             @Override
             public void onFailure(@NonNull IDJIError idjiError) {
-                LogUtil.log(TAG,"设置全局返航高度失败");
+                LogUtil.log(TAG, "设置全局返航高度失败");
             }
         });
 
@@ -365,12 +431,12 @@ public class MissionV3Manager extends BaseManager {
                 isReceiverMission = true;
             }
             //2.回复收到指令
-            sendMsg2Server(message);
+
             //3.检查飞机状态（不满足条件直接taskFail入库）
             boolean statusOk = verifyAircraftStatus(message);
             //4.信号收敛(等待GPS搜星)
             if (statusOk) {
-                sendEvent2Server("条件满足进入自建和下发航线",1);
+                sendEvent2Server("条件满足进入自建和下发航线", 1);
                 verifyGpsAndMissionState(message);
             }
         });
@@ -389,6 +455,7 @@ public class MissionV3Manager extends BaseManager {
             }
             //2.关闭避障
             PerceptionManager.getInstance().setPerceptionEnable(false);
+
             PerceptionManager.getInstance().setObstacleAvoidanceHorizontalEnabled(false);
             //3.清空sd卡
             CameraManager.getInstance().formatStorage(null);
@@ -445,22 +512,23 @@ public class MissionV3Manager extends BaseManager {
         int missionStateCode = Movement.getInstance().getMissionStateCode();
         String planeMessage = Movement.getInstance().getPlaneMessage();
         int quality = Movement.getInstance().getQuality();
-        int GPSSatelliteCount=Movement.getInstance().getGPSSatelliteCount();
+        int GPSSatelliteCount = Movement.getInstance().getGPSSatelliteCount();
 
         boolean isMissionStateValid = (missionStateCode == 2 || missionStateCode == 0 || missionStateCode == 7);
         boolean isPlaneMessageValid = !TextUtils.isEmpty(planeMessage) && !planeMessage.equals("无法起飞");
         boolean isGpsQualityValid = (quality == 4 || quality == 5 || quality == 10);
-        boolean GPSSatelliteCountValid=GPSSatelliteCount>15;
+        boolean GPSSatelliteCountValid = GPSSatelliteCount > 15;
 
-        LogUtil.log(TAG,"isMissionStateValid"+isMissionStateValid+"isPlaneMessageValid"+isPlaneMessageValid+"isGpsQualityValid"+isGpsQualityValid);
+        LogUtil.log(TAG, "isMissionStateValid" + isMissionStateValid + "isPlaneMessageValid" + isPlaneMessageValid + "isGpsQualityValid" + isGpsQualityValid);
 //        if (isMissionStateValid && isPlaneMessageValid && isGpsQualityValid) {
 
-        sendEvent2Server("卫星数量"+GPSSatelliteCount+"gps是否ok"+GPSSatelliteCountValid,1);
-        if (isGpsQualityValid||GPSSatelliteCountValid) {
+        sendEvent2Server("卫星数量" + GPSSatelliteCount + "gps是否ok" + GPSSatelliteCountValid, 1);
+        if (isGpsQualityValid || GPSSatelliteCountValid) {
             //5.下载航线
             downLoadKMZFile(message);
-            sendEvent2Server("执行下载航线成功",1);
+            sendEvent2Server("执行下载航线成功", 1);
             verifyGpsAndMissionStateSuccess = true;
+            Movement.getInstance().setIs_fixed(2);
         } else {
 
             if (!verifyGpsAndMissionStateSuccess) {
@@ -476,9 +544,9 @@ public class MissionV3Manager extends BaseManager {
                                     Movement.getInstance().getPlaneMessage() +
                                     "-GPS信号等级:" + Movement.getInstance().getQuality(), 1);
                         }
-                    },2000);
+                    }, 2000);
 
-                }else {
+                } else {
                     sendEvent2Server("飞行器自检异常:" + WaypointMissionExecuteState.find(missionStateCode).name() +
                             "-RTK:" + Movement.getInstance().getIs_fixed() + "-飞行器状态:" +
                             Movement.getInstance().getPlaneMessage() +
@@ -559,6 +627,7 @@ public class MissionV3Manager extends BaseManager {
 
     /**
      * 6.上传航线
+     *
      * @param message
      */
     private void pushKMZFileToAircraft(MessageDown message) {
@@ -575,9 +644,9 @@ public class MissionV3Manager extends BaseManager {
                     List<Wayline> waylines = waylineWaylinesParseInfo.getWaylines();
                     if (waylines != null && waylines.size() > 0) {
                         List<WaylineExecuteWaypoint> waypoints = waylines.get(0).getWaypoints();
-                        if (waypoints != null&&waypoints.size()>0) {
+                        if (waypoints != null && waypoints.size() > 0) {
 
-                                CurrentWayline.getInstance().setWaypoints(waypoints);
+                            CurrentWayline.getInstance().setWaypoints(waypoints);
 
                             LogUtil.log(TAG, "该航线有" + waypoints.size() + "个航点");
                         } else {
@@ -605,9 +674,11 @@ public class MissionV3Manager extends BaseManager {
 
                 @Override
                 public void onSuccess() {
+                    Movement.getInstance().setWaylinename("aros");
+
                     //	"2": "起飞准备完毕",
                     Movement.getInstance().setMode_code(2);
-                    LogUtil.log(TAG,"航线上传成功,准备执行任务");
+                    LogUtil.log(TAG, "航线上传成功,准备执行任务");
                     sendEvent2Server("航线上传成功,准备执行任务", 1);
                     isPushKMZSuccess = true;
                     mainHandler.postDelayed(new Runnable() {
@@ -619,7 +690,7 @@ public class MissionV3Manager extends BaseManager {
 
                             //自主起飞
                             Movement.getInstance().setMode_code(4);
-                            sendFlightTaskProgress2Server();
+
                             Movement.getInstance().setTask_current_step(22);
                             //关闭避障
                             PerceptionManager.getInstance().setPerceptionEnable(false);
@@ -651,7 +722,7 @@ public class MissionV3Manager extends BaseManager {
                         } else {
                             //待机
                             Movement.getInstance().setMode_code(0);
-                            sendFlightTaskProgress2Server();
+
 
                             sendEvent2Server("航线第" + pushKMZFileTimes + "次上传失败,直接关机", 2);
                             TaskFailManager.getInstance().sendTaskFailMsg2Server(-1);
@@ -669,6 +740,7 @@ public class MissionV3Manager extends BaseManager {
 
     /**
      * 6.开始航线
+     *
      * @param message
      */
     public void startMission(MessageDown message) {
@@ -681,7 +753,7 @@ public class MissionV3Manager extends BaseManager {
             PreferenceUtils.getInstance().setNeedTriggerAlterArucoLand(false);
             PreferenceUtils.getInstance().setTriggerToAlternatePoint(false);
             PreferenceUtils.getInstance().setFlightId(message.getData().getFlight_id());
-            CommonCallbacks.CompletionCallback callback= new CommonCallbacks.CompletionCallback() {
+            CommonCallbacks.CompletionCallback callback = new CommonCallbacks.CompletionCallback() {
                 @Override
                 public void onSuccess() {
                     isMissionStart = true;
@@ -690,7 +762,7 @@ public class MissionV3Manager extends BaseManager {
                     startMissionFailTimes = 0;
                     sendEvent2Server("任务开始执行", 1);
                     Movement.getInstance().setTask_current_step(23);
-                    sendFlightTaskProgress2Server();
+
 //                    Movement.getInstance().setMode_code(5);
 
 //                    // 自动起飞
@@ -723,7 +795,7 @@ public class MissionV3Manager extends BaseManager {
 
                                     //待机
                                     Movement.getInstance().setMode_code(0);
-                                    sendFlightTaskProgress2Server();
+
 
                                     sendEvent2Server("航线第" + startMissionFailTimes + "次开始失败,直接关机:" + "---" + new Gson().toJson(error) + "--" + Movement.getInstance().getQuality(), 2);
                                     TaskFailManager.getInstance().sendTaskFailMsg2Server(-1);
@@ -736,15 +808,15 @@ public class MissionV3Manager extends BaseManager {
                 }
             };
 
-            if (message.getData()!=null&&message.getData().getBreak_point()!=null&&message.getData().getBreak_point().getIndex()>0){
-                BreakPointInfo breakPointInfo=new BreakPointInfo
+            if (message.getData() != null && message.getData().getBreak_point() != null && message.getData().getBreak_point().getIndex() > 0) {
+                BreakPointInfo breakPointInfo = new BreakPointInfo
                         (message.getData().getBreak_point().getWayline_id(),
                                 message.getData().getBreak_point().getIndex(),
                                 message.getData().getBreak_point().getProgress());
-                WaypointMissionManager.getInstance().startMission("aros",breakPointInfo,
+                WaypointMissionManager.getInstance().startMission("aros", breakPointInfo,
                         callback);
-            }else{
-                WaypointMissionManager.getInstance().startMission("aros",callback);
+            } else {
+                WaypointMissionManager.getInstance().startMission("aros", callback);
             }
 
         } else {
@@ -754,6 +826,7 @@ public class MissionV3Manager extends BaseManager {
 
     /**
      * 暂停航线
+     *
      * @param message
      */
     public void pauseMission(MessageDown message) {
@@ -767,7 +840,7 @@ public class MissionV3Manager extends BaseManager {
                 public void onSuccess() {
                     sendMsg2Server(message);
                     Movement.getInstance().setTask_status("paused");
-                    sendFlightTaskProgress2Server();
+
 
                     //暂停成功就是手动飞行
                     Movement.getInstance().setMode_code(3);
@@ -776,7 +849,7 @@ public class MissionV3Manager extends BaseManager {
 
                 @Override
                 public void onFailure(@NonNull IDJIError error) {
-                    sendFailMsg2Server( message, "航线任务暂停失败:" + getIDJIErrorMsg(error));
+                    sendFailMsg2Server(message, "航线任务暂停失败:" + getIDJIErrorMsg(error));
                 }
             });
         } else {
@@ -798,11 +871,11 @@ public class MissionV3Manager extends BaseManager {
                     public void onSuccess() {
                         sendMsg2Server(message);
                         Movement.getInstance().setTask_status("in_progress");
-                        sendFlightTaskProgress2Server();
+
                         //继续就是指令 或者 航线
-                        if(Movement.getInstance().getFlightmode()==1){
+                        if (Movement.getInstance().getFlightmode() == 1) {
                             Movement.getInstance().setMode_code(5);
-                        }else if(Movement.getInstance().getFlightmode()==2){
+                        } else if (Movement.getInstance().getFlightmode() == 2) {
                             Movement.getInstance().setMode_code(17);
                         }
 
@@ -830,8 +903,9 @@ public class MissionV3Manager extends BaseManager {
                                                     PreferenceUtils.getInstance().setIsNewRoute(false);
                                                     LogUtil.log(TAG, "恢复断点航线成功");
                                                     Movement.getInstance().setTask_status("in_progress");
-                                                    sendFlightTaskProgress2Server();
+
                                                 }
+
                                                 @Override
                                                 public void onFailure(@NonNull IDJIError idjiError) {
                                                     LogUtil.log(TAG, "恢复断点航线失败:" + getIDJIErrorMsg(idjiError));
@@ -844,6 +918,7 @@ public class MissionV3Manager extends BaseManager {
                             LogUtil.log(TAG, "未查询到断点信息");
                         }
                     }
+
                     @Override
                     public void onFailure(@NonNull IDJIError idjiError) {
                         LogUtil.log(TAG, "查询断点失败:" + getIDJIErrorMsg(idjiError));
diff --git a/app/src/main/java/com/aros/apron/manager/OSDManager.java b/app/src/main/java/com/aros/apron/manager/OSDManager.java
index 57137057..ccb49fee 100644
--- a/app/src/main/java/com/aros/apron/manager/OSDManager.java
+++ b/app/src/main/java/com/aros/apron/manager/OSDManager.java
@@ -16,6 +16,7 @@ import com.aros.apron.entity.Movement;
 import com.aros.apron.entity.Osd;
 import com.aros.apron.tools.LogUtil;
 import com.aros.apron.tools.MqttManager;
+import com.aros.apron.tools.TakeoffProgressScheduler;
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
 
@@ -72,10 +73,10 @@ public class OSDManager extends BaseManager {
                 if (isConnect != null && isConnect) {
                     pushFlightAttitude();
                 } else {
-                    LogUtil.log(TAG, "osd stop:flight controller is null");
+                    LogUtil.log(TAG, "osd stop1:flight controller is null");
                 }
             } else {
-                LogUtil.log(TAG, "osd stop:flight controller is null");
+                LogUtil.log(TAG, "osd stop2:flight controller is null");
             }
             // 始终基于“实际执行时间”来调度
             handler.postDelayed(this, INTERVAL);
@@ -258,6 +259,27 @@ public class OSDManager extends BaseManager {
             data.setVertical_speed(Movement.getInstance().getVertical_speed());
             data.setWind_direction(Movement.getInstance().getWind_direction());
             data.setWind_speed(Movement.getInstance().getWind_speed());
+
+            Osd.Data.MaintainStatus maintainStatus = new Osd.Data.MaintainStatus();
+            Osd.Data.MaintainStatus.MaintainStatusArray maintainItem = new Osd.Data.MaintainStatus.MaintainStatusArray();
+            // state: 保养状态, enum_int, 0:无保养, 1:有保养
+            maintainItem.setState(0);
+            // last_maintain_type: 上一次保养类型, enum_int, 1:基础, 2:常规, 3:深度
+            // 默认值给 0 表示未设置（无保养历史）
+            maintainItem.setLast_maintain_type(1);
+            // last_maintain_time: 上一次保养时间, date, 秒级时间戳
+            // 默认值 0 表示无记录
+            maintainItem.setLast_maintain_time(0);
+            // last_maintain_flight_time: 上一次保养时航时, int, 单位:小时
+            maintainItem.setLast_maintain_flight_time(0);
+            // last_maintain_flight_sorties: 上一次保养时架次, int
+            maintainItem.setLast_maintain_flight_sorties(0);
+            java.util.ArrayList<Osd.Data.MaintainStatus.MaintainStatusArray> maintainList = new java.util.ArrayList<>();
+            maintainList.add(maintainItem);
+            maintainStatus.setMaintain_status_array(maintainList);
+            data.setMaintain_status(maintainStatus);
+
+
             data.setHomepoint_latitude(Movement.getInstance().getHomepoint_latitude());
             data.setHomepoint_longitude(Movement.getInstance().getHomepoint_longitude());
             data.setRtk_takeoff_altitude(Movement.getInstance().getRtk_takeoff_altitude());
diff --git a/app/src/main/java/com/aros/apron/manager/PerceptionManager.java b/app/src/main/java/com/aros/apron/manager/PerceptionManager.java
index 7d5d5a62..1708ee30 100644
--- a/app/src/main/java/com/aros/apron/manager/PerceptionManager.java
+++ b/app/src/main/java/com/aros/apron/manager/PerceptionManager.java
@@ -41,10 +41,9 @@ public class PerceptionManager extends BaseManager {
 
     public void setPerceptionEnable(boolean perceptionEnable) {
         if (PreferenceUtils.getInstance().getCloseObsEnable() && perceptionEnable) {
-            //LogUtil.log(TAG, "全局避障关闭,不开启避障");
+            LogUtil.log(TAG, "全局避障关闭,不开启避障");
             return;
         }
-
         Boolean isConnect = KeyManager.getInstance().getValue(createKey(FlightControllerKey.KeyConnection));
         if (isConnect != null && isConnect) {
 
diff --git a/app/src/main/java/com/aros/apron/manager/StickManager.java b/app/src/main/java/com/aros/apron/manager/StickManager.java
index 1b78da61..4b856660 100644
--- a/app/src/main/java/com/aros/apron/manager/StickManager.java
+++ b/app/src/main/java/com/aros/apron/manager/StickManager.java
@@ -95,7 +95,9 @@ public class StickManager extends BaseManager {
             @Override
             public void onSuccess() {
                 Movement.getInstance().setOpendrc(true);
+
                 if (message != null) {
+                    LogUtil.log(TAG, "DRC回复"+message);
                     sendMsg2Server(message);
                 }
 
@@ -128,7 +130,7 @@ public class StickManager extends BaseManager {
                     if(Movement.getInstance().getFlightmode()==1){
                         Movement.getInstance().setMode_code(5);
                     }else if(Movement.getInstance().getFlightmode()==2){
-                        Movement.getInstance().setMode_code(17);
+                        Movement.getInstance().setMode_code(3);
                     }
 
                     Movement.getInstance().setOpendrc(false);
@@ -150,7 +152,6 @@ public class StickManager extends BaseManager {
 
     //飞行控制权抢夺
     public void setVirtualStickModeEnabled(MessageDown message) {
-
         //Movement.getInstance().setMode_code(3);
         //设置标志为
         new Handler(Looper.getMainLooper()).postDelayed(() -> {
@@ -158,7 +159,7 @@ public class StickManager extends BaseManager {
             StickManager.getInstance().enableVirtualStick(message);
         }, 2000);
 
-        //sendMsg2Server(message);
+        sendMsg2Server(message);
 
 //////        Boolean isConnect = KeyManager.getInstance().getValue(KeyTools.createKey(FlightControllerKey.KeyConnection));
 //////        if (isConnect != null && isConnect) {
diff --git a/app/src/main/java/com/aros/apron/manager/StreamManager.java b/app/src/main/java/com/aros/apron/manager/StreamManager.java
index 79a67c15..aa6d16dc 100644
--- a/app/src/main/java/com/aros/apron/manager/StreamManager.java
+++ b/app/src/main/java/com/aros/apron/manager/StreamManager.java
@@ -1,6 +1,8 @@
 package com.aros.apron.manager;
 
+import android.content.Context;
 import android.os.Handler;
+import android.os.Looper;
 import android.util.Log;
 
 import androidx.annotation.NonNull;
@@ -10,10 +12,12 @@ import com.aros.apron.entity.MessageDown;
 import com.aros.apron.entity.Movement;
 import com.aros.apron.tools.LogUtil;
 import com.aros.apron.tools.PreferenceUtils;
+import com.aros.apron.tools.SimplePortScanner;
 import com.google.gson.Gson;
 
 import dji.sdk.keyvalue.key.CameraKey;
 import dji.sdk.keyvalue.key.DJIKey;
+import dji.sdk.keyvalue.key.FlightControllerKey;
 import dji.sdk.keyvalue.key.KeyTools;
 import dji.sdk.keyvalue.key.ProductKey;
 import dji.sdk.keyvalue.value.camera.CameraType;
@@ -47,6 +51,38 @@ public class StreamManager extends BaseManager {
     }
 
 
+    public void stopstream(){
+        ILiveStreamManager liveStreamManager = MediaDataCenter.getInstance().getLiveStreamManager();
+        liveStreamManager.stopStream(new CommonCallbacks.CompletionCallback() {
+            @Override
+            public void onSuccess() {
+                LogUtil.log(TAG,"直播关闭成功");
+            }
+
+            @Override
+            public void onFailure(@NonNull IDJIError idjiError) {
+                LogUtil.log(TAG,"直播关闭失败");
+            }
+        });
+
+    }
+    public void startstream(){
+        ILiveStreamManager liveStreamManager = MediaDataCenter.getInstance().getLiveStreamManager();
+        liveStreamManager.startStream(new CommonCallbacks.CompletionCallback() {
+            @Override
+            public void onSuccess() {
+                LogUtil.log(TAG,"直播开启成功");
+            }
+
+            @Override
+            public void onFailure(@NonNull IDJIError idjiError) {
+                LogUtil.log(TAG,"直播开启成功失败");
+            }
+        });
+
+    }
+
+
     public void initStreamManager() {
         ILiveStreamManager liveStreamManager = MediaDataCenter.getInstance().getLiveStreamManager();
         if (liveStreamManager != null) {
@@ -56,6 +92,7 @@ public class StreamManager extends BaseManager {
                     if (status != null) {
                         Movement.getInstance().setLiveStatus(status.isStreaming() ? 1 : 0);
                         Log.d(TAG, "推流状态" + status.isStreaming() + "帧率:" + status.getFps() + "--" + "码率:" + status.getVbps() + "---" + "延迟:" + status.getRtt());
+
                     }
                 }
 
@@ -98,7 +135,6 @@ public class StreamManager extends BaseManager {
 
     //知眸测试
     public void startLiveWithCustom() {
-
         Boolean isAircraftConnected = KeyManager.getInstance().getValue(DJIKey.create(ProductKey.KeyConnection));
         if (isAircraftConnected == null || !isAircraftConnected) {
             LogUtil.log(TAG, "飞行器未连接");
@@ -151,299 +187,54 @@ public class StreamManager extends BaseManager {
 
     private int isliveindex = 1; //1代表port 2代表fpv
 
-    public void switchptsp(ComponentIndexType ComponentIndex, MessageDown message) {
-        isLiveStreamAlreadyStart = false;
+    public void switchptspfpv(ComponentIndexType ComponentIndex, MessageDown message){
+        isliveindex=2;
         sendMsg2Server(message);
-        LogUtil.log(TAG, "收到回复" + message.toString());
-        if (ComponentIndex == ComponentIndexType.PORT_1 && isliveindex == 2) {
-            ILiveStreamManager liveStreamManager = MediaDataCenter.getInstance().getLiveStreamManager();
-            LogUtil.log(TAG, "自定义RTSP推流:" + PreferenceUtils.getInstance().getRtspUserName()
-                    + "--" + PreferenceUtils.getInstance().getRtspPort() + "--" + PreferenceUtils.getInstance().getRtspPassWord());
+        ILiveStreamManager liveStreamManager = MediaDataCenter.getInstance().getLiveStreamManager();
+        LogUtil.log(TAG, "切换RTSP推流fpv:" + PreferenceUtils.getInstance().getRtspUserName()
+                + "--" + PreferenceUtils.getInstance().getRtspPort() + "--" + PreferenceUtils.getInstance().getRtspPassWord());
 
-            LiveStreamSettings.Builder streamSettingBuilder = new LiveStreamSettings.Builder();
+        LiveStreamSettings.Builder streamSettingBuilder = new LiveStreamSettings.Builder();
 
-            LiveStreamSettings streamSettings = streamSettingBuilder.setLiveStreamType(LiveStreamType.RTSP)
-                    .setRtspSettings(new RtspSettings.Builder().setPassWord(PreferenceUtils.getInstance().getRtspPassWord()).
-                            setPort(Integer.parseInt(PreferenceUtils.getInstance().getRtspPort())).
-                            setUserName(PreferenceUtils.getInstance().getRtspUserName()).build()).build();
+        LiveStreamSettings streamSettings = streamSettingBuilder.setLiveStreamType(LiveStreamType.RTSP)
+                .setRtspSettings(new RtspSettings.Builder().setPassWord(PreferenceUtils.getInstance().getRtspPassWord()).
+                        setPort(Integer.parseInt(PreferenceUtils.getInstance().getRtspPort())).
+                        setUserName(PreferenceUtils.getInstance().getRtspUserName()).build()).build();
 
-            liveStreamManager.setLiveStreamSettings(streamSettings);
+        liveStreamManager.setLiveStreamSettings(streamSettings);
+
+        liveStreamManager.setCameraIndex(ComponentIndex);
+
+        liveStreamManager.setLiveStreamQuality(StreamQuality.FULL_HD);
+        liveStreamManager.setLiveVideoBitrateMode(LiveVideoBitrateMode.AUTO);
+    }
+
+    public void switchptspport(ComponentIndexType ComponentIndex, MessageDown message){
+        isliveindex=1;
+        sendMsg2Server(message);
+        ILiveStreamManager liveStreamManager = MediaDataCenter.getInstance().getLiveStreamManager();
+        LogUtil.log(TAG, "切换RTSP推流port:" + PreferenceUtils.getInstance().getRtspUserName()
+                + "--" + PreferenceUtils.getInstance().getRtspPort() + "--" + PreferenceUtils.getInstance().getRtspPassWord());
+
+        LiveStreamSettings.Builder streamSettingBuilder = new LiveStreamSettings.Builder();
+
+        LiveStreamSettings streamSettings = streamSettingBuilder.setLiveStreamType(LiveStreamType.RTSP)
+                .setRtspSettings(new RtspSettings.Builder().setPassWord(PreferenceUtils.getInstance().getRtspPassWord()).
+                        setPort(Integer.parseInt(PreferenceUtils.getInstance().getRtspPort())).
+                        setUserName(PreferenceUtils.getInstance().getRtspUserName()).build()).build();
+
+        liveStreamManager.setLiveStreamSettings(streamSettings);
 
 
-            CameraType value = KeyManager.getInstance().getValue(KeyTools.createKey(CameraKey.KeyCameraType, ComponentIndexType.PORT_1));
-
-            liveStreamManager.setCameraIndex(ComponentIndex);
-
-            liveStreamManager.setLiveStreamQuality(StreamQuality.FULL_HD);
-            liveStreamManager.setLiveVideoBitrateMode(LiveVideoBitrateMode.AUTO);
-            isliveindex = 1;
-
-
-        } else if (ComponentIndex == ComponentIndexType.FPV && isliveindex == 1) {
-            ILiveStreamManager liveStreamManager = MediaDataCenter.getInstance().getLiveStreamManager();
-            LogUtil.log(TAG, "自定义RTSP推流:" + PreferenceUtils.getInstance().getRtspUserName()
-                    + "--" + PreferenceUtils.getInstance().getRtspPort() + "--" + PreferenceUtils.getInstance().getRtspPassWord());
-
-            LiveStreamSettings.Builder streamSettingBuilder = new LiveStreamSettings.Builder();
-
-            LiveStreamSettings streamSettings = streamSettingBuilder.setLiveStreamType(LiveStreamType.RTSP)
-                    .setRtspSettings(new RtspSettings.Builder().setPassWord(PreferenceUtils.getInstance().getRtspPassWord()).
-                            setPort(Integer.parseInt(PreferenceUtils.getInstance().getRtspPort())).
-                            setUserName(PreferenceUtils.getInstance().getRtspUserName()).build()).build();
-
-            liveStreamManager.setLiveStreamSettings(streamSettings);
-
-
-            CameraType value = KeyManager.getInstance().getValue(KeyTools.createKey(CameraKey.KeyCameraType, ComponentIndexType.PORT_1));
-
-            liveStreamManager.setCameraIndex(ComponentIndex);
-
-            liveStreamManager.setLiveStreamQuality(StreamQuality.FULL_HD);
-            liveStreamManager.setLiveVideoBitrateMode(LiveVideoBitrateMode.AUTO);
-            isliveindex = 2;
-        }
-
-
-//        if (ComponentIndex==ComponentIndexType.PORT_1&&isliveindex==2){
-//            Boolean isAircraftConnected = KeyManager.getInstance().getValue(DJIKey.create(ProductKey.KeyConnection));
-//            if (isAircraftConnected == null || !isAircraftConnected) {
-//                LogUtil.log(TAG, "飞行器未连接");
-//            } else {
-//                if (PreferenceUtils.getInstance().getRtspUserName()!=null&&
-//                        PreferenceUtils.getInstance().getRtspPort()!=null&&
-//                        PreferenceUtils.getInstance().getRtspPassWord()!=null
-//                ){
-//                    ILiveStreamManager liveStreamManager = MediaDataCenter.getInstance().getLiveStreamManager();
-//                    LogUtil.log(TAG, "自定义RTSP推流:" + PreferenceUtils.getInstance().getRtspUserName()
-//                            +"--"+PreferenceUtils.getInstance().getRtspPort()+"--"+PreferenceUtils.getInstance().getRtspPassWord());
-//
-//                    LiveStreamSettings.Builder streamSettingBuilder = new LiveStreamSettings.Builder();
-//
-//                    LiveStreamSettings streamSettings = streamSettingBuilder.setLiveStreamType(LiveStreamType.RTSP)
-//                            .setRtspSettings(new RtspSettings.Builder().setPassWord(PreferenceUtils.getInstance().getRtspPassWord()).
-//                                    setPort(Integer.parseInt(PreferenceUtils.getInstance().getRtspPort())).
-//                                    setUserName(PreferenceUtils.getInstance().getRtspUserName()).build()).build();
-//
-//                    liveStreamManager.setLiveStreamSettings(streamSettings);
-//
-//
-//                    CameraType value = KeyManager.getInstance().getValue(KeyTools.createKey(CameraKey.KeyCameraType, ComponentIndexType.PORT_1));
-//
-//                    liveStreamManager.setCameraIndex(ComponentIndex);
-//
-//                    liveStreamManager.setLiveStreamQuality(StreamQuality.FULL_HD);
-//                    liveStreamManager.setLiveVideoBitrateMode(LiveVideoBitrateMode.AUTO);
-//
-//                    if (!liveStreamManager.isStreaming()) {
-//                        liveStreamManager.startStream(new CommonCallbacks.CompletionCallback() {
-//                            @Override
-//                            public void onSuccess() {
-//                                startLiveFailTimes=0;
-//                                LogUtil.log(TAG, "自定义RTSP推流启动成功");
-//                                isliveindex=1;
-//                                isLiveStreamAlreadyStart=true;
-//                                sendEvent2Server("切换视频流成功",1);
-//                            }
-//
-//                            @Override
-//                            public void onFailure(@NonNull IDJIError error) {
-//                                LogUtil.log(TAG, "第"+startLiveFailTimes+"次开始RTSP推流失败:"+new Gson().toJson(error));
-//                                if (!isLiveStreamAlreadyStart){
-//                                    new Handler().postDelayed(new Runnable() {
-//                                        @Override
-//                                        public void run() {
-//                                            if (startLiveFailTimes < 10) {
-//                                                startLiveFailTimes++;
-//                                                switchptsp(ComponentIndex, message);
-//                                            }
-//                                        }
-//                                    }, 3000);
-//                                }
-//                            }
-//                        });
-//                    }else{
-//                        liveStreamManager.stopStream(new CommonCallbacks.CompletionCallback() {
-//                            @Override
-//                            public void onSuccess() {
-//                                new Handler().postDelayed(new Runnable() {
-//                                    @Override
-//                                    public void run() {
-//                                        liveStreamManager.startStream(new CommonCallbacks.CompletionCallback() {
-//                                            @Override
-//                                            public void onSuccess() {
-//                                                startLiveFailTimes=0;
-//                                                LogUtil.log(TAG, "自定义RTSP推流启动成功");
-//                                                isliveindex=1;
-//                                                sendEvent2Server("切换视频流成功",1);
-//                                                isLiveStreamAlreadyStart=true;
-//                                            }
-//
-//                                            @Override
-//                                            public void onFailure(@NonNull IDJIError error) {
-//                                                LogUtil.log(TAG, "第"+startLiveFailTimes+"次开始RTSP推流失败:"+new Gson().toJson(error));
-//                                                if (!isLiveStreamAlreadyStart){
-//                                                    new Handler().postDelayed(new Runnable() {
-//                                                        @Override
-//                                                        public void run() {
-//                                                            if (startLiveFailTimes < 10) {
-//                                                                startLiveFailTimes++;
-//                                                                switchptsp(ComponentIndex, message);
-//                                                            }
-//                                                        }
-//                                                    }, 3000);
-//                                                }
-//                                            }
-//                                        });
-//                                    }
-//                                },2000);
-//                            }
-//
-//                            @Override
-//                            public void onFailure(@NonNull IDJIError error) {
-//                                LogUtil.log(TAG, "第"+startLiveFailTimes+"次开始RTSP推流失败:"+new Gson().toJson(error));
-//                                if (!isLiveStreamAlreadyStart){
-//                                    new Handler().postDelayed(new Runnable() {
-//                                        @Override
-//                                        public void run() {
-//                                            if (startLiveFailTimes < 10) {
-//                                                startLiveFailTimes++;
-//                                                switchptsp(ComponentIndex, message);
-//                                            }
-//                                        }
-//                                    }, 3000);
-//                                }
-//                            }
-//                        });
-//                    }
-//                }else{
-//                    LogUtil.log(TAG,"RTSP配置参数有误");
-//                }
-//            }
-//
-//
-//        }else if(ComponentIndex==ComponentIndexType.FPV&&isliveindex==1){
-//            Boolean isAircraftConnected = KeyManager.getInstance().getValue(DJIKey.create(ProductKey.KeyConnection));
-//            if (isAircraftConnected == null || !isAircraftConnected) {
-//                LogUtil.log(TAG, "飞行器未连接");
-//            } else {
-//                if (PreferenceUtils.getInstance().getRtspUserName()!=null&&
-//                        PreferenceUtils.getInstance().getRtspPort()!=null&&
-//                        PreferenceUtils.getInstance().getRtspPassWord()!=null
-//                ){
-//                    ILiveStreamManager liveStreamManager = MediaDataCenter.getInstance().getLiveStreamManager();
-//                    LogUtil.log(TAG, "自定义RTSP推流:" + PreferenceUtils.getInstance().getRtspUserName()
-//                            +"--"+PreferenceUtils.getInstance().getRtspPort()+"--"+PreferenceUtils.getInstance().getRtspPassWord());
-//
-//                    LiveStreamSettings.Builder streamSettingBuilder = new LiveStreamSettings.Builder();
-//
-//                    LiveStreamSettings streamSettings = streamSettingBuilder.setLiveStreamType(LiveStreamType.RTSP)
-//                            .setRtspSettings(new RtspSettings.Builder().setPassWord(PreferenceUtils.getInstance().getRtspPassWord()).
-//                                    setPort(Integer.parseInt(PreferenceUtils.getInstance().getRtspPort())).
-//                                    setUserName(PreferenceUtils.getInstance().getRtspUserName()).build()).build();
-//
-//                    liveStreamManager.setLiveStreamSettings(streamSettings);
-//
-//
-//                    CameraType value = KeyManager.getInstance().getValue(KeyTools.createKey(CameraKey.KeyCameraType, ComponentIndexType.PORT_1));
-//
-//                    liveStreamManager.setCameraIndex(ComponentIndex);
-//
-//                    liveStreamManager.setLiveStreamQuality(StreamQuality.FULL_HD);
-//                    liveStreamManager.setLiveVideoBitrateMode(LiveVideoBitrateMode.AUTO);
-//
-//                    if (!liveStreamManager.isStreaming()) {
-//                        liveStreamManager.startStream(new CommonCallbacks.CompletionCallback() {
-//                            @Override
-//                            public void onSuccess() {
-//                                startLiveFailTimes=0;
-//                                LogUtil.log(TAG, "自定义RTSP推流启动成功");
-//                                isliveindex=2;
-//                                isLiveStreamAlreadyStart=true;
-//                                sendEvent2Server("切换视频流成功",1);
-//
-//                            }
-//
-//                            @Override
-//                            public void onFailure(@NonNull IDJIError error) {
-//                                LogUtil.log(TAG, "第"+startLiveFailTimes+"次开始RTSP推流失败:"+new Gson().toJson(error));
-//                                if (!isLiveStreamAlreadyStart){
-//                                    new Handler().postDelayed(new Runnable() {
-//                                        @Override
-//                                        public void run() {
-//                                            if (startLiveFailTimes < 10) {
-//                                                startLiveFailTimes++;
-//                                                switchptsp(ComponentIndex, message);
-//                                            }
-//                                        }
-//                                    }, 3000);
-//                                }
-//                            }
-//                        });
-//                    }else{
-//                        liveStreamManager.stopStream(new CommonCallbacks.CompletionCallback() {
-//                            @Override
-//                            public void onSuccess() {
-//                                new Handler().postDelayed(new Runnable() {
-//                                    @Override
-//                                    public void run() {
-//                                        liveStreamManager.startStream(new CommonCallbacks.CompletionCallback() {
-//                                            @Override
-//                                            public void onSuccess() {
-//                                                startLiveFailTimes=0;
-//                                                LogUtil.log(TAG, "自定义RTSP推流启动成功");
-//                                                isLiveStreamAlreadyStart=true;
-//                                                isliveindex=2;
-//                                                sendEvent2Server("切换视频流成功",1);
-//                                            }
-//
-//                                            @Override
-//                                            public void onFailure(@NonNull IDJIError error) {
-//                                                LogUtil.log(TAG, "第"+startLiveFailTimes+"次开始RTSP推流失败:"+new Gson().toJson(error));
-//                                                if (!isLiveStreamAlreadyStart){
-//                                                    new Handler().postDelayed(new Runnable() {
-//                                                        @Override
-//                                                        public void run() {
-//                                                            if (startLiveFailTimes < 10) {
-//                                                                startLiveFailTimes++;
-//                                                                switchptsp(ComponentIndex, message);
-//                                                            }
-//                                                        }
-//                                                    }, 3000);
-//                                                }
-//                                            }
-//                                        });
-//                                    }
-//                                },2000);
-//                            }
-//                            @Override
-//                            public void onFailure(@NonNull IDJIError error) {
-//                                LogUtil.log(TAG, "第"+startLiveFailTimes+"次开始RTSP推流失败:"+new Gson().toJson(error));
-//                                if (!isLiveStreamAlreadyStart){
-//                                    new Handler().postDelayed(new Runnable() {
-//                                        @Override
-//                                        public void run() {
-//                                            if (startLiveFailTimes < 10) {
-//                                                startLiveFailTimes++;
-//                                                switchptsp(ComponentIndex, message);
-//                                            }
-//                                        }
-//                                    }, 3000);
-//                                }
-//                            }
-//                        });
-//                    }
-//                }else{
-//                    LogUtil.log(TAG,"RTSP配置参数有误");
-//                }
-//            }
-//
-//        }
+        liveStreamManager.setCameraIndex(ComponentIndex);
 
+        liveStreamManager.setLiveStreamQuality(StreamQuality.FULL_HD);
+        liveStreamManager.setLiveVideoBitrateMode(LiveVideoBitrateMode.AUTO);
     }
 
 
     public void startLiveWithRTSP() {
-        Boolean isAircraftConnected = KeyManager.getInstance().getValue(DJIKey.create(ProductKey.KeyConnection));
+        Boolean isAircraftConnected = KeyManager.getInstance().getValue(DJIKey.create(FlightControllerKey.KeyConnection));
         if (isAircraftConnected == null || !isAircraftConnected) {
             LogUtil.log(TAG, "飞行器未连接");
         } else {
@@ -451,31 +242,47 @@ public class StreamManager extends BaseManager {
                     PreferenceUtils.getInstance().getRtspPort() != null &&
                     PreferenceUtils.getInstance().getRtspPassWord() != null
             ) {
+
                 ILiveStreamManager liveStreamManager = MediaDataCenter.getInstance().getLiveStreamManager();
                 LogUtil.log(TAG, "自定义RTSP推流:" + PreferenceUtils.getInstance().getRtspUserName()
                         + "--" + PreferenceUtils.getInstance().getRtspPort() + "--" + PreferenceUtils.getInstance().getRtspPassWord());
 
-                LiveStreamSettings.Builder streamSettingBuilder = new LiveStreamSettings.Builder();
+                if(isliveindex==1){
+                    LiveStreamSettings.Builder streamSettingBuilder = new LiveStreamSettings.Builder();
+                    LiveStreamSettings streamSettings = streamSettingBuilder.setLiveStreamType(LiveStreamType.RTSP)
+                            .setRtspSettings(new RtspSettings.Builder().setPassWord(PreferenceUtils.getInstance().getRtspPassWord()).
+                                    setPort(Integer.parseInt(PreferenceUtils.getInstance().getRtspPort())).
+                                    setUserName(PreferenceUtils.getInstance().getRtspUserName()).build()).build();
 
-                LiveStreamSettings streamSettings = streamSettingBuilder.setLiveStreamType(LiveStreamType.RTSP)
-                        .setRtspSettings(new RtspSettings.Builder().setPassWord(PreferenceUtils.getInstance().getRtspPassWord()).
-                                setPort(Integer.parseInt(PreferenceUtils.getInstance().getRtspPort())).
-                                setUserName(PreferenceUtils.getInstance().getRtspUserName()).build()).build();
+                    liveStreamManager.setLiveStreamSettings(streamSettings);
 
-                liveStreamManager.setLiveStreamSettings(streamSettings);
-
-
-                CameraType value = KeyManager.getInstance().getValue(KeyTools.createKey(CameraKey.KeyCameraType, ComponentIndexType.PORT_1));
+                    CameraType value = KeyManager.getInstance().getValue(KeyTools.createKey(CameraKey.KeyCameraType, ComponentIndexType.PORT_1));
 
 //                if (value != null && (value == CameraType.ZENMUSE_H20T ||
 //                        value == CameraType.ZENMUSE_H20N || value == CameraType.ZENMUSE_H20)
 //                        || value == CameraType.ZENMUSE_H30 || value == CameraType.ZENMUSE_H30T) {
-                liveStreamManager.setCameraIndex(ComponentIndexType.PORT_1);
+                    liveStreamManager.setCameraIndex(ComponentIndexType.PORT_1);
 //                } else {
 //                    liveStreamManager.setCameraIndex(ComponentIndexType.FPV);
 //                }
-                liveStreamManager.setLiveStreamQuality(StreamQuality.FULL_HD);
-                liveStreamManager.setLiveVideoBitrateMode(LiveVideoBitrateMode.AUTO);
+                    liveStreamManager.setLiveStreamQuality(StreamQuality.FULL_HD);
+                    liveStreamManager.setLiveVideoBitrateMode(LiveVideoBitrateMode.AUTO);
+                }else{
+                    LiveStreamSettings.Builder streamSettingBuilder = new LiveStreamSettings.Builder();
+
+                    LiveStreamSettings streamSettings = streamSettingBuilder.setLiveStreamType(LiveStreamType.RTSP)
+                            .setRtspSettings(new RtspSettings.Builder().setPassWord(PreferenceUtils.getInstance().getRtspPassWord()).
+                                    setPort(Integer.parseInt(PreferenceUtils.getInstance().getRtspPort())).
+                                    setUserName(PreferenceUtils.getInstance().getRtspUserName()).build()).build();
+
+                    liveStreamManager.setLiveStreamSettings(streamSettings);
+
+                    liveStreamManager.setCameraIndex(ComponentIndexType.FPV);
+
+                    liveStreamManager.setLiveStreamQuality(StreamQuality.FULL_HD);
+                    liveStreamManager.setLiveVideoBitrateMode(LiveVideoBitrateMode.AUTO);
+                }
+
 
                 if (!liveStreamManager.isStreaming()) {
                     liveStreamManager.startStream(new CommonCallbacks.CompletionCallback() {
@@ -484,6 +291,8 @@ public class StreamManager extends BaseManager {
                             LogUtil.log(TAG, "自定义RTSP推流启动成功");
                             isliveindex = 1;
                             isLiveStreamAlreadyStart = true;
+                            //开始端口扫描
+                            SimplePortScanner.getInstance().startScan();
                         }
 
                         @Override
@@ -560,4 +369,6 @@ public class StreamManager extends BaseManager {
         }
     }
 
+
+
 }
diff --git a/app/src/main/java/com/aros/apron/manager/TakeOffToPointManager.java b/app/src/main/java/com/aros/apron/manager/TakeOffToPointManager.java
index 1d4d9faa..85adbf0c 100644
--- a/app/src/main/java/com/aros/apron/manager/TakeOffToPointManager.java
+++ b/app/src/main/java/com/aros/apron/manager/TakeOffToPointManager.java
@@ -74,6 +74,7 @@ public class TakeOffToPointManager extends BaseManager {
     public void taskExecute(MessageDown message) {
 
         PreferenceUtils.getInstance().setMissionType(1);
+        Movement.getInstance().setIstakeoffex(true);
         PreferenceUtils.getInstance().setFlightId(message.getData().getFlight_id());
         PreferenceUtils.getInstance().setAlternatePointLon(message.getData().getAlternate_land_point().getLongitude() + "");
         PreferenceUtils.getInstance().setAlternatePointLat(message.getData().getAlternate_land_point().getLatitude() + "");
@@ -184,6 +185,7 @@ public class TakeOffToPointManager extends BaseManager {
             //LogUtil.log(TAG,"执行toGenerateKMZFile");
             toGenerateKMZFile(message);
             verifyGpsAndMissionStateSuccess = true;
+            Movement.getInstance().setIs_fixed(2);
         } else {
 
             if (!verifyGpsAndMissionStateSuccess) {
@@ -239,7 +241,7 @@ public class TakeOffToPointManager extends BaseManager {
         if(generateKmz==true){
             pushKMZFileToAircraft(message);
         }else{
-            sendEvent2Server("航线生成失败", 1);
+            sendEvent2Server("航线生成失败", 2);
         }
     }
 
@@ -305,9 +307,9 @@ public class TakeOffToPointManager extends BaseManager {
 
                 @Override
                 public void onSuccess() {
+                    Movement.getInstance().setWaylinename("takeofftopoint");
                     //起飞准备完毕
                     Movement.getInstance().setMode_code(2);
-                    sendFlightTaskProgress2Server();
                     sendEvent2Server("航线上传成功,准备执行任务", 1);
                     isPushKMZSuccess = true;
                     mainHandler.postDelayed(new Runnable() {
@@ -318,7 +320,6 @@ public class TakeOffToPointManager extends BaseManager {
                              */
                             //自主起飞
                             Movement.getInstance().setMode_code(4);
-                            sendFlightTaskProgress2Server();
                             Movement.getInstance().setTask_current_step(22);
                             startMission(message);
                             pushKMZFileTimes = 0;
@@ -346,7 +347,6 @@ public class TakeOffToPointManager extends BaseManager {
                             sendEvent2Server("航线第" + pushKMZFileTimes + "次上传失败,直接关机",2);
                             //待机
                             Movement.getInstance().setMode_code(0);
-                            sendFlightTaskProgress2Server();
                             TaskFailManager.getInstance().sendTaskFailMsg2Server(-1);
                         }
                     } else {
@@ -385,7 +385,6 @@ public class TakeOffToPointManager extends BaseManager {
                     startMissionFailTimes = 0;
                     sendEvent2Server("任务开始执行", 1);
                     Movement.getInstance().setTask_current_step(23);
-                    sendFlightTaskProgress2Server();
                     Movement.getInstance().setTakeoff_result(0);
                 }
                 @Override
@@ -409,7 +408,6 @@ public class TakeOffToPointManager extends BaseManager {
                                     Movement.getInstance().setTakeoff_result(1);
                                     //待机
                                     Movement.getInstance().setMode_code(0);
-                                    sendFlightTaskProgress2Server();
 
                                     sendEvent2Server("航线第" + startMissionFailTimes + "次开始失败,直接关机:" + "---" + new Gson().toJson(error) + "--" + Movement.getInstance().getQuality(),2);
                                     TaskFailManager.getInstance().sendTaskFailMsg2Server(-1);
diff --git a/app/src/main/java/com/aros/apron/tools/ApronArucoDetect.java b/app/src/main/java/com/aros/apron/tools/ApronArucoDetect.java
index 3bacbc8f..d70155c8 100644
--- a/app/src/main/java/com/aros/apron/tools/ApronArucoDetect.java
+++ b/app/src/main/java/com/aros/apron/tools/ApronArucoDetect.java
@@ -1,16 +1,10 @@
 package com.aros.apron.tools;
 
-
-import android.os.Environment;
 import android.os.Handler;
 import android.os.Looper;
-import android.util.Log;
-
-import androidx.annotation.NonNull;
 
 import com.aros.apron.constant.AMSConfig;
 import com.aros.apron.entity.ArucoMarker;
-import com.aros.apron.entity.ArucoMarkerDimensions;
 import com.aros.apron.entity.Movement;
 import com.aros.apron.manager.AlternateLandingManager;
 
@@ -23,19 +17,13 @@ import org.opencv.core.MatOfPoint2f;
 import org.opencv.core.Point;
 import org.opencv.core.Scalar;
 import org.opencv.core.Size;
-import org.opencv.imgcodecs.Imgcodecs;
 import org.opencv.imgproc.Imgproc;
 import org.opencv.objdetect.ArucoDetector;
 import org.opencv.objdetect.DetectorParameters;
 import org.opencv.objdetect.Dictionary;
 
-import java.io.File;
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
 import java.util.List;
-import java.util.Locale;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
 import java.util.concurrent.ScheduledExecutorService;
@@ -48,191 +36,178 @@ import dji.v5.common.callback.CommonCallbacks;
 import dji.v5.common.error.IDJIError;
 import dji.v5.manager.KeyManager;
 
-public class ApronArucoDetect {
+/**
+ * 2帧一处理：0处理-1跳过-2处理-3跳过
+ * 跳过的帧直接return，啥也不干，让飞机自己飘
+ */
+public class ApronArucoDetect  {
 
-    //是否触发识别(如果丢失图传，此值为false)
+    private static final String TAG = "ApronArucoDetect";
+
+    // ========== 原有参数 ==========
+    private static double LENS_OFFSET_X = 0;
+    private static double LENS_OFFSET_Y = 0;
+    private static final int CENTER_ERR_MAX = 30;
+    private static final float SLOW_LAND_SPEED = -0.2f;
+    private static final float SLOW_SUPER_SPEED = -0.1f;
+    private static final int PIXEL_TRIGGER = 360;
+    private static final int TRIGGER_FRAME_THRESHOLD = 2;
+
+    // ========== 原有状态 ==========
     private boolean isTriggerSuccess;
-
-    //没识别到二维码
-    private boolean arucoNotFoundTag=false;
-
+    private boolean arucoNotFoundTag = false;
     private boolean isStartAruco = false;
-    //    public ExecutorService mThreadPool = Executors.newSingleThreadExecutor();
     ScheduledExecutorService executor = Executors.newScheduledThreadPool(1);
     Future<?> lastFuture = null;
-
-    private String TAG = getClass().getSimpleName();
+    private String TAG_LOG = getClass().getSimpleName();
     Double resultYaw = 0.0;
-    //触发去备降点
     private boolean triggerToAlternateLandingPoint;
     long startTime;
     long endTime;
     private int sigleMarkerDetectFailsTimes;
-    //复降触发条件
     private boolean dropTimesTag;
-    //复降次数
-    private int dropTimes=0;
-    //是否双挂
+    private int dropTimes = 0;
     private boolean isDoublePayload;
-
-    // 【关键修改1】M400下视镜头右后方补偿量（像素，正值向右补偿）
-    // 如果还往左偏就调大，往右偏就调小，建议范围 30-80
-    private static  double LENS_OFFSET_X = 0;
-    private static  double LENS_OFFSET_Y = 0;
-    // 【关键修改2】放宽居中判定阈值（原40，补偿后改为60更合理）
-    private static final int CENTER_ERR_MAX = 25;    // 居中误差（px）
+    private int trycount = 0;
 
     public PIDControl pidControlX = null;
     public PIDControl pidControlY = null;
-
-    //为了解决降落后不停浆问题，增加记录，开启速降时startFastStick之后的过滤次数
     public int checkThrowingErrorsTimes;
+    private int consecutiveTriggerCount = 0;
 
-    public int getCheckThrowingErrorsTimes() {
-        return checkThrowingErrorsTimes;
-    }
-
-    public void setCheckThrowingErrorsTimes(int checkThrowingErrorsTimes) {
-        this.checkThrowingErrorsTimes = checkThrowingErrorsTimes;
-    }
-
-    public boolean isTriggerSuccess() {
-        return isTriggerSuccess;
-    }
-
-    public void setTriggerSuccess(boolean triggerSuccess) {
-        isTriggerSuccess = triggerSuccess;
-    }
-
-    public boolean isDoublePayload() {
-        return isDoublePayload;
-    }
-    private Handler riseHandler = new Handler(Looper.getMainLooper());
-    public void setDoublePayload(boolean doublePayload) {
-        isDoublePayload = doublePayload;
-    }
-
-
-    private ApronArucoDetect() {
-        // 构造函数里也可以调用，但静态代码块更可靠
+    // ========== 【新增】2帧一处理计数器 ==========
+    private int frameCounter = 0;
+
+    // ========== 原有方法 ==========
+    public int getCheckThrowingErrorsTimes() { return checkThrowingErrorsTimes; }
+    public void setCheckThrowingErrorsTimes(int v) { checkThrowingErrorsTimes = v; }
+    public boolean isTriggerSuccess() { return isTriggerSuccess; }
+    public void setTriggerSuccess(boolean v) { isTriggerSuccess = v; }
+    public boolean isDoublePayload() { return isDoublePayload; }
+    public void setDoublePayload(boolean v) { isDoublePayload = v; }
+    public boolean isStartFastStick() { return startFastStick; }
+    public void setStartFastStick(boolean v) { startFastStick = v; }
+    public boolean isCanLanding() { return canLanding; }
+    public void setCanLanding(boolean v) {
+        startTime = 0;
+        endTime = 0;
+        canLanding = v;
     }
 
+    private ApronArucoDetect() {}
     private static class OpenCVHelperHolder {
         private static final ApronArucoDetect INSTANCE = new ApronArucoDetect();
-
-        static {
-            INSTANCE.init();
-        }
+        static { INSTANCE.init(); }
     }
-    private int trycount=0;
-
-    public static ApronArucoDetect getInstance() {
-        return OpenCVHelperHolder.INSTANCE;
-    }
-
-    private static final float SLOW_LAND_SPEED = -0.3f;  // 远场慢降
-    private static final float SLOW_SUPER_SPEED = -0.1f;  //  超近慢降
-
-    private static final int PIXEL_TRIGGER = 360;   // 近场像素阈值
+    public static ApronArucoDetect getInstance() { return OpenCVHelperHolder.INSTANCE; }
 
     public void init() {
-        pidControlX = new PIDControl(0.6f, 0.08f, 0.18f, 0.05f, 2.5f, 0.04f);
-        pidControlY = new PIDControl(0.6f, 0.08f, 0.18f, 0.05f, 2.5f, 0.04f);
+        pidControlX = new PIDControl(0.65f, 0.02f, 0.2f, 0.05f, 2.5f, 0.1f);
+        pidControlY = new PIDControl(0.65f, 0.02f, 0.2f, 0.05f, 2.5f, 0.1f);
+//        pidControlX = new PIDControl(0.8f, 0.002f, 0.09f, 0.05f, 2.0f, 0.05f);
+//        pidControlY = new PIDControl(0.8f, 0.002f, 0.09f, 0.05f, 2.0f, 0.05f);
         pidControlX.reset();
         pidControlY.reset();
     }
 
+    public boolean startFastStick;
+    public boolean canLanding;
 
+    // ========== 【核心修改】主入口：2帧一处理 ==========
     public void detectArucoTags(int height, int width, byte[] data, Dictionary dictionary) {
-
-        //这里说明图传正常
         isTriggerSuccess = true;
-        //0未启用 虚拟摇杆启用原因 1异常拉高返航触发 2视觉降落触发 3手动触发
         Movement.getInstance().setVirtualStickEnableReason(2);
-        //保证一帧进入同时 保证只有一次速降
+
+        // 原有过滤
         if (isStartAruco || startFastStick) {
-             LogUtil.log(TAG, "过滤:" + isStartAruco + startFastStick);
+            LogUtil.log(TAG_LOG, "过滤:" + isStartAruco + startFastStick);
             if (!isStartAruco && startFastStick) {
                 checkThrowingErrorsTimes++;
             }
             return;
         }
 
+        // ========== 【关键】2帧一处理：0处理-1跳过-2处理-3跳过 ==========
+        int currentFrame = frameCounter++;
+        boolean shouldProcess = (currentFrame % 2 == 0);  // 偶数帧处理，奇数帧跳过
+
+        if (!shouldProcess) {
+            // 【关键】跳过的帧：啥也不干，直接return，让飞机自己飘
+            LogUtil.log(TAG_LOG, "【跳过帧】" + currentFrame + " 让飞机自稳");
+            return;
+        }
+
+        LogUtil.log(TAG_LOG, "【处理帧】" + currentFrame + " 执行修正");
+
         isStartAruco = true;
 
-        /* 如果上一帧任务还没跑完，直接 cancel */
         if (lastFuture != null && !lastFuture.isDone()) {
-            LogUtil.log(TAG, "break---");
+            LogUtil.log(TAG_LOG, "break---");
             lastFuture.cancel(true);
         }
-        // 根据超声波高度分段固定偏移（避免 pixelWidth 跳变导致抖动）
-        int ultHeight = Movement.getInstance().getUltrasonicHeight(); // dm
-        if (ultHeight >= 30) {
-            LENS_OFFSET_X = 0;
-            LENS_OFFSET_Y = 0;
-        } else if (ultHeight >= 20) {
-            LENS_OFFSET_X = 0;
-            LENS_OFFSET_Y = 0;
-        } else if (ultHeight >= 10) {
-            LENS_OFFSET_X = 20;
-            LENS_OFFSET_Y = 10;
-        } else if (ultHeight >= 5) {
-            LENS_OFFSET_X = 30;
-            LENS_OFFSET_Y = 20;
-        } else {
-            LENS_OFFSET_X = 50;  // 建议从 60 开始试，80 可能太大
-            LENS_OFFSET_Y = 25;
-        }
 
+        // 动态偏移（原有）
+        int ultHeight = Movement.getInstance().getUltrasonicHeight();
+        if (ultHeight >= 30) { LENS_OFFSET_X = 0; LENS_OFFSET_Y = 0; }
+        else if (ultHeight >= 20) { LENS_OFFSET_X = 0; LENS_OFFSET_Y = 0; }
+        else if (ultHeight >= 10) { LENS_OFFSET_X = 20; LENS_OFFSET_Y = 10; }
+        else if (ultHeight >= 5) { LENS_OFFSET_X = 30; LENS_OFFSET_Y = 20; }
+        else { LENS_OFFSET_X = 55; LENS_OFFSET_Y = 35; }
 
-
-        //LogUtil.log(TAG, "执行了");
+        // ========== 原有完整逻辑（一点不改） ==========
         lastFuture = executor.schedule(new Runnable() {
             @Override
             public void run() {
                 try {
-                    /* ---------- 1. YUV → BGR → Gray ---------- */
                     Mat yuvMat = new Mat(height + height / 2, width, CvType.CV_8UC1);
                     yuvMat.put(0, 0, data);
                     Mat rgbMat = new Mat();
                     Imgproc.cvtColor(yuvMat, rgbMat, Imgproc.COLOR_YUV2BGR_I420);
-
-                    // 灰度
                     Mat grayImgMat = new Mat();
                     Imgproc.cvtColor(rgbMat, grayImgMat, Imgproc.COLOR_BGR2GRAY);
 
-                    /* 【OpenCV 4.9+】温和预处理（应对飞行模糊，提升识别率） */
-                    Mat processedMat = fixedPreprocess(grayImgMat);
-
-                    /* 2. 检测二维码（OpenCV 4.12+） */
+                    // ========== 【极致容错】双重检测策略 ==========
+                    // 策略1：增强图检测（适应低光/反光）
+                    Mat enhancedMat = createEnhancedImage(grayImgMat);
                     MatOfInt ids = new MatOfInt();
                     List<Mat> corners = new ArrayList<>();
-                    Mat corner6 = new Mat();
 
-                    // 【OpenCV 4.12+】创建 ArucoDetector
-                    DetectorParameters parameters = new DetectorParameters();
-                    ArucoDetector detector = new ArucoDetector(dictionary, parameters);
-                    // 先用预处理图像检测
-                    detector.detectMarkers(processedMat, corners, ids);
+                    DetectorParameters params = createUltraTolerantParams();
+                    ArucoDetector detector = new ArucoDetector(dictionary, params);
+                    detector.detectMarkers(enhancedMat, corners, ids);
 
-                    // 如果预处理检测不到，回退到原图
+                    // 策略2：如果失败，用原图兜底（适应过曝）
                     if (ids.empty()) {
                         corners.clear();
                         detector.detectMarkers(grayImgMat, corners, ids);
                     }
 
-                    //b保留6号
+                    // 策略3：如果还失败，降采样检测（适应高分辨率模糊）
+                    if (ids.empty()) {
+                        corners.clear();
+                        Mat downscaled = new Mat();
+                        Imgproc.resize(grayImgMat, downscaled, new Size(grayImgMat.width() * 0.8, grayImgMat.height() * 0.8));
+                        detector.detectMarkers(downscaled, corners, ids);
+                        // 坐标映射回原图比例
+                        if (!ids.empty()) {
+                            for (Mat corner : corners) {
+                                Core.multiply(corner, new Scalar(1.25, 1.25), corner);
+                            }
+                        }
+                        downscaled.release();
+                    }
+
                     ids = keepOnly6(ids, corners);
 
                     boolean marker6Found = false;
+                    Mat corner6 = new Mat();
+
                     if (!ids.empty()) {
-                        trycount=0;
+                        trycount = 0;
                         arucoNotFoundTag = false;
                         int[] idArray = ids.toArray();
                         int ultrasonicHeight = Movement.getInstance().getUltrasonicHeight();
-                      //  double flyingHeight = Movement.getInstance().getElevation();
 
-                        // 如果只有一个而且是6
                         if (idArray.length == 1 && idArray[0] == 6) {
                             marker6Found = true;
                             corner6 = corners.get(0);
@@ -242,171 +217,235 @@ public class ApronArucoDetect {
                                 points[i] = new Point(p[0], p[1]);
                             }
 
-                            /* 像素宽：相邻两角点像素距离 */
                             double pixelWidth = calculateDistance(points[0], points[1]);
 
-                            // 【关键修改3】降落判断加上镜头偏移补偿（向右补偿）
-                            double centerX = (points[0].x + points[1].x + points[2].x + points[3].x) / 4.0 +LENS_OFFSET_X;
-                            double errX = Math.abs(centerX - rgbMat.width() / 2.0 );
-                            // 修改为（向前补偿）：
-                            double centerY = (points[0].y + points[1].y + points[2].y + points[3].y) / 4.0 +LENS_OFFSET_Y;
-                            double errY = Math.abs(centerY - rgbMat.height() / 2.0 ); ;
+                            double centerX = (points[0].x + points[1].x + points[2].x + points[3].x) / 4.0 + LENS_OFFSET_X;
+                            double errX = Math.abs(centerX - rgbMat.width() / 2.0);
+                            double centerY = (points[0].y + points[1].y + points[2].y + points[3].y) / 4.0 + LENS_OFFSET_Y;
+                            double errY = Math.abs(centerY - rgbMat.height() / 2.0);
 
-                            LogUtil.log(TAG, "像素" + (int) pixelWidth +
+                            LogUtil.log(TAG_LOG, "像素" + (int) pixelWidth +
                                     " errX=" + (int) errX + " errY=" + (int) errY + " (含偏移" + LENS_OFFSET_X + ")");
 
-                            /* 近场 + 对准 + 像素够 → 延迟0.5s后速降 */
-                            if (!startFastStick &&
-                                    pixelWidth >= PIXEL_TRIGGER &&
-//        flyingHeight <= 1 &&
-                                    ultrasonicHeight <= 4 &&
-                                    errX < CENTER_ERR_MAX &&
-                                    errY < CENTER_ERR_MAX) {
+                            // 速降判断（原有）
+                            if (!startFastStick) {
+                                if (pixelWidth >= PIXEL_TRIGGER &&
+                                        ultrasonicHeight <= 4 &&
+                                        errX < CENTER_ERR_MAX &&
+                                        errY < CENTER_ERR_MAX) {
 
-                                startFastStick = true;  // 先标记，防止重复触发
-                                LogUtil.log(TAG, "6号居中+近场满足条件，0.5s后触发速降 pixel=" + (int) pixelWidth +
-                                        " errX=" + (int) errX + " errY=" + (int) errY);
+                                    consecutiveTriggerCount++;
+                                    LogUtil.log(TAG_LOG, "速降条件满足，累计帧数: " + consecutiveTriggerCount);
 
-                                // 延迟500ms执行速降
-                                handler.postDelayed(new Runnable() {
-                                    @Override
-                                    public void run() {
-                                        handler.post(runnable);  // 启动速降循环
-                                        LogUtil.log(TAG, "0.5s延迟结束，开始速降");
+                                    if (consecutiveTriggerCount >= TRIGGER_FRAME_THRESHOLD) {
+                                        startFastStick = true;
+                                        consecutiveTriggerCount = 0;
+
+                                        LogUtil.log(TAG_LOG, "【触发速降】连续满足" + TRIGGER_FRAME_THRESHOLD +
+                                                "帧，pixel=" + (int) pixelWidth + " errX=" + (int) errX);
+
+                                        handler.postDelayed(new Runnable() {
+                                            @Override
+                                            public void run() {
+                                                handler.post(runnable);
+                                                LogUtil.log(TAG_LOG, "延迟结束，开始速降");
+                                            }
+                                        }, 300);
+
+                                        // 清理资源
+                                        enhancedMat.release();
+                                        grayImgMat.release();
+                                        rgbMat.release();
+                                        yuvMat.release();
+                                        ids.release();
+                                        if (!corners.isEmpty()) {
+                                            for (Mat c : corners) if (c != null) c.release();
+                                        }
+                                        isStartAruco = false;
+                                        return;
                                     }
-                                }, 500);
-
-                                return;
+                                } else {
+                                    if (consecutiveTriggerCount > 0) {
+                                        LogUtil.log(TAG_LOG, "速降条件中断，重置累计帧数（原因：像素=" + (int)pixelWidth +
+                                                " 超声=" + ultrasonicHeight + " errX=" + (int)errX + " errY=" + (int)errY + ")");
+                                        consecutiveTriggerCount = 0;
+                                    }
+                                }
                             }
                         }
-                        if(marker6Found){
-                            //执行位移修正
+
+                        // 原有修正逻辑
+                        if (marker6Found) {
                             moveOnArucoDetected(new ArucoMarker(1, corner6, 0.24f), rgbMat.width(), rgbMat.height());
                         }
                         dropTimesTag = true;
+
                     } else {
-                        LogUtil.log(TAG, "找不到了二维码");
+                        // 原有丢失处理
+                        LogUtil.log(TAG_LOG, "找不到了二维码");
                         if (!arucoNotFoundTag) {
                             startTime = System.currentTimeMillis();
                             arucoNotFoundTag = true;
                         }
                         endTime = System.currentTimeMillis();
                         long lostDuration = endTime - startTime;
-                        //1s到8s内
-                        if (lostDuration > 1200 && lostDuration <= 8000) {
-                            if (Movement.getInstance().getUltrasonicHeight()<=30) {
-                                DroneHelper.getInstance().moveVxVyYawrateHeight(0f, 0f, 0f, 0.8f);
+
+                        if (lostDuration > 1000 && lostDuration <= 12000) {
+                            if (Movement.getInstance().getUltrasonicHeight() <= 20) {
+                                DroneHelper.getInstance().moveVxVyYawrateHeight(0f, 0f, 0f, 3f);
                                 if (dropTimes > Integer.parseInt(AMSConfig.getInstance().getAlternateLandingTimes())) {
-                                    LogUtil.log(TAG, "超过复降限制,去备降点");
+                                    LogUtil.log(TAG_LOG, "超过复降限制,去备降点");
+
                                     AlternateLandingManager.getInstance().startTaskProcess(null);
+                                    Movement.getInstance().setAlternate(true);
+
+                                    // 清理资源
+                                    enhancedMat.release();
+                                    grayImgMat.release();
+                                    rgbMat.release();
+                                    yuvMat.release();
+                                    ids.release();
+                                    if (!corners.isEmpty()) {
+                                        for (Mat c : corners) if (c != null) c.release();
+                                    }
+                                    isStartAruco = false;
                                     return;
                                 }
                                 if (dropTimesTag) {
                                     dropTimesTag = false;
                                     dropTimes++;
-                                    LogUtil.log(TAG, "复降第:" + dropTimes + "次");
+                                    LogUtil.log(TAG_LOG, "复降第:" + dropTimes + "次");
                                 }
                             } else {
-
-                                LogUtil.log(TAG, "执行位移");
+                                LogUtil.log(TAG_LOG, "执行位移");
                                 DroneHelper.getInstance().moveVxVyYawrateHeight(0f, 0f, 0f, -0.3f);
                             }
-                            // 超过8s
                         } else if (lostDuration > 8000) {
-                            LogUtil.log(TAG, "判定未识别到二维码,飞往备降点");
+                            LogUtil.log(TAG_LOG, "判定未识别到二维码,飞往备降点");
                             AlternateLandingManager.getInstance().startTaskProcess(null);
                         }
                     }
-                    // 释放资源（安全版）
-                    processedMat.release();
+                    // 原有资源释放
+                    enhancedMat.release();
                     grayImgMat.release();
                     rgbMat.release();
                     yuvMat.release();
                     ids.release();
 
-                    // 安全释放角点（避免空指针和重复释放）
                     if (!corners.isEmpty()) {
                         for (Mat c : corners) {
                             if (c != null) c.release();
                         }
                     }
                     isStartAruco = false;
+
                 } catch (Exception e) {
-                    LogUtil.log(TAG, "Exception" + e);  // 第一个日志
+                    LogUtil.log(TAG_LOG, "Exception" + e);
                     isStartAruco = false;
                 }
             }
         }, 0, TimeUnit.MILLISECONDS);
     }
 
+    // ========== 以下全部原有方法，一点不改 ==========
 
-    /**
-     * 只保留 id==6 的 marker
-     * 返回新的 MatOfInt（旧对象已 release），corners 列表同步
-     */
     private static MatOfInt keepOnly6(MatOfInt ids, List<Mat> corners) {
         if (ids.empty()) return ids;
-
         int[] idArr = ids.toArray();
         List<Integer> keepIdx = new ArrayList<>();
         for (int i = 0; i < idArr.length; i++) if (idArr[i] == 6) keepIdx.add(i);
 
-        // 1. 先把要保留的角点缓存到临时列表
         List<Mat> tmpCorners = new ArrayList<>(keepIdx.size());
         for (int i : keepIdx) tmpCorners.add(corners.get(i));
 
-        // 2. 再清空原列表
         corners.clear();
-
-        // 3. 重建 ids 并回填 corners
         ids.release();
         int[] newIds = new int[keepIdx.size()];
         for (int j = 0; j < keepIdx.size(); j++) newIds[j] = 6;
-        corners.addAll(tmpCorners);          // 现在安全了
+        corners.addAll(tmpCorners);
         return new MatOfInt(newIds);
     }
 
-
-    /**
-     * 【温和预处理】双边滤波 + CLAHE + 锐化（不做二值化）
-     */
-    private Mat fixedPreprocess(Mat src) {
+    // ========== 【极致容错】图像增强：全高度段通用 ==========
+    private Mat createEnhancedImage(Mat src) {
         Mat result = new Mat();
         try {
-            // 1. 双边滤波（去噪 + 保边）
-            Mat filtered = new Mat();
-            Imgproc.bilateralFilter(src, filtered, 9, 75, 75);
+            // 1. 多尺度CLAHE（适应不同亮度）
+            Mat claheMat = new Mat();
+            Imgproc.createCLAHE(2.0, new Size(8, 8)).apply(src, claheMat);
 
-            // 2. CLAHE（对比度增强）
-            Mat clahe = new Mat();
-            Imgproc.createCLAHE(4.0, new Size(8, 8)).apply(filtered, clahe);
+            // 2. 中值滤波去噪（比双边快，保边足够）
+            Mat filtered = new Mat();
+            Imgproc.medianBlur(claheMat, filtered, 5);
+            claheMat.release();
+
+            // 3. 自适应阈值（块大小动态，适应全高度）
+            Mat binary = new Mat();
+            Imgproc.adaptiveThreshold(filtered, binary, 255,
+                    Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C,
+                    Imgproc.THRESH_BINARY, 41, 3);  // 块41更大，常数3更敏感
             filtered.release();
 
-            // 3. 锐化（Unsharp Masking）
-            Mat blurred = new Mat();
-            Imgproc.GaussianBlur(clahe, blurred, new Size(0, 0), 2.0);
-            Core.addWeighted(clahe, 1.5, blurred, -0.5, 0, result);
+            // 4. 形态学操作（连接断裂边框）
+            Mat morph = new Mat();
+            Mat kernel = Imgproc.getStructuringElement(Imgproc.MORPH_RECT, new Size(5, 5));
+            Imgproc.morphologyEx(binary, morph, Imgproc.MORPH_CLOSE, kernel);
+            kernel.release();
+            binary.release();
 
-            clahe.release();
+            // 5. 轻度锐化（突出边缘，不过度）
+            Mat sharpened = new Mat();
+            Mat blurred = new Mat();
+            Imgproc.GaussianBlur(morph, blurred, new Size(0, 0), 3.0);
+            Core.addWeighted(morph, 1.3, blurred, -0.3, 0, sharpened);
+            morph.release();
             blurred.release();
 
-            return result;
-        } catch (Exception e) {
+            return sharpened;
 
-            LogUtil.log(TAG, "预处理失败: " + e.getMessage());
+        } catch (Exception e) {
+            LogUtil.log(TAG_LOG, "增强失败: " + e.getMessage());
             src.copyTo(result);
             return result;
         }
     }
 
 
-    /**
-     * 61     * 计算两个点之间的欧几里得距离
-     * 62     * @param p1 第一个点
-     * 63     * @param p2 第二个点
-     * 64     * @return 两点之间的距离
-     * 65
-     */
+
+    private DetectorParameters createUltraTolerantParams() {
+        DetectorParameters params = new DetectorParameters();
+
+        // 全高度段：4dm=375px, 9dm=190px, 50dm=19px
+        params.set_minMarkerPerimeterRate(0.003f);  // 降到0.003，19像素也能检
+
+        // 畸变/反光/模糊宽容
+        params.set_polygonalApproxAccuracyRate(0.12f);  // 更松
+
+        params.set_cornerRefinementMethod(1);  // SUBPIX
+        params.set_cornerRefinementWinSize(3);  // 降到3更快
+        params.set_cornerRefinementMaxIterations(30);
+        params.set_cornerRefinementMinAccuracy(0.12f);  // 放宽收敛
+
+        // 阈值范围更大，适应全光照
+        params.set_adaptiveThreshWinSizeMin(3);
+        params.set_adaptiveThreshWinSizeMax(63);  // 更大
+        params.set_adaptiveThreshWinSizeStep(10);
+        params.set_adaptiveThreshConstant(3);  // 配合预处理
+
+        params.set_minCornerDistanceRate(0.02f);
+        params.set_minMarkerLengthRatioOriginalImg(0.03f);  // 更宽容
+        params.set_minDistanceToBorder(1);  // 边缘也检
+
+        params.set_perspectiveRemovePixelPerCell(2);  // 降到2，小像素精细
+        params.set_perspectiveRemoveIgnoredMarginPerCell(0.2f);
+
+        params.set_maxErroneousBitsInBorderRate(0.6f);  // 60%容错
+
+        params.set_detectInvertedMarker(false);
+
+        return params;
+    }
+
     private double calculateDistance(Point p1, Point p2) {
         double dx = p2.x - p1.x;
         double dy = p2.y - p1.y;
@@ -414,111 +453,141 @@ public class ApronArucoDetect {
     }
 
     public void setDetectedBigMarkers() {
-        startFastStick = false;   // 停止速降
-        isStartAruco = false;     // 允许下一帧再进检测
+        startFastStick = false;
+        isStartAruco = false;
+        consecutiveTriggerCount = 0;
+        frameCounter = 0;  // 【新增】重置帧计数
     }
 
-    /**
-     * 只处理一个 ArucoMarker（6 号码）
-     */
-    private void moveOnArucoDetected(ArucoMarker marker,   // ← 不再是 List
-                                     int imageWidth,
-                                     int imageHeight) {
 
-        /* 1. 取角点 */
-        Mat corner6 = marker.getConner();   // ← 直接拿，不用 get(0)
+    private double calculateYawErrorFromCorners(Point[] pts) {
+        double dxTop = pts[1].x - pts[0].x;
+        double dyTop = pts[1].y - pts[0].y;
+        double angleTop = Math.toDegrees(Math.atan2(dyTop, dxTop));
+        double dxBottom = pts[2].x - pts[3].x;
+        double dyBottom = pts[2].y - pts[3].y;
+        double angleBottom = Math.toDegrees(Math.atan2(dyBottom, dxBottom));
+        double yawError = (angleTop + angleBottom) / 2.0;
+        while (yawError > 180) yawError -= 360;
+        while (yawError < -180) yawError += 360;
+        return yawError;
+    }
+
+    private void moveOnArucoDetected(ArucoMarker marker, int imageWidth, int imageHeight) {
+        Mat corner6 = marker.getConner();
         Point[] pts = new Point[4];
         for (int i = 0; i < 4; i++) {
             double[] p = corner6.get(0, i);
             pts[i] = new Point(p[0], p[1]);
         }
 
-        /* 2. 中心 + 误差（带镜头偏移补偿） */
-        double cx = (pts[0].x + pts[1].x + pts[2].x + pts[3].x) / 4.0 +LENS_OFFSET_X;
-        double cy = (pts[0].y + pts[1].y + pts[2].y + pts[3].y) / 4.0 +LENS_OFFSET_Y;
+        double cx = (pts[0].x + pts[1].x + pts[2].x + pts[3].x) / 4.0 + LENS_OFFSET_X;
+        double cy = (pts[0].y + pts[1].y + pts[2].y + pts[3].y) / 4.0 + LENS_OFFSET_Y;
         Point screenCenter = new Point(imageWidth / 2.0, imageHeight / 2.0);
 
         double errX = (cx - screenCenter.x);
         double errY = (cy - screenCenter.y);
+        int currentHeight = Movement.getInstance().getUltrasonicHeight();
 
-        /* 3. PID 微调水平 */
-        pidControlX.setInputFilterAll((float) (errX / 700.0));
-        pidControlY.setInputFilterAll((float) (-errY / 700.0));
+        double scaleFactor;
+        if (currentHeight >= 50) {
+            scaleFactor = 300.0;   // 50m: 像素3, 大力修正
+        } else if (currentHeight >= 30) {
+            scaleFactor = 500.0;   // 30m: 像素5
+        } else if (currentHeight >= 20) {
+            scaleFactor = 600.0;   // 20m: 像素8
+        } else if (currentHeight >= 10) {
+            scaleFactor = 700.0;   // 10m: 像素16
+        }  else {
+            scaleFactor = 900.0;  // 1m: 像素159, 温柔修正
+        }
 
+        pidControlX.setInputFilterAll((float) (errX / scaleFactor));
+        pidControlY.setInputFilterAll((float) (-errY / scaleFactor));
 
         float rawVx = pidControlX.get_pid();
         float rawVy = pidControlY.get_pid();
+        float yawRate = 0f;
 
+        float vx = (float) Math.max(-0.2, Math.min(0.2, rawVx));
+        float vy = (float) Math.max(-0.2, Math.min(0.2, rawVy));
 
-//        if (Math.abs(rawVx) < 0.005f) rawVx = 0.0f;
-//        if (Math.abs(rawVy) < 0.005f) rawVy = 0.0f;
-
-
-        float vx = (float) Math.max(-0.25, Math.min(0.25, rawVx));
-        float vy = (float) Math.max(-0.25, Math.min(0.25, rawVy));
-
-        /* 4. 远场慢降：像素 < 1500 且 > 2 m */
         double pixelWidth = Math.sqrt(Math.pow(pts[1].x - pts[0].x, 2) +
                 Math.pow(pts[1].y - pts[0].y, 2));
-      //  double flyingHeight = Movement.getInstance().getElevation();
 
-        int currentHeight = Movement.getInstance().getUltrasonicHeight();
+
+
+        if (currentHeight >= 10 && currentHeight <= 55) {
+            double yawError = calculateYawErrorFromCorners(pts);
+            double absError = Math.abs(yawError);
+
+            if (absError > 10.0) {
+                float targetRate;
+                if (absError > 100.0) targetRate = 50.0f;
+                else if (absError > 50.0) targetRate = 30.0f;
+                else if (absError > 30.0) targetRate = 20.0f;
+                else targetRate = 10.0f;
+                yawRate = yawError > 0 ? targetRate : -targetRate;
+
+                String speedLabel = absError > 100 ? "高速50" :
+                        absError > 50 ? "中速30" :
+                                absError > 30 ? "低速20" : "微调10";
+                LogUtil.log(TAG_LOG, "机头矫正：误差=" + (int)yawError + "° 转速=" + yawRate + "°/s [" + speedLabel + "]");
+            } else {
+                yawRate = 0.0f;
+                LogUtil.log(TAG_LOG, "机头已对准：偏航误差=" + (int)yawError + "°");
+            }
+        } else {
+            yawRate = 0.0f;
+        }
 
         float vz;
         if (currentHeight <= 4) {
-            vz = 0.0f;  // 近场悬停，等速降
-        } else if (currentHeight <= 6) {
-            vz = SLOW_SUPER_SPEED; // -0.1f，过渡层
+            vz = 0.0f;
+            if (Math.abs(errX) > 120) {
+                vx = rawVx > 0 ? 0.135f : -0.135f;
+            } else if (Math.abs(errX) > 80) {
+                vx = rawVx > 0 ? 0.09f : -0.09f;
+            } else if (Math.abs(errX) > 60) {
+                vx = rawVx > 0 ? 0.07f : -0.07f;
+            } else if (Math.abs(errX) > 30) {
+                vx = rawVx > 0 ? 0.05f : -0.05f;
+            } else {
+                vx = 0f;
+            }
+
+            if (Math.abs(errY) > 120) {
+                vy = rawVy > 0 ? 0.135f : -0.135f;
+            } else if (Math.abs(errY) > 80) {
+                vy = rawVy > 0 ? 0.09f : -0.09f;
+            } else if (Math.abs(errY) > 60) {
+                vy = rawVy > 0 ? 0.07f : -0.07f;
+            } else if (Math.abs(errY) > 30) {
+                vy = rawVy > 0 ? 0.05f : -0.05f;
+            } else {
+                vy = 0f;  // 【修正】
+            }
+
+        } else if (currentHeight <= 8) {
+            vz = SLOW_SUPER_SPEED;
         } else {
-            vz = SLOW_LAND_SPEED;  // -0.3f，远场慢降
+            vz = SLOW_LAND_SPEED;
         }
-//        if (flyingHeight <= 0.2) {
-//            vz = 0.0f;
-//            LogUtil.log(TAG, "相对高度" + flyingHeight + "强制悬停");
-//        }
 
-        /* 5. 输出 */
-        DroneHelper.getInstance().moveVxVyYawrateHeight(vx, vy, 0f, vz);
+        DroneHelper.getInstance().moveVxVyYawrateHeight(vx, vy, yawRate, vz);
 
-        /* 6. 日志（加上偏移提示） */
-        LogUtil.log(TAG, "vx" + vx + "vy" + vy + "像素居中 errX=" + (int) errX + "(含偏移" + LENS_OFFSET_X + ") errY=" + (int) errY +
-                " pixelW=" + (int) pixelWidth + " vz=" + vz + "ultheight" + Movement.getInstance().getUltrasonicHeight());
+        LogUtil.log(TAG_LOG, "vx" + vx + "vy" + vy + " errX=" + (int) errX + " errY=" + (int) errY +
+                " pixelW=" + (int) pixelWidth + " vz=" + vz + " ult=" + currentHeight + " yaw=" + yawRate);
     }
 
-
-    public boolean startFastStick;
-
-    public boolean isStartFastStick() {
-        return startFastStick;
-    }
-
-    public void setStartFastStick(boolean startFastStick) {
-        this.startFastStick = startFastStick;
-    }
-
-    public boolean canLanding;
-
-    public boolean isCanLanding() {
-        return canLanding;
-    }
-
-    public void setCanLanding(boolean canLanding) {
-        //测试重置未识别和识别时间,避免刚触发识别就飞向备降点
-        startTime = 0;
-        endTime = 0;
-        this.canLanding = canLanding;
-
-    }
-
-
-    private int handlerCallbackCount = 0; // 记录回调次数
+    private int handlerCallbackCount = 0;
     private Handler handler = new Handler(Looper.getMainLooper());
     private Runnable runnable = new Runnable() {
         @Override
         public void run() {
             performOperation();
-            if (handlerCallbackCount < 25) {
-                handler.postDelayed(this, 50); // 每 50 毫秒执行一次，1 秒内执行 20 次
+            if (handlerCallbackCount < 20) {
+                handler.postDelayed(this, 50);
             } else {
                 performNextStep();
             }
@@ -526,28 +595,15 @@ public class ApronArucoDetect {
     };
 
     private void performOperation() {
-        LogUtil.log(TAG, "快速下拉中..." + handlerCallbackCount);
+        LogUtil.log(TAG_LOG, "快速下拉中..." + handlerCallbackCount);
         DroneHelper.getInstance().moveVxVyYawrateHeight(0f, 0f, 0f, -4);
-        handlerCallbackCount++; // 增加计数器
+        handlerCallbackCount++;
     }
 
     private void performNextStep() {
         canLanding = true;
         handlerCallbackCount = 0;
-        dropTimes = 0;//手动测试避免多次累加后直接飞往备降点
-//        KeyManager.getInstance().performAction(KeyTools.createKey(FlightControllerKey.KeyStartAutoLanding), new CommonCallbacks.CompletionCallbackWithParam<EmptyMsg>() {
-//            @Override
-//            public void onSuccess(EmptyMsg emptyMsg) {
-//                LogUtil.log(TAG, "下拉完成：触发下一步自动降落");
-//            }
-//
-//            @Override
-//            public void onFailure(@NonNull IDJIError idjiError) {
-//                LogUtil.log(TAG, "下拉完成：触发下一步自动降落失败");
-//            }
-//        });
-        handler.removeCallbacks(runnable); // 防止重复执行
+        dropTimes = 0;
+        handler.removeCallbacks(runnable);
     }
-
-
 }
\ No newline at end of file
diff --git a/app/src/main/java/com/aros/apron/tools/Generakmztools.java b/app/src/main/java/com/aros/apron/tools/Generakmztools.java
index 088c7c2f..016f0b0e 100644
--- a/app/src/main/java/com/aros/apron/tools/Generakmztools.java
+++ b/app/src/main/java/com/aros/apron/tools/Generakmztools.java
@@ -6,6 +6,7 @@ import com.aros.apron.base.BaseManager;
 import com.aros.apron.entity.MissionDataBean;
 import com.aros.apron.entity.Movement;
 import com.aros.apron.manager.TakeOffToPointManager;
+import com.aros.apron.manager.TaskFailManager;
 import com.dji.wpmzsdk.common.data.Template;
 import com.dji.wpmzsdk.manager.WPMZManager;
 
@@ -33,6 +34,35 @@ public class Generakmztools extends BaseManager {
         LocationCoordinate3D lat = KeyManager.getInstance().getValue(KeyTools.createKey(FlightControllerKey.
                 KeyAircraftLocation3D));
 
+
+        int retryCount = 0;
+        final int MAX_RETRY = 60;
+
+        while (retryCount < MAX_RETRY) {
+            lat = KeyManager.getInstance().getValue(KeyTools.createKey(FlightControllerKey.KeyAircraftLocation3D));
+            if (lat != null) {
+                break;
+            }
+            retryCount++;
+            sendEvent2Server("生成失败：未获取到飞机当前位置（重试" + retryCount + "次）", 1);
+            if (retryCount >= MAX_RETRY) {
+                sendEvent2Server("生成失败：未获取到飞机当前位置（重试" + MAX_RETRY + "次超时）", 1);
+                TaskFailManager.getInstance().sendTaskFailMsg2Server(-1);
+                return false;
+            }
+
+            try {
+                Thread.sleep(1000); // 休眠1秒
+            } catch (InterruptedException e) {
+                Thread.currentThread().interrupt();
+                LogUtil.log("qwq", "获取位置线程被中断");
+                sendEvent2Server("生成失败：获取位置被中断", 1);
+                TaskFailManager.getInstance().sendTaskFailMsg2Server(-1);
+                return false;
+            }
+        }
+
+
         if (lat == null) {
             LogUtil.log("qwq", "当前位置为空，无法生成航线");
             sendEvent2Server("生成失败：未获取到飞机当前位置", 1);
diff --git a/app/src/main/java/com/aros/apron/tools/PreferenceUtils.java b/app/src/main/java/com/aros/apron/tools/PreferenceUtils.java
index 0a75d69d..9f76095c 100644
--- a/app/src/main/java/com/aros/apron/tools/PreferenceUtils.java
+++ b/app/src/main/java/com/aros/apron/tools/PreferenceUtils.java
@@ -18,10 +18,11 @@ public class PreferenceUtils extends BasePreference {
     private String UPLOAD_URL = "upload_url";//minIO上传地址
     private String ACCESS_KEY = "access_key";
     private String SECRET_KEY = "secret_key";
+    private String OBJECT_KEY = "object_key";
     private String BUCKET_NAME = "bucket_name";
     private String FLIGHT_NAME = "flight_name";
     private String TASK_ID = "task_id";
-    private String OBJECT_KEY = "object_key";
+
     private String SORTIES_ID = "sortiesId";
     private String FLIGHT_ID = "flightId";
     private String NEED_TRIGGER_APRON_ARUCO_LAND = "need_trigger_apron_aruco_land";//是否需要触发crash后继续降落到机库
diff --git a/app/src/main/res/layout-land/activity_config.xml b/app/src/main/res/layout-land/activity_config.xml
index cc273aa6..93bdf280 100644
--- a/app/src/main/res/layout-land/activity_config.xml
+++ b/app/src/main/res/layout-land/activity_config.xml
@@ -746,6 +746,12 @@
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="10dp"
                             android:text="中间" />
+                        <RadioButton
+                            android:id="@+id/rb_camera_null"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_marginLeft="10dp"
+                            android:text="无" />
                     </RadioGroup>
                 </LinearLayout>
 
diff --git a/app/src/main/res/layout-land/activity_main.xml b/app/src/main/res/layout-land/activity_main.xml
index 9272457a..a6e5d057 100644
--- a/app/src/main/res/layout-land/activity_main.xml
+++ b/app/src/main/res/layout-land/activity_main.xml
@@ -292,14 +292,14 @@
             app:layout_constraintWidth_percent="0.95"
             app:uxsdk_titleBarBackgroundColor="@color/uxsdk_black" />
         <LinearLayout
-            android:visibility="gone"
+            android:visibility="visible"
             android:orientation="horizontal"
             android:layout_width="match_parent"
             android:layout_height="100dp"
             tools:ignore="MissingConstraints">
             <Button
                 android:id="@+id/btn_test"
-                android:text="向前"
+                android:text="拉流"
                 android:layout_width="100dp"
                 android:layout_height="100dp"
                 />
diff --git a/app/src/main/res/layout/activity_config.xml b/app/src/main/res/layout/activity_config.xml
index 6c5f3f0d..52f4c7b2 100644
--- a/app/src/main/res/layout/activity_config.xml
+++ b/app/src/main/res/layout/activity_config.xml
@@ -746,6 +746,12 @@
                             android:layout_height="wrap_content"
                             android:layout_marginLeft="10dp"
                             android:text="中间" />
+                        <RadioButton
+                            android:id="@+id/rb_camera_null"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_marginLeft="10dp"
+                            android:text="无" />
                     </RadioGroup>
                 </LinearLayout>
 
diff --git a/build.gradle b/build.gradle
index 1cef8b6f..04a2f6e6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -53,6 +53,9 @@ allprojects {
             url "https://repo1.maven.org/maven2"
         }
 
+        // VLC仓库
+        maven { url "https://mirrors.bfsu.edu.cn/videolan-android/repository" }
+
         mavenCentral()
         maven {
             url "https://dl.bintray.com/kotlin/kotlin-eap"
