PSDK 2.0 DJi Pilot 的自定义控件 偶尔会加载失败
已完成使用linux系统平台做开发,DJi Pilot版本为2.3.1.5,前期的初始化操作都已完成,包括数据传输初始化和高速数据传输通道带宽比。但是自定义控件在DJi Pilot中还是偶尔会加载不出来,甚至DJi Pilot自带的控件(快速进入自定义控件界面的按钮)和浮框都加载不出来,请问自定义控件的加载和什么配置相关(带宽占比设置为数据流:视频流:下载流为3:3:4)?
-
尊敬的客户, 您好!感谢您联系DJI大疆创新。 如果初始化不成功,在PsdkTest_WidgetInit中的以下函数会报错。 ![](https://djisdksupport.zendesk.com/attachments/token/bPoWCVy1kRyzGmXoTMt0ctzkO/?name=inline-1652479520.png) 根据您的描述,如果网口稳定,log也没报错,有可能是功能初始成功,只Pilot显示问题,您用的Pilot的版本是多少,如果用的是v3版本,建议您尝试清除Pilot的缓存试试(设置->应用->DJI Pilot->存储->清除缓存)。 如果还是不行,麻烦提供以下信息,我们看是否能复现: 1、飞机和遥控器固件版本,Pilot版本。 2、提供PSDK log。 3、提供拍摄的视频看看,包括ping指令看网络状态,以及您的操作过程和现象。 感谢您的理解与支持,祝您生活愉快! Best Regards, DJI大疆创新SDK技术支持 -
已尝试清除Pilot的缓存,依然会有失败的现象;
飞机和遥控器固件版本:01.00.0710;
Pilot版本:V2.3.1.5;
PSDK Log:
1970:01:01 00:11:01 : PsdkUser_Console_1656:[661.648][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x63FC cur:0x0000[0m
1970:01:01 00:11:01 : PsdkUser_Console_1656:[661.748][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x8FE3 cur:0x0041[0m
1970:01:01 00:11:01 : PsdkUser_Console_1656:[661.848][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x7A71 cur:0x0000[0m
1970:01:01 00:11:01 : PsdkUser_Console_1656:[662.048][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x6D12 cur:0x0444[0m
1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.248][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x41E7 cur:0x0041[0m
1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.348][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x668D cur:0x0041[0m
1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.448][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x5765 cur:0x0000[0m
1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.548][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0xC2B5 cur:0xD5C8[0m
1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.648][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0xDA8B cur:0x4203[0m
1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.748][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x2E6C cur:0x0041[0m
1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.848][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x4232 cur:0x0041[0m
1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.888][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0xE77D cur:0x4100[0m
1970:01:01 00:11:02 : PsdkUser_Console_1656:[662.948][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x2C9A cur:0x0041[0m
1970:01:01 00:11:02 : PsdkUser_Console_1656:[663.048][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x7CE2 cur:0x042C[0m
1970:01:01 00:11:03 : PsdkUser_Console_1656:[663.148][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x125D cur:0x0041[0m
1970:01:01 00:11:03 : PsdkUser_Console_1656:[663.188][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0x30E8 cur:0x0F00[0m
1970:01:01 00:11:03 : PsdkUser_Console_1656:[663.248][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0xDF9C cur:0x0041[0m
1970:01:01 00:11:03 : PsdkUser_Console_1656:[663.288][module_command]-[33m[Warn]-[PsdkCommand_ProtParse:588]protocol frame crc16 error, exp:0xD699 cur:0x1F0C[0m
1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_command]-[31m[Error]-[PsdkCommand_SendASyncHandle:866]Command async send error 0[0m
1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_xport]-[33m[Warn]-[PsdkXPort_GetUserParameterAsyncCallback:998]get user parameter timeout.[0m
1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_command]-[31m[Error]-[PsdkCommand_SendASyncHandle:866]Command async send error 1[0m
1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_xport]-[33m[Warn]-[PsdkXPort_GetUserParameterAsyncCallback:998]get user parameter timeout.[0m
1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_command]-[31m[Error]-[PsdkCommand_SendASyncHandle:866]Command async send error 2[0m
1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_xport]-[33m[Warn]-[PsdkXPort_GetUserParameterAsyncCallback:998]get user parameter timeout.[0m
1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_command]-[31m[Error]-[PsdkCommand_SendASyncHandle:866]Command async send error 3[0m
1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_xport]-[33m[Warn]-[PsdkXPort_GetUserParameterAsyncCallback:998]get user parameter timeout.[0m
1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_command]-[31m[Error]-[PsdkCommand_SendASyncHandle:866]Command async send error 4[0m
1970:01:01 00:11:04 : PsdkUser_Console_1656:[664.668][module_xport]-[33m[Warn]-[PsdkXPort_GetUserParameterAsyncCallback:998]get user parameter timeout.[0m
1970:01:01 00:01:02 : PsdkUser_Console_1656:[62.525][module_camera]-[31m[Error]-[PsdkCamera_SetFocusRingValueHandle:2203]set focus ring value error: 0x00000100.[0m
1970:01:01 00:01:02 : PsdkUser_Console_1656:[62.642][module_camera]-[31m[Error]-[PsdkCamera_SetFocusRingValueHandle:2203]set focus ring value error: 0x00000100.[0m
1970:01:01 00:01:03 : PsdkUser_Console_1656:[62.711][module_camera]-[31m[Error]-[PsdkCamera_SetFocusRingValueHandle:2203]set focus ring value error: 0x00000100.[0m
1970:01:01 00:02:01 : PsdkUser_Console_1656:[121.067][module_camera]-[31m[Error]-[PsdkCamera_SetMeteringModeHandle:1979]set metering mode error: 0x00000100.[0m
操作过程:遥控器一直保持开机状态,只对无人机做开关机操作(二十次);
现象:在遥控器端,自定义控件有两三次加载不出来(有时重新关闭遥控器显示屏,自定义控件又能重新加载出来)。
-
以下是我PSDK的启动代码,初始化流程是否有问题,Widget_Init和Psdk_XPortInit函数的位置我修改过多次,都无效:
T_PsdkReturnCode returnCode;
T_PsdkUserInfo userInfo;
T_PsdkLoggerConsole printConsole = {
.consoleLevel = PSDK_LOGGER_CONSOLE_LOG_LEVEL_ERROR,
.func = PsdkUser_Console,
};
T_PsdkHalUartHandler halUartHandler = {
.UartInit = Hal_UartInit,
.UartReadData = Hal_UartReadData,
.UartWriteData = Hal_UartSendData,
};T_PsdkHalNetWorkHandler halNetWorkHandler = {
.NetWorkConfig = HalNetWork_Config,
};T_PsdkOsalHandler osalHandler = {
.Malloc = Osal_Malloc,
.Free = Osal_Free,
.TaskCreate = Osal_TaskCreate,
.TaskDestroy = Osal_TaskDestroy,
.TaskSleepMs = Osal_TaskSleepMs,
.MutexCreate = Osal_MutexCreate,
.MutexDestroy = Osal_MutexDestroy,
.MutexLock = Osal_MutexLock,
.MutexUnlock = Osal_MutexUnlock,
.SemaphoreCreate = Osal_SemaphoreCreate,
.SemaphoreDestroy = Osal_SemaphoreDestroy,
.SemaphoreWait = Osal_SemaphoreWait,
.SemaphorePost = Osal_SemaphorePost,
.SemaphoreTimedWait = Osal_SemaphoreTimedWait,
.GetTimeMs = Osal_GetTimeMs,
};T_PsdkAircraftInfoBaseInfo aircraftBaseInfo = {0};
if (PsdkPlatform_RegHalUartHandler(&halUartHandler) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
printf("psdk register hal uart handler error");
WRITE_SD_LOG("psdk register hal uart handler error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}if (PsdkPlatform_RegHalNetworkHandler(&halNetWorkHandler) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
printf("psdk register hal network handler error");
WRITE_SD_LOG("psdk register hal network handler error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}if (PsdkPlatform_RegOsalHandler(&osalHandler) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
printf("psdk register osal handler error");
WRITE_SD_LOG("psdk register osal handler error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}if (PsdkUser_FillInUserInfo(&userInfo) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
printf("psdk fill in user info error");
WRITE_SD_LOG("psdk fill in user info error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}pthread_t CheckCoreInitTid = 0;
pthread_create(&CheckCoreInitTid, NULL, CheckCoreInitResultTask, NULL);
printf("Psdk Core Start Init...\n");
//int64_t InitStartTimeMs = time_ms();
returnCode = PsdkCore_Init(&userInfo);
if (returnCode != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
g_bPsdkCoreInitFinish = true;
LOGE("psdk core init error returnCode== %lld", returnCode);
printf("psdk core init error returnCode== %lld \n", returnCode);
WRITE_SD_LOG("psdk core init error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
g_bPsdkCoreInitFinish = true;
//printf("Psdk Core Init time == %d ms! \n", time_ms() - InitStartTimeMs);
printf("Psdk Core Init Finish!\n");if (Widget_Init(SystemType) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
LOGE("Widget_Init error.");
WRITE_SD_LOG("Widget_Init error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
if (PsdkAircraftInfo_GetBaseInfo(&aircraftBaseInfo) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
PsdkLogger_UserLogError("get aircraft information error.");
WRITE_SD_LOG("get aircraft information error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}if (PsdkLogger_AddConsole(&printConsole) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
printf("psdk add console print error\n");
WRITE_SD_LOG("psdk add console print error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
/** 初始化功能模块 */
//设置带宽占用比例
T_PsdkDataChannelBandwidthProportionOfHighspeedChannel bandwidthProportion;
bandwidthProportion.videoStream = 30;
bandwidthProportion.dataStream = 50;
bandwidthProportion.downloadStream = 20;
returnCode = PsdkDataChannel_SetBandwidthProportionForHighspeedChannel(bandwidthProportion);
if(returnCode != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS){
LOGE("Set Bandwidth Proportion error:%lld", returnCode);
WRITE_SD_LOG("Set Bandwidth Proportion error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}if((PSDK_AIRCRAFT_INFO_TYPE_M210RTK_V2 == aircraftBaseInfo.aircraftType) ||
(PSDK_AIRCRAFT_INFO_TYPE_M300_RTK == aircraftBaseInfo.aircraftType)){
g_bUavRTKFlag = true;
}else{
g_bUavRTKFlag = false;
}//相机初始化
if (Camera_Init() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
LOGE("Camera_Init error.");
WRITE_SD_LOG("Camera_Init error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
if(PowerManagementInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
LOGE("PowerManagementInit error.");
WRITE_SD_LOG("PowerManagementInit error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}if(aircraftBaseInfo.psdkAdapterType == PSDK_AIRCRAFT_INFO_PSDK_ADAPTER_TYPE_XPORT){
if (Psdk_XPortInit() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
LOGE("Psdk_XPortInit error.");
WRITE_SD_LOG("Psdk_XPortInit error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
}
/** DataSubscription_Init 一定要在 Psdk_XPortInit 之后 */
if (DataSubscription_Init() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
LOGE("DataSubscription error.");
WRITE_SD_LOG("DataSubscription error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}//设置负载设备的别称
if (PsdkProductInfo_SetAlias(DEVICE_NAME) != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
//LOGE("set product alias error.");
WRITE_SD_LOG("set product alias error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
}
if (PsdkCore_ApplicationStart() != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
LOGE("psdk application start error");
WRITE_SD_LOG("psdk application start error.");
return PSDK_ERROR_SYSTEM_MODULE_CODE_UNKNOWN;
} -
抱歉,这边以为您用的是M300机型,前面提到的ip是M300下方2个云台口的。如果您用的是M200 v2系统,挂1号云台口是192.168.5.10,您可以参考以下图片。 ![](https://djisdksupport.zendesk.com/attachments/token/v9eYxiXNR5hOQ8MrYFeY4m2cS/?name=image.png) ![](https://djisdksupport.zendesk.com/attachments/token/UTrVFNIFNGoOzDRR1ycOvvo02/?name=image.png) -
视频中第一次开机就出现自定义控件加载失败(清理缓存后再次进入就加载成功了)的问题,第二次开机则是正常的。
操作过程视频百度云盘链接:https://pan.baidu.com/s/1ur_wpAMiIZiqzdzZ5xOTgQ
提取码:styiPilot版本截图如下:
请先登录再写评论。
评论
16 条评论