修改云台偏航向下
This commit is contained in:
parent
2789674a2d
commit
5fd8e30b97
|
|
@ -23,6 +23,9 @@
|
||||||
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
|
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
|
||||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- bugly -->
|
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- bugly -->
|
||||||
|
|
||||||
|
<!-- 安装APK所需权限 -->
|
||||||
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.READ_LOGS" />
|
<uses-permission android:name="android.permission.READ_LOGS" />
|
||||||
|
|
||||||
<!-- 开机启动所需权限 -->
|
<!-- 开机启动所需权限 -->
|
||||||
|
|
@ -110,6 +113,17 @@
|
||||||
</receiver>
|
</receiver>
|
||||||
<service android:name="com.amazonaws.mobileconnectors.s3.transferutility.TransferService" android:enabled="true" />
|
<service android:name="com.amazonaws.mobileconnectors.s3.transferutility.TransferService" android:enabled="true" />
|
||||||
|
|
||||||
|
<!-- FileProvider for APK installation on Android 7.0+ -->
|
||||||
|
<provider
|
||||||
|
android:name="androidx.core.content.FileProvider"
|
||||||
|
android:authorities="${applicationId}.fileprovider"
|
||||||
|
android:exported="false"
|
||||||
|
android:grantUriPermissions="true">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
|
android:resource="@xml/file_paths" />
|
||||||
|
</provider>
|
||||||
|
|
||||||
</application>
|
</application>
|
||||||
|
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
@ -733,6 +733,7 @@ open class MainActivity : BaseActivity() {
|
||||||
startVtxHeartbeat()
|
startVtxHeartbeat()
|
||||||
SpeakerManager.getInstance().initMegaphoneInfo()
|
SpeakerManager.getInstance().initMegaphoneInfo()
|
||||||
|
|
||||||
|
GimbalManager.getInstance().setmode()
|
||||||
|
|
||||||
|
|
||||||
//GimbalManager.getInstance().gimsetmode()
|
//GimbalManager.getInstance().gimsetmode()
|
||||||
|
|
@ -799,7 +800,7 @@ open class MainActivity : BaseActivity() {
|
||||||
|
|
||||||
GeoidManager.getInstance().init(this);
|
GeoidManager.getInstance().init(this);
|
||||||
|
|
||||||
|
GimbalManager.getInstance().setmode()
|
||||||
//GimbalManager.getInstance().gimsetmode()
|
//GimbalManager.getInstance().gimsetmode()
|
||||||
//开启雷达监听器
|
//开启雷达监听器
|
||||||
//PerceptionManager.getInstance().isladraopeninti()
|
//PerceptionManager.getInstance().isladraopeninti()
|
||||||
|
|
@ -821,8 +822,6 @@ open class MainActivity : BaseActivity() {
|
||||||
|
|
||||||
LogUtil.log(TAG, "推流类型:" + PreferenceUtils.getInstance().customStreamType)
|
LogUtil.log(TAG, "推流类型:" + PreferenceUtils.getInstance().customStreamType)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if ((isFlightControllerConnect == null || isFlightControllerConnect != true) && (isCameraConnect == null || isCameraConnect != true)) {
|
if ((isFlightControllerConnect == null || isFlightControllerConnect != true) && (isCameraConnect == null || isCameraConnect != true)) {
|
||||||
handler.postDelayed({
|
handler.postDelayed({
|
||||||
|
|
@ -869,7 +868,7 @@ open class MainActivity : BaseActivity() {
|
||||||
|
|
||||||
//开启雷达监听器
|
//开启雷达监听器
|
||||||
//PerceptionManager.getInstance().isladraopeninti()
|
//PerceptionManager.getInstance().isladraopeninti()
|
||||||
|
GimbalManager.getInstance().setmode()
|
||||||
|
|
||||||
LogUtil.log(TAG, "自定义推流方式:" + PreferenceUtils.getInstance().customStreamType)
|
LogUtil.log(TAG, "自定义推流方式:" + PreferenceUtils.getInstance().customStreamType)
|
||||||
|
|
||||||
|
|
@ -1261,6 +1260,12 @@ open class MainActivity : BaseActivity() {
|
||||||
FLAG_STOP_ARUCO ->
|
FLAG_STOP_ARUCO ->
|
||||||
startArucoType = 0
|
startArucoType = 0
|
||||||
|
|
||||||
|
"REFRESH_VIDEO_SOURCE" -> {
|
||||||
|
// 起飞后刷新视频源,避免FPVWidget因相机状态变化卡死
|
||||||
|
swapVideoSource()
|
||||||
|
LogUtil.log(TAG,"刷新视频流")
|
||||||
|
}
|
||||||
|
|
||||||
MqttCallBack.FLAG_RESET_CLEAN_MODE ->
|
MqttCallBack.FLAG_RESET_CLEAN_MODE ->
|
||||||
setViewVisibilityWithCleanMode()
|
setViewVisibilityWithCleanMode()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ import com.aros.apron.manager.StickManager;
|
||||||
import com.aros.apron.manager.StreamManager;
|
import com.aros.apron.manager.StreamManager;
|
||||||
import com.aros.apron.manager.SystemManager;
|
import com.aros.apron.manager.SystemManager;
|
||||||
import com.aros.apron.manager.TakeOffToPointManager;
|
import com.aros.apron.manager.TakeOffToPointManager;
|
||||||
|
import com.aros.apron.manager.UpdateManager;
|
||||||
import com.aros.apron.mix.Aprondown;
|
import com.aros.apron.mix.Aprondown;
|
||||||
import com.aros.apron.mix.Aprongim;
|
import com.aros.apron.mix.Aprongim;
|
||||||
import com.aros.apron.tools.ApronArucoDetect;
|
import com.aros.apron.tools.ApronArucoDetect;
|
||||||
|
|
@ -600,6 +601,20 @@ public class MqttCallBack extends BaseManager implements MqttCallbackExtended {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Constant.APP_UPDATE:
|
||||||
|
LogUtil.log(TAG, "收到:远程更新 " + jsonString);
|
||||||
|
String apkUrl = message.getData() != null ? message.getData().getUrl() : null;
|
||||||
|
if (apkUrl != null && !apkUrl.isEmpty()) {
|
||||||
|
UpdateManager.getInstance().startUpdate(
|
||||||
|
ApronApp.Companion.getApplication(),
|
||||||
|
apkUrl,
|
||||||
|
() -> sendMsg2Server(message)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
LogUtil.log(TAG, "更新APK链接为空");
|
||||||
|
sendFailMsg2Server(message, "更新APK链接为空");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
// //获取控制权
|
// //获取控制权
|
||||||
// case 60007:
|
// case 60007:
|
||||||
|
|
|
||||||
|
|
@ -342,9 +342,12 @@ public class Constant {
|
||||||
//A1云台校准
|
//A1云台校准
|
||||||
public static final String DRC_LIGHT_CALIBRATION="drc_light_calibration";
|
public static final String DRC_LIGHT_CALIBRATION="drc_light_calibration";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 远程更新APK
|
||||||
|
*/
|
||||||
|
public static final String APP_UPDATE="app_update";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -173,6 +173,12 @@ public class CameraManager extends BaseManager {
|
||||||
Movement.getInstance().setPhoto_status("fail");
|
Movement.getInstance().setPhoto_status("fail");
|
||||||
Movement.getInstance().setMode_code(3);
|
Movement.getInstance().setMode_code(3);
|
||||||
stopReport();
|
stopReport();
|
||||||
|
}else if(t1 == PanoramaExitStatus.ABORTED){
|
||||||
|
Movement.getInstance().setPhoto_current_step(3000);
|
||||||
|
Movement.getInstance().setPhoto_result(0);
|
||||||
|
Movement.getInstance().setPhoto_status("fail");
|
||||||
|
Movement.getInstance().setMode_code(3);
|
||||||
|
stopReport();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -914,9 +914,11 @@ public class FlightManager extends BaseManager {
|
||||||
|
|
||||||
//降落时将云台朝下
|
//降落时将云台朝下
|
||||||
private void gimbalDownwards() {
|
private void gimbalDownwards() {
|
||||||
|
|
||||||
if (goHomeExecutionState == GoHomeState.LANDING.value()
|
if (goHomeExecutionState == GoHomeState.LANDING.value()
|
||||||
&& Movement.getInstance().getElevation() > 11 && !isGimbalDownwards) {
|
&& Movement.getInstance().getElevation() > 11 && !isGimbalDownwards) {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
MediaDataCenter.getInstance().getCameraStreamManager().setVisionAssistViewDirection(VisionAssistDirection.DOWN, new CommonCallbacks.CompletionCallback() {
|
MediaDataCenter.getInstance().getCameraStreamManager().setVisionAssistViewDirection(VisionAssistDirection.DOWN, new CommonCallbacks.CompletionCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
|
|
@ -951,12 +953,18 @@ public class FlightManager extends BaseManager {
|
||||||
DroneHelper.getInstance().setCameraFocusMode();
|
DroneHelper.getInstance().setCameraFocusMode();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
new android.os.Handler().postDelayed(() -> {
|
new android.os.Handler().postDelayed(() -> {
|
||||||
setkuaim();
|
setkuaim();
|
||||||
}, 500);
|
}, 500);
|
||||||
new android.os.Handler().postDelayed(() -> {
|
new android.os.Handler().postDelayed(() -> {
|
||||||
setCameraExposureMode();
|
setCameraExposureMode();
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
|
new android.os.Handler().postDelayed(() -> {
|
||||||
|
EventBus.getDefault().post("REFRESH_VIDEO_SOURCE");
|
||||||
|
}, 2000);
|
||||||
//将镜头设置为自动对焦
|
//将镜头设置为自动对焦
|
||||||
// new android.os.Handler().postDelayed(() -> {
|
// new android.os.Handler().postDelayed(() -> {
|
||||||
// setCameraExposureCompensation();
|
// setCameraExposureCompensation();
|
||||||
|
|
@ -1342,8 +1350,9 @@ public class FlightManager extends BaseManager {
|
||||||
if (!getGimbalAndCameraEnabled()) {
|
if (!getGimbalAndCameraEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
GimbalManager.getInstance().gimbalReset();
|
||||||
|
|
||||||
|
new Handler().postDelayed(() -> {
|
||||||
if (Movement.getInstance().isPlaneWing() && Movement.getInstance().getHome_distance() < 20
|
if (Movement.getInstance().isPlaneWing() && Movement.getInstance().getHome_distance() < 20
|
||||||
&& Movement.getInstance().getElevation() < 88
|
&& Movement.getInstance().getElevation() < 88
|
||||||
&& Movement.getInstance().getBattery_a_capacity_percent() > 25
|
&& Movement.getInstance().getBattery_a_capacity_percent() > 25
|
||||||
|
|
@ -1367,6 +1376,10 @@ public class FlightManager extends BaseManager {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
},1000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//取消返航
|
//取消返航
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,22 @@ public class GimbalManager extends BaseManager {
|
||||||
VirtualStickManager.getInstance().sendVirtualStickAdvancedParam(virtualStickFlightControlParam);
|
VirtualStickManager.getInstance().sendVirtualStickAdvancedParam(virtualStickFlightControlParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setmode() {
|
||||||
|
|
||||||
|
KeyManager.getInstance().setValue(KeyTools.createKey(GimbalKey.KeyGimbalMode, ComponentIndexType.PORT_1), GimbalMode.YAW_FOLLOW, new CommonCallbacks.CompletionCallback() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess() {
|
||||||
|
LogUtil.log(TAG, "云台跟随");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(@NonNull IDJIError idjiError) {
|
||||||
|
LogUtil.log(TAG, "云台跟随失败");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//云台重置
|
//云台重置
|
||||||
public void gimbalReset() {
|
public void gimbalReset() {
|
||||||
|
|
@ -255,6 +271,10 @@ public class GimbalManager extends BaseManager {
|
||||||
case 3:
|
case 3:
|
||||||
GimbalAngleRotation rotation1 = new GimbalAngleRotation();
|
GimbalAngleRotation rotation1 = new GimbalAngleRotation();
|
||||||
rotation1.setMode(GimbalAngleRotationMode.ABSOLUTE_ANGLE);
|
rotation1.setMode(GimbalAngleRotationMode.ABSOLUTE_ANGLE);
|
||||||
|
if (!TextUtils.isEmpty(Movement.getInstance().getGimbal_yaw() + "")) {
|
||||||
|
rotation1.setYaw(Movement.getInstance().getGimbal_yaw());
|
||||||
|
LogUtil.log(TAG,"俯仰向下"+Movement.getInstance().getGimbal_yaw());
|
||||||
|
}
|
||||||
rotation1.setPitch(-90.0);
|
rotation1.setPitch(-90.0);
|
||||||
KeyManager.getInstance().performAction(KeyTools.createKey(GimbalKey.KeyRotateByAngle, ComponentIndexType.PORT_1), rotation1, new CommonCallbacks.CompletionCallbackWithParam<EmptyMsg>() {
|
KeyManager.getInstance().performAction(KeyTools.createKey(GimbalKey.KeyRotateByAngle, ComponentIndexType.PORT_1), rotation1, new CommonCallbacks.CompletionCallbackWithParam<EmptyMsg>() {
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -268,6 +288,22 @@ public class GimbalManager extends BaseManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// GimbalAngleRotation rotation1 = new GimbalAngleRotation();
|
||||||
|
// rotation1.setMode(GimbalAngleRotationMode.ABSOLUTE_ANGLE);
|
||||||
|
// rotation1.setPitch(-90.0);
|
||||||
|
// KeyManager.getInstance().performAction(KeyTools.createKey(GimbalKey.KeyRotateByAngle, ComponentIndexType.PORT_1), rotation1, new CommonCallbacks.CompletionCallbackWithParam<EmptyMsg>() {
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(EmptyMsg emptyMsg) {
|
||||||
|
// sendMsg2Server(message);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onFailure(@NonNull IDJIError error) {
|
||||||
|
// sendFailMsg2Server(message, "偏航向下失败:" + getIDJIErrorMsg(error));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ import com.dji.wpmzsdk.common.data.KMZInfo;
|
||||||
import com.dji.wpmzsdk.manager.WPMZManager;
|
import com.dji.wpmzsdk.manager.WPMZManager;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -270,8 +272,9 @@ public class MissionV3Manager extends BaseManager {
|
||||||
Movement.getInstance().setVirtualStickQuitMission(false);
|
Movement.getInstance().setVirtualStickQuitMission(false);
|
||||||
sendEvent2Server("任务状态:航线任务执行中断", 1);
|
sendEvent2Server("任务状态:航线任务执行中断", 1);
|
||||||
|
|
||||||
Movement.getInstance().setTask_status("paused");
|
|
||||||
if(PreferenceUtils.getInstance().getMissionType()==0){
|
if(PreferenceUtils.getInstance().getMissionType()==0){
|
||||||
|
Movement.getInstance().setTask_status("paused");
|
||||||
sendFlightTaskProgress2Server();
|
sendFlightTaskProgress2Server();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -805,14 +808,10 @@ public class MissionV3Manager extends BaseManager {
|
||||||
sendEvent2Server("任务开始执行", 1);
|
sendEvent2Server("任务开始执行", 1);
|
||||||
Movement.getInstance().setTask_current_step(23);
|
Movement.getInstance().setTask_current_step(23);
|
||||||
|
|
||||||
// Movement.getInstance().setMode_code(5);
|
// 起飞后相机状态变化可能导致FPVWidget卡死,延迟刷新视频源
|
||||||
|
mainHandler.postDelayed(() -> {
|
||||||
// // 自动起飞
|
EventBus.getDefault().post("REFRESH_VIDEO_SOURCE");
|
||||||
// Movement.getInstance().setMode_code(4);
|
}, 2000);
|
||||||
//
|
|
||||||
// new android.os.Handler(android.os.Looper.getMainLooper()).postDelayed(() -> {
|
|
||||||
// Movement.getInstance().setMode_code(5);
|
|
||||||
// }, 2000);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -878,8 +877,14 @@ public class MissionV3Manager extends BaseManager {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess() {
|
public void onSuccess() {
|
||||||
sendMsg2Server(message);
|
sendMsg2Server(message);
|
||||||
|
|
||||||
|
if( PreferenceUtils.getInstance().getMissionType()==0){
|
||||||
Movement.getInstance().setTask_status("paused");
|
Movement.getInstance().setTask_status("paused");
|
||||||
|
|
||||||
|
sendFlightTaskProgress2Server();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//暂停成功就是手动飞行
|
//暂停成功就是手动飞行
|
||||||
Movement.getInstance().setMode_code(3);
|
Movement.getInstance().setMode_code(3);
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ import com.dji.wpmzsdk.common.data.KMZInfo;
|
||||||
import com.dji.wpmzsdk.manager.WPMZManager;
|
import com.dji.wpmzsdk.manager.WPMZManager;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
|
|
||||||
|
import org.greenrobot.eventbus.EventBus;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -392,6 +394,12 @@ public class TakeOffToPointManager extends BaseManager {
|
||||||
sendEvent2Server("任务开始执行", 1);
|
sendEvent2Server("任务开始执行", 1);
|
||||||
Movement.getInstance().setTask_current_step(23);
|
Movement.getInstance().setTask_current_step(23);
|
||||||
Movement.getInstance().setTakeoff_result(0);
|
Movement.getInstance().setTakeoff_result(0);
|
||||||
|
|
||||||
|
// 起飞后相机状态变化可能导致FPVWidget卡死,延迟刷新视频源
|
||||||
|
mainHandler.postDelayed(() -> {
|
||||||
|
EventBus.getDefault().post("REFRESH_VIDEO_SOURCE");
|
||||||
|
}, 2000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue