1、修改界面:显示xport的姿态角(pitch、roll、yaw);
2、linux修改了时区后(timedatectl set-timezone "Asia/Shanghai"),psdk同步飞机的时间到nanopi需要+8hour; 3、m300遥控器界面添加手动设置曝光时间;
This commit is contained in:
@ -197,6 +197,8 @@ static void *UserDataSubscription_Task(void *arg)
|
|||||||
}//PsdkLogger_UserLogInfo
|
}//PsdkLogger_UserLogInfo
|
||||||
|
|
||||||
|
|
||||||
|
printf("开始设置时间\n");
|
||||||
|
system('date');
|
||||||
if(counter>1 &&counter<10 && isGetGpsDate_time)//避免dji的bug:第一次获取的gpsDate和gpsTime都为0
|
if(counter>1 &&counter<10 && isGetGpsDate_time)//避免dji的bug:第一次获取的gpsDate和gpsTime都为0
|
||||||
{
|
{
|
||||||
char *gpsDate_str = (char *)malloc(sizeof(char)*50);
|
char *gpsDate_str = (char *)malloc(sizeof(char)*50);
|
||||||
@ -244,7 +246,7 @@ static void *UserDataSubscription_Task(void *arg)
|
|||||||
info.tm_year = atoi(year) - 1900;;
|
info.tm_year = atoi(year) - 1900;;
|
||||||
info.tm_mon = atoi(mon) - 1;
|
info.tm_mon = atoi(mon) - 1;
|
||||||
info.tm_mday = atoi(mday);
|
info.tm_mday = atoi(mday);
|
||||||
info.tm_hour = atoi(hour);
|
info.tm_hour = atoi(hour) + 8;
|
||||||
info.tm_min = atoi(min);
|
info.tm_min = atoi(min);
|
||||||
info.tm_sec = atoi(sec);
|
info.tm_sec = atoi(sec);
|
||||||
info.tm_isdst = -1;
|
info.tm_isdst = -1;
|
||||||
|
@ -77,11 +77,15 @@ static int s_stateOfXimea=0;
|
|||||||
static int s_stateOfSbg=0;
|
static int s_stateOfSbg=0;
|
||||||
static int s_stateOfFile=0;
|
static int s_stateOfFile=0;
|
||||||
|
|
||||||
static char * s_strStateOfSbg="未打开";
|
static char * s_strStateOfSbg="None";
|
||||||
static char * s_strSbgAccuracy="1000";
|
static char * s_strSbgAccuracy="None";
|
||||||
static char * s_strSbgSatelliteCounter="0";
|
static char * s_strSbgSatelliteCounter="None";
|
||||||
static char * s_strSbgSolutionMode="UNINITIALIZED";
|
static char * s_strSbgSolutionMode="None";
|
||||||
static char * s_strStateOfXimea="未打开";
|
static char * s_strStateOfXimea="None";
|
||||||
|
|
||||||
|
char * s_strPitch="None";
|
||||||
|
char * s_strRoll="None";
|
||||||
|
char * s_strYaw="None";
|
||||||
|
|
||||||
static int s_sockfd;
|
static int s_sockfd;
|
||||||
static struct sockaddr_in s_server;
|
static struct sockaddr_in s_server;
|
||||||
@ -100,8 +104,9 @@ static const T_PsdkWidgetHandlerListItem s_widgetHandlerList[] = {
|
|||||||
{5, PSDK_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
{5, PSDK_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{6, PSDK_WIDGET_TYPE_INT_INPUT_BOX, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
{6, PSDK_WIDGET_TYPE_INT_INPUT_BOX, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{7, PSDK_WIDGET_TYPE_BUTTON, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
{7, PSDK_WIDGET_TYPE_BUTTON, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{8, PSDK_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
{8, PSDK_WIDGET_TYPE_INT_INPUT_BOX, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
{9, PSDK_WIDGET_TYPE_LIST, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},//PsdkTestWidget_SetWidgetValue
|
{9, PSDK_WIDGET_TYPE_SWITCH, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},
|
||||||
|
{10, PSDK_WIDGET_TYPE_LIST, PsdkTestWidget_SetWidgetValue_StartRecord, PsdkTestWidget_GetWidgetValue, NULL},//PsdkTestWidget_SetWidgetValue
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *s_widgetTypeNameArray[] = {
|
static char *s_widgetTypeNameArray[] = {
|
||||||
@ -269,7 +274,8 @@ static void *PsdkTest_WidgetTask(void *arg)
|
|||||||
|
|
||||||
//snprintf(message, PSDK_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN, "System time: %u ms;\nMAG: %d;\nIMAGER: %d;\nIMU: %d;\nFile: %d;\n", sysTimeMs, s_sbgMagState, s_stateOfXimea, s_stateOfSbg, s_stateOfFile);
|
//snprintf(message, PSDK_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN, "System time: %u ms;\nMAG: %d;\nIMAGER: %d;\nIMU: %d;\nFile: %d;\n", sysTimeMs, s_sbgMagState, s_stateOfXimea, s_stateOfSbg, s_stateOfFile);
|
||||||
|
|
||||||
snprintf(message, PSDK_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN, "System time: %u ms;\n光谱仪: %s;\n惯导: %s;\n精度: %s;\n卫星: %s;\n", sysTimeMs, s_strStateOfXimea, s_strStateOfSbg, s_strSbgAccuracy, s_strSbgSatelliteCounter);
|
snprintf(message, PSDK_WIDGET_FLOATING_WINDOW_MSG_MAX_LEN, "System time: %u ms;\n光谱仪: %s;\n惯导: %s;\n精度: %s;\n卫星: %s;\npitch: %s;\nroll: %s;\nyaw: %s;\n",
|
||||||
|
sysTimeMs, s_strStateOfXimea, s_strStateOfSbg, s_strSbgAccuracy, s_strSbgSatelliteCounter, s_strPitch, s_strRoll, s_strYaw);
|
||||||
|
|
||||||
psdkStat = PsdkWidgetFloatingWindow_ShowMessage(message);
|
psdkStat = PsdkWidgetFloatingWindow_ShowMessage(message);
|
||||||
if (psdkStat != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
if (psdkStat != PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS) {
|
||||||
@ -438,7 +444,7 @@ static void *PsdkTest_IrisRecordSystemChanged(void *arg)//
|
|||||||
s_strStateOfXimea="帧率设置完成";
|
s_strStateOfXimea="帧率设置完成";
|
||||||
break;
|
break;
|
||||||
case 103:
|
case 103:
|
||||||
s_strStateOfXimea="自动曝光完成";
|
s_strStateOfXimea="设置曝光完成";
|
||||||
break;
|
break;
|
||||||
case 104:
|
case 104:
|
||||||
s_strStateOfXimea="正在采集";
|
s_strStateOfXimea="正在采集";
|
||||||
@ -522,7 +528,16 @@ static T_PsdkReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_PsdkWidgetTy
|
|||||||
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8://手动设置曝光时间
|
||||||
|
{
|
||||||
|
char command[50] = "7,";
|
||||||
|
char exposureTime[20];
|
||||||
|
sprintf(exposureTime,"%d",value);
|
||||||
|
strcat(command,exposureTime);
|
||||||
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 9:
|
||||||
if (value==0)//停止采集
|
if (value==0)//停止采集
|
||||||
{
|
{
|
||||||
char* command = "4";
|
char* command = "4";
|
||||||
@ -534,8 +549,8 @@ static T_PsdkReturnCode PsdkTestWidget_SetWidgetValue_StartRecord(E_PsdkWidgetTy
|
|||||||
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
sendto(s_sockfd, command,strlen(command),0,(struct sockaddr *)&s_server,sizeof(s_server));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 10:
|
||||||
if (value==0)//无操作
|
if (value==0)//等待指令
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
if (value==1)
|
if (value==1)
|
||||||
|
@ -92,11 +92,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 8,
|
"widget_index": 8,
|
||||||
|
"widget_type": "int_input_box",
|
||||||
|
"widget_name": "曝光时间",
|
||||||
|
"int_input_box_hint": "unit:ms"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widget_index": 9,
|
||||||
"widget_type": "switch",
|
"widget_type": "switch",
|
||||||
"widget_name": "开始采集"
|
"widget_name": "开始采集"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 9,
|
"widget_index": 10,
|
||||||
"widget_type": "list",
|
"widget_type": "list",
|
||||||
"widget_name": "系统指令",
|
"widget_name": "系统指令",
|
||||||
"list_item": [
|
"list_item": [
|
||||||
@ -104,7 +110,7 @@
|
|||||||
"item_name": "等待指令"
|
"item_name": "等待指令"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_name": "重启图传"
|
"item_name": "采集HSI"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_name": "重启300TC"
|
"item_name": "重启300TC"
|
||||||
|
@ -92,11 +92,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 8,
|
"widget_index": 8,
|
||||||
|
"widget_type": "int_input_box",
|
||||||
|
"widget_name": "曝光时间",
|
||||||
|
"int_input_box_hint": "unit:ms"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"widget_index": 9,
|
||||||
"widget_type": "switch",
|
"widget_type": "switch",
|
||||||
"widget_name": "开始采集"
|
"widget_name": "开始采集"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"widget_index": 9,
|
"widget_index": 10,
|
||||||
"widget_type": "list",
|
"widget_type": "list",
|
||||||
"widget_name": "列表_10",
|
"widget_name": "列表_10",
|
||||||
"list_item": [
|
"list_item": [
|
||||||
@ -104,7 +110,7 @@
|
|||||||
"item_name": "等待指令"
|
"item_name": "等待指令"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_name": "无"
|
"item_name": "采集HSI"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_name": "重启电脑"
|
"item_name": "重启电脑"
|
||||||
|
@ -53,6 +53,10 @@ static T_PsdkGimbalSystemState s_userXPortSystemState = {0};
|
|||||||
static bool s_isUserXPortInited = false;
|
static bool s_isUserXPortInited = false;
|
||||||
static bool s_isUserXPortSystemStateVaild = false;
|
static bool s_isUserXPortSystemStateVaild = false;
|
||||||
|
|
||||||
|
extern char * s_strPitch;
|
||||||
|
extern char * s_strRoll;
|
||||||
|
extern char * s_strYaw;
|
||||||
|
|
||||||
/* Exported functions definition ---------------------------------------------*/
|
/* Exported functions definition ---------------------------------------------*/
|
||||||
T_PsdkReturnCode PsdkTest_XPortInit(void)
|
T_PsdkReturnCode PsdkTest_XPortInit(void)
|
||||||
{
|
{
|
||||||
@ -349,12 +353,22 @@ static T_PsdkReturnCode ReceiveXPortSystemState(T_PsdkGimbalSystemState systemSt
|
|||||||
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char * pitchTmp[10];
|
||||||
|
char * rollTmp[10];
|
||||||
|
char * yawTmp[10];
|
||||||
static T_PsdkReturnCode ReceiveXPortAttitudeInformation(T_PsdkGimbalAttitudeInformation attitudeInformation)
|
static T_PsdkReturnCode ReceiveXPortAttitudeInformation(T_PsdkGimbalAttitudeInformation attitudeInformation)
|
||||||
{
|
{
|
||||||
PsdkLogger_UserLogDebug("receive XPort attitude information:");
|
PsdkLogger_UserLogDebug("receive XPort attitude information:");
|
||||||
PsdkLogger_UserLogDebug("XPort attitude: pitch %d, roll %d, yaw %d.", attitudeInformation.attitude.pitch,
|
PsdkLogger_UserLogDebug("XPort attitude: pitch %d, roll %d, yaw %d.", attitudeInformation.attitude.pitch,
|
||||||
attitudeInformation.attitude.roll, attitudeInformation.attitude.yaw);
|
attitudeInformation.attitude.roll, attitudeInformation.attitude.yaw);
|
||||||
|
|
||||||
|
sprintf(pitchTmp, "%d", attitudeInformation.attitude.pitch);
|
||||||
|
sprintf(rollTmp, "%d", attitudeInformation.attitude.roll);
|
||||||
|
sprintf(yawTmp, "%d", attitudeInformation.attitude.yaw);
|
||||||
|
s_strPitch = pitchTmp;
|
||||||
|
s_strRoll = rollTmp;
|
||||||
|
s_strYaw = yawTmp;
|
||||||
|
|
||||||
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
return PSDK_ERROR_SYSTEM_MODULE_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
/* Includes ------------------------------------------------------------------*/
|
/* Includes ------------------------------------------------------------------*/
|
||||||
#include "psdk_typedef.h"
|
#include "psdk_typedef.h"
|
||||||
#include "psdk_xport.h"
|
#include "psdk_xport.h"
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
Reference in New Issue
Block a user