|
@@ -0,0 +1,949 @@
|
|
|
|
+/********************************************************************
|
|
|
|
+ * $I
|
|
|
|
+ * @Technic Support: <sdk@isurestar.com>
|
|
|
|
+ * All right reserved, Sure-Star Coop.
|
|
|
|
+ ********************************************************************/
|
|
|
|
+#ifndef ICD_LIDAR_API_H_
|
|
|
|
+#define ICD_LIDAR_API_H_
|
|
|
|
+
|
|
|
|
+#include <stdio.h>
|
|
|
|
+#include <stdlib.h>
|
|
|
|
+#include <sys/types.h>
|
|
|
|
+#include <stdint.h>
|
|
|
|
+#ifndef _WINDOWS
|
|
|
|
+ #include <unistd.h>
|
|
|
|
+ #include <sys/time.h>
|
|
|
|
+#endif
|
|
|
|
+#pragma pack(2)
|
|
|
|
+
|
|
|
|
+const char LIDAR_IPADDR_DFLT[] = "192.168.0.188"; //!< 默认IP:192.168.0.188
|
|
|
|
+const char LIDAR_IPADDR_WIFI[] = "192.168.10.1" ; //!< 无线控制 IP:192.168.10.1
|
|
|
|
+const char XFANS_IPADDR_DFLT[] = "224.0.0.1" ; //!< 默认IP:192.168.0.188
|
|
|
|
+
|
|
|
|
+//TCP port
|
|
|
|
+const int LIDAR_MSGPORT = 2008; //消息数据端口
|
|
|
|
+const int LIDAR_PNTPORT = 2009; //雷达数据端口
|
|
|
|
+const int LIDAR_IMGPORT = 2011; //图像数据端口
|
|
|
|
+const int LIDAR_SLWPORT = 2012; //导航数据端口
|
|
|
|
+const int LIDAR_GPSPORT = 2020; //GNSS传输端口
|
|
|
|
+
|
|
|
|
+//UDP port
|
|
|
|
+const int LIDAR_UDPPORT = 2013 ; //UDP CMD 端口
|
|
|
|
+const int XFANS_DATA_UDPPORT = 2014 ; //LIDAR_UDP_DATA_UDPPORT
|
|
|
|
+const int LIDAR_UDP_DATA_UDPPORT = 2014 ; //... obsolete
|
|
|
|
+const int XFANS_CMD_UDPPORT = 2015 ; //LIDAR_UDP_CMD_UDPPORT
|
|
|
|
+const int LIDAR_UDP_CMD_UDPPORT = 2015 ; //... obsolete
|
|
|
|
+const int LIDAR_GPSMSG_UDPPORT = 2016 ; //端口
|
|
|
|
+const int SCADA_UDP_CPORT = 2017 ; // 本地UDP端口号
|
|
|
|
+const int IPCFG_UDP_CPORT = 2018 ; // 本地UDP端口号,用于IP配置
|
|
|
|
+const int GROUND_DATAPORT = 2208 ; // ATG 消息数据端口
|
|
|
|
+
|
|
|
|
+const int LIDAR_UDP_SLW_UDPPORT = 2025 ;
|
|
|
|
+const int LIDAR_UDP_HEART_DBG_UDPPORT = 2030 ;
|
|
|
|
+
|
|
|
|
+const int COMMON_BUFFER_SIZE = 10000;
|
|
|
|
+
|
|
|
|
+typedef enum {
|
|
|
|
+ e_msgCnt = 0x01,
|
|
|
|
+ e_pntCnt = 0x02,
|
|
|
|
+ e_imgCnt = 0x04,
|
|
|
|
+ e_slwCnt = 0x08,
|
|
|
|
+ e_gpsCnt = 0x10,
|
|
|
|
+ e_allCnt = 0x1F, // e_msgCnt | e_pntCnt | e_imgCnt | e_slwCnt | e_gpsCnt
|
|
|
|
+ e_allTcp = 0x1F1F,
|
|
|
|
+ //
|
|
|
|
+ e_udpMsg = 0x010000, //0x01 << 16
|
|
|
|
+ e_udpGps = 0x020000,
|
|
|
|
+ e_udpAtg = 0x040000,
|
|
|
|
+ e_udppnt = 0x080000, // udp快数据
|
|
|
|
+ e_udpslw = 0x100000, // udp慢数据
|
|
|
|
+ e_udphet = 0x200000, // upd心跳包
|
|
|
|
+ e_udpPet = 0x400000,
|
|
|
|
+ e_udpCmdV40 = 0x800000,
|
|
|
|
+ e_allUdp = 0x7f0000,
|
|
|
|
+ //
|
|
|
|
+ e_allEth = 0x5FFFFF,
|
|
|
|
+} ICNT_CNTSTATE_E; //before ICNT_STATE_E
|
|
|
|
+
|
|
|
|
+/// CMDID字段命令码定义
|
|
|
|
+typedef enum {
|
|
|
|
+ eMsgSoftCk, ///< 0x0
|
|
|
|
+ eMsgEnvir, ///< 0x1
|
|
|
|
+ eMsgCamera, ///< 0x2
|
|
|
|
+ eMsgScanner, ///< 0x3
|
|
|
|
+ eMsgTurret, ///< 0x4
|
|
|
|
+ eMsgLaser, ///< 0x5
|
|
|
|
+ eMsgProgam, ///< 0x6
|
|
|
|
+ eMsgAll, ///< 0x7
|
|
|
|
+ eMsgStat, ///< 0x8
|
|
|
|
+ eMsgRegister, ///< 0x9
|
|
|
|
+ eMsgRuler, ///< 0xA
|
|
|
|
+ eMsgUsbCmr, ///< 0xB
|
|
|
|
+ eMsgUmrTrig, ///< 0xC
|
|
|
|
+ eMsgHeader, ///< 0xD
|
|
|
|
+ eMsgString, ///< 0xE
|
|
|
|
+ eMsgStepMto, ///< 0xF
|
|
|
|
+ eMsgDataInfo, ///< 0x10
|
|
|
|
+ eMsgCameraRprt, ///< 0x11
|
|
|
|
+ eMsgSensorRprt, ///< 0x12
|
|
|
|
+ eMsgCompassRead, ///< 0x13
|
|
|
|
+ eMsgFpgaStat, ///< 0x14
|
|
|
|
+ eMsgDataSave, ///< 0x15
|
|
|
|
+ eMsgTaskStop, ///< 0x16
|
|
|
|
+ eMsgDMI, ///< 0x17
|
|
|
|
+ eMsgPCM, ///< 0x18
|
|
|
|
+ eMsgPDT, ///< 0x19
|
|
|
|
+ eMsgPST, ///< 0x1A
|
|
|
|
+ eMsgEnvirAsk, ///< 0x1B
|
|
|
|
+ eMsgSyncTime, ///< 0x1C
|
|
|
|
+ eMsgGpsTrack, ///< 0x1D
|
|
|
|
+ eLidarReset, ///< 0x1E
|
|
|
|
+ eMsgStorgeDir, ///< 0x1F
|
|
|
|
+ eMsgAppDeviceMeta, ///< 0x20 设备信息
|
|
|
|
+ eMsgAPPCountPro, ///< 0x21 统计工程数量
|
|
|
|
+ eMsgAPPGetPro, ///< 0x22 获取工程信息
|
|
|
|
+ eMsgAPPGetProg, ///< 0x23 获取工程作业信息
|
|
|
|
+ eMsgAPPGetCommPro, ///< 0x24 获取工程备注信息
|
|
|
|
+ eMsgAPPUpdatePro, ///< 0x25 更新工程信息
|
|
|
|
+ eMsgAPPDeletePro, ///< 0x26 删除工程
|
|
|
|
+ eMsgAPPAddCommPro, ///< 0x27 增加工程备注
|
|
|
|
+ eMsgAPPCreatePro, ///< 0x28 新建工程
|
|
|
|
+ eMsgBatchReadRequest, ///< 0x29
|
|
|
|
+ eMsgBatchReadRprt, ///< 0x2A
|
|
|
|
+ eMsgBatchWriteRequest, ///< 0x2B
|
|
|
|
+ eMsgBatchWriteRprt, ///< 0x2C
|
|
|
|
+ eMsgMovProgam, ///< 0x2D
|
|
|
|
+ eMsgECKGetState, ///< 0x2E
|
|
|
|
+ eMsgECKCtrlAlarm, ///< 0x2F
|
|
|
|
+ eMsgECKGetBatInfo, ///< 0x30
|
|
|
|
+ eMsgECKCtrlPtz, ///< 0x31
|
|
|
|
+ eMsgfindDeviceReq, ///< 0x32 发现设备请求命令
|
|
|
|
+ eMsgfindDeviceResp, ///< 0x33 发现设备命令应答
|
|
|
|
+ eMsgIPCfgReq, ///< 0x34 IP配置请求命令
|
|
|
|
+ eMsgIPCfgResp, ///< 0x35 IP配置命令应答
|
|
|
|
+ eMsgheartBeatReq, ///< 0x36 设备心跳信息请求命令
|
|
|
|
+ eMsgheartBeatResp, ///< 0x37 设备心跳信心命令应答
|
|
|
|
+ eMsgDataPath, ///< 0x38 修改文件存储路径指令
|
|
|
|
+ eMsgAppSvrLocation, ///< 0x39
|
|
|
|
+ eMsgAppSvrGetcatalog, ///< 0x3a
|
|
|
|
+ eMsgAppSvrCatalognum, ///< 0x3b
|
|
|
|
+ eMsgAppSvrUpdatecatalog, ///< 0x3c
|
|
|
|
+ eMsgAppSvrRemovecatalog, ///< 0x3d
|
|
|
|
+ eMsgAppSvrAddcomment, ///< 0x3e
|
|
|
|
+ eMsgAppSvrGetcomment, ///< 0x3f
|
|
|
|
+ eMsgAppSvrUpdatecomment, ///< 0x40
|
|
|
|
+ eMsgDACSetReq, ///< 0x41 DAC设备电压设置请求命令
|
|
|
|
+ eMsgDACSetResp, ///< 0x42 DAC设备电压设置命令应答
|
|
|
|
+ eMsgTMPGetReq, ///< 0x43 温度读取命令请求
|
|
|
|
+ eMsgTMPGetResp, ///< 0x44 温度读取命令应答
|
|
|
|
+ eMsgEnvirExt, ///< 0x45
|
|
|
|
+ eMsgMta, ///< 0x46
|
|
|
|
+ eMsgCameraRpt, ///< 0x47
|
|
|
|
+ eMsgADCGetReq, ///< 0x48 ADC数据读取命令
|
|
|
|
+ eMsgADCGetResp, ///< 0x49 ADC数据读取命令应答
|
|
|
|
+ eMsgCfgGtrlReq, ///< 0x4A 配置文件控制命令
|
|
|
|
+ eMsgCfgGtrlResp, ///< 0x4B 配置文件控制命令应答
|
|
|
|
+
|
|
|
|
+} LiDAR_MSGID_E, LiDAR_CMDID_E;
|
|
|
|
+
|
|
|
|
+const uint16_t OPEN_LIDAR_CMD_NUM = 0x37;
|
|
|
|
+const uint16_t LIDAR_BODY_MAX = 1028;
|
|
|
|
+const uint16_t LIDAR_BODY_MAX_OLD = 64;
|
|
|
|
+
|
|
|
|
+typedef enum {
|
|
|
|
+ eLidarProgError, // 0
|
|
|
|
+ eLidarProgStandBy, // 1
|
|
|
|
+ eLidarProgDateSet, // 2
|
|
|
|
+ eLidarProgReady, // 3
|
|
|
|
+ eLidarProgEnvir, // 4
|
|
|
|
+ eLidarProgCamera, // 5
|
|
|
|
+ eLidarProgMotor, // 6
|
|
|
|
+ eLidarProgStage, // 7
|
|
|
|
+ eLidarProgLaser, // 8
|
|
|
|
+ eLidarProgStart, // 9
|
|
|
|
+ eLidarProgAction, // 10 eLidarProgReady <-> eLidarProgAction
|
|
|
|
+// eLidarCmrScaning, // 10 eLidarProgReady <-> eLidarCmrScaning
|
|
|
|
+// eLidarCmrWaitImg1,
|
|
|
|
+// eLidarCmrWaitImg2,
|
|
|
|
+// eLidarCmrTrigOK,
|
|
|
|
+ eLidarStopAll,
|
|
|
|
+// eLidarProgBreak,
|
|
|
|
+// eLidarCmrInit,
|
|
|
|
+// eLidarCmrInited,
|
|
|
|
+// eLidarCmrFinished,
|
|
|
|
+// eLidarUCmrInit,
|
|
|
|
+// eLidarUCmrScaning,
|
|
|
|
+// eLidarUCmrWaiting,
|
|
|
|
+// eLidarUCmrFinished,
|
|
|
|
+// eLidarCheckStagStop,
|
|
|
|
+// eLidarUCmrTrigger,
|
|
|
|
+// eLidarCmrTrigger,
|
|
|
|
+// elidarProgPre, // obsolete
|
|
|
|
+} LDRPROG_STAT_E, LiDAR_STATMACH_E;
|
|
|
|
+
|
|
|
|
+typedef enum {
|
|
|
|
+ eDevCmdIdle = 0,
|
|
|
|
+ eDevCmdWork,
|
|
|
|
+ eDevCmdSimu,
|
|
|
|
+// eDevCmdBreak,
|
|
|
|
+ eDevCmdReset,
|
|
|
|
+ eDevCmdAsk, //查询指令
|
|
|
|
+} SCDEV_CMD_E, LDRDEV_CMD_S;
|
|
|
|
+
|
|
|
|
+typedef struct atg_ {
|
|
|
|
+ unsigned int header;
|
|
|
|
+ float height;
|
|
|
|
+ float staDeviation;
|
|
|
|
+ unsigned int packetIndex;
|
|
|
|
+ unsigned int checksum_crc32;
|
|
|
|
+} GROUND_DATA_S;
|
|
|
|
+
|
|
|
|
+typedef struct {//ref: struct tm from <time.h>
|
|
|
|
+ unsigned short tm_sec; /* Seconds (0-60) */
|
|
|
|
+ unsigned short tm_min; /* Minutes (0-59) */
|
|
|
|
+ unsigned short tm_hour; /* Hours (0-23) */
|
|
|
|
+ unsigned short tm_mday; /* Day of the month (1-31) */
|
|
|
|
+ unsigned short tm_mon; /* Month (0-11) */
|
|
|
|
+ unsigned short tm_year; /* Year - 1900 */
|
|
|
|
+ unsigned int tm_msec ; /* before: wMilliseconds */
|
|
|
|
+// unsigned short tm_wday; /* Day of the week (0-6, Sunday = 0) */
|
|
|
|
+// unsigned short tm_yday; /* Day in the year (0-365, 1 Jan = 0) */
|
|
|
|
+// unsigned short tm_isdst; /* Daylight saving time */
|
|
|
|
+} CSYSTEMTIME;
|
|
|
|
+
|
|
|
|
+typedef enum {//Must consistent with the defination of 0x71 register (FPU)
|
|
|
|
+ eGNSS_Applanix , // eGpsApplanix = 0 ,
|
|
|
|
+ eGNSS_Trimble , // eGpsTrimble = 1 ,
|
|
|
|
+ eGNSS_Noval , // eGpsNoval = 2 ,
|
|
|
|
+ eGNSS_Javat , // eGpsJavat = 3 , //not consistent with 0x71
|
|
|
|
+ eGNSS_Nmea , // eGpsNmea = 4 ,
|
|
|
|
+ eGNSS_Gsof , // eGpsGsof = 5 ,
|
|
|
|
+ eGNSS_Inpps , // eGPSInpps = 6 ,
|
|
|
|
+ eGNSS_Unicore , //
|
|
|
|
+ eGNSS_Unic982 ,
|
|
|
|
+ eGNSS_Unic482 ,
|
|
|
|
+ eGNSS_SinoK823
|
|
|
|
+} GNSS_TYPE_E , GPS_TYPE_E/* obsolete */ ;
|
|
|
|
+
|
|
|
|
+typedef struct envir_cmds_ {
|
|
|
|
+ CSYSTEMTIME syncTime; //
|
|
|
|
+ int tz_secs; //secs, timezone,
|
|
|
|
+ int diff_gps_utc; //secs, the difference between GPS and UTC
|
|
|
|
+ GNSS_TYPE_E gps_etype; //obsolete ref : GPS_TYPE_E
|
|
|
|
+ unsigned int ro_ttsecs; //Epoch time(time_t), auto calc. from syncTime ; before : utcTime
|
|
|
|
+// unsigned int utcSecs ; //obsolete
|
|
|
|
+// bool pps_bool , utc_bool , gps_bool ; //obsolete
|
|
|
|
+//obsolete unsigned char imuAmSign ;
|
|
|
|
+//obsolete unsigned char imuDataState ;
|
|
|
|
+//obsolete float fGPSx , fGPSy , fGPSz ;
|
|
|
|
+} SCDCMD_ENVIR_S, SCDCMD_TIMSYN_S;
|
|
|
|
+
|
|
|
|
+typedef struct envir_rpts_ {
|
|
|
|
+ // Environments
|
|
|
|
+ float temp[2], hemi[2]; //!< unit degree and % ; //obsolete
|
|
|
|
+ //gnss ....
|
|
|
|
+ GNSS_TYPE_E gps_etype;
|
|
|
|
+ volatile unsigned int gnstmiTime; //!< 0x74 0x75 : YYMMDDHH, totally 4 Bytes ; before: gnsUtcTime or UtcTime
|
|
|
|
+ /// gnsUtcSecs是time_t类型,在32位arm上是4字节,在64位x86_64机器上是8字节,统一改成uint64_t
|
|
|
|
+ volatile /*time_t*/uint64_t gnsUtcSecs; //!< ... check FPGA to make sure it is utc format ; before: utcSec
|
|
|
|
+ // unsigned int ro_ttsecs ; //auto calc. from gnstmTime,
|
|
|
|
+ unsigned short gns_satelites; //!< obsolete , ::imu_bsignal, gns_signals
|
|
|
|
+ unsigned short imu_signals; //!< ... ? make sure the meaning ; --- IMU
|
|
|
|
+ //unsigned short ins_bsignal ; //!< bit15:12(POS) ; bit11:8(INS) ; bit7:4(IMU); bit3:0(GPS)
|
|
|
|
+ //coordinate
|
|
|
|
+ float fAtg , fdiv ; //
|
|
|
|
+ float fGPSx, fGPSy, fGPSz; //!< GPS
|
|
|
|
+ float incX, incY; //!< inclinometer X and Y
|
|
|
|
+// float heading, pitch, roll;
|
|
|
|
+//zks: which one ? float gnsLongi, gnsLati , gnsAlti; //!< GPS
|
|
|
|
+//obsolete short altitude ; //!<
|
|
|
|
+//obsolete unsigned short airspeed ; //!<
|
|
|
|
+//obsolete float compassAng; //!< compass angle
|
|
|
|
+} SCADA_STATE_S, SCDRPT_ENVIR_S; // before : SCADA_HWINFO_S ,
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ float heading, pitch, roll;
|
|
|
|
+ bool pps ;
|
|
|
|
+ float atgHeight;
|
|
|
|
+} SCDRPT_ENVIR_EXT_S;
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ LiDAR_STATMACH_E pntcld_state ;
|
|
|
|
+ unsigned int diskSize ;
|
|
|
|
+ // points statistics
|
|
|
|
+ unsigned short intens_min, intens_max; //����ķ���ǿ��(0, 2047)��
|
|
|
|
+ float ranges_min, ranges_max; // unit : m
|
|
|
|
+// float datarecv_rate, datarecv_volumn; // kbps ; KB -- updated only in thread lidarAPI->dataRecvHanle()
|
|
|
|
+ float datahandle_rate, datahandle_volumn; // kbps ; KB -- updated only in thread IdataHandle->dataHanle() ;
|
|
|
|
+ bool sdcard_flag; //SD卡是否存在:true存在,false不存在
|
|
|
|
+ //obsolete: LDRPROG_STAT_E lsrState ;
|
|
|
|
+ //obsolete: float nRangeScopeMin_; //has defination in other structure
|
|
|
|
+ //obsolete: float nRangeScopeMax_ ;
|
|
|
|
+ //obsolete: double fDataTotal_ ; //�������� KB //obsolete
|
|
|
|
+ //obsolete: unsigned int curImpSize_ ; //��ǰIMP��С KB
|
|
|
|
+ //obsolete: PRE_DATASTATE_E dataState; //����״̬
|
|
|
|
+ //obsolete: LDRUSB_STATE_E usbDiskStat; //
|
|
|
|
+ //obsolete: SL_DFRAME_E frameState;
|
|
|
|
+} SCDRPT_PNTCLD_S, LiDAR_PNTCLD_S; //// before SCADA_DATAFUN_S
|
|
|
|
+
|
|
|
|
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
+// * <1/3> Laser
|
|
|
|
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
+const int SCDLSR_POWR_DFLT = 100; //!< 100%
|
|
|
|
+const int SCDLSR_POWR_MIN = 50; //!< 50%
|
|
|
|
+const int SCDLSR_POWR_MAX = 100; //!< 100%
|
|
|
|
+const int SCDLSR_FREQ_DFLT = 200; //!< 200 kHz
|
|
|
|
+const int SCDLSR_FREQ_MIN = 30;
|
|
|
|
+const int SCDLSR_FREQ_MAX = 600; //!< 600 kHz
|
|
|
|
+
|
|
|
|
+//! laser
|
|
|
|
+typedef struct {// < 60 Bytes
|
|
|
|
+ SCDEV_CMD_E cmdID;
|
|
|
|
+ int freqKHz;
|
|
|
|
+ int ampPercent;
|
|
|
|
+ unsigned short laser_freq_enable;
|
|
|
|
+} SCDCMD_LASER_S;
|
|
|
|
+
|
|
|
|
+typedef struct {// < 60 Bytes
|
|
|
|
+ SCDEV_CMD_E statID;
|
|
|
|
+ int freqKHz;
|
|
|
|
+ int ampPercent;
|
|
|
|
+ int optingTemp;
|
|
|
|
+} SCDRPT_LASER_S;
|
|
|
|
+
|
|
|
|
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
+// * <2/3> Scanner
|
|
|
|
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
+const int SCDSCN_SPEED_DFLT = 1800;
|
|
|
|
+const int SCDSCN_SPEED_MIN = 0;
|
|
|
|
+const int SCDSCN_SPEED_MAX = 6000;
|
|
|
|
+
|
|
|
|
+typedef enum {
|
|
|
|
+ standReady = 0x0,
|
|
|
|
+ eScanStand = 0x1,
|
|
|
|
+ eScanError = 0x2,
|
|
|
|
+} SCDSCN_STATE_E;
|
|
|
|
+
|
|
|
|
+typedef struct { // must < 60 Byte
|
|
|
|
+ SCDEV_CMD_E cmdID;
|
|
|
|
+ int scan_emode; // ref: SCDSCN_MODE_E
|
|
|
|
+ float angSpeed; //!< depends on SCDSCN_MODE_E
|
|
|
|
+ unsigned short roistart[4], roistop[4];
|
|
|
|
+} SCDCMD_SCANER_S;
|
|
|
|
+
|
|
|
|
+typedef struct { // must < 60 Byte
|
|
|
|
+ SCDEV_CMD_E statID;
|
|
|
|
+ unsigned int speedCount; //
|
|
|
|
+ SCDSCN_STATE_E speedState; //
|
|
|
|
+ int grade; //int32_t
|
|
|
|
+} SCDRPT_SCANER_S;
|
|
|
|
+
|
|
|
|
+typedef enum { //!< 转台工作模式
|
|
|
|
+ eTurretReset = 0x00, //!< 重置
|
|
|
|
+ eTurretContinue = 0x01, //!< 连续模式
|
|
|
|
+ eTurretArea = 0x02, //!< 区域模式
|
|
|
|
+ eTurretPosition = 0x04, //!< 位置模式
|
|
|
|
+ eTurretNextTrige = 0x08, //!< 下一个曝光点
|
|
|
|
+ eTurretStop = 0x10, //!< 停止
|
|
|
|
+ eTurretSearch = 0x20, //!< 查询
|
|
|
|
+} SCDTURRET_MODE_E ;
|
|
|
|
+
|
|
|
|
+typedef struct turret_s_ {
|
|
|
|
+ SCDEV_CMD_E cmdID ;
|
|
|
|
+ SCDTURRET_MODE_E stag_emode ; //ref: SCDTURRET_MODE_E
|
|
|
|
+ float angSpeed ;
|
|
|
|
+ float strAngle , stpAngle; //!<
|
|
|
|
+ unsigned short roistr[4], roistp[4] ;
|
|
|
|
+} SCDCMD_TURRET_S ;
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ SCDEV_CMD_E statID ;
|
|
|
|
+ float currAng ; //!< 当前角度
|
|
|
|
+} SCDRPT_TURRET_S ;
|
|
|
|
+
|
|
|
|
+typedef enum { //!< 相机曝光模式
|
|
|
|
+ eCmrTimerNero, //!< 时间曝光, 无零位触发
|
|
|
|
+ eCmrTimerZero, //!< 时间曝光, 有零位触发
|
|
|
|
+ eCmrAngleNero, //!< 角度曝光, 无零位触发
|
|
|
|
+ eCmrAngleZero, //!< 角度曝光, 有零位触发
|
|
|
|
+ eCmrPosnNero, //!< 位置曝光, 无零位触发
|
|
|
|
+ eCmrPosnZero, //!< 位置曝光, 有零位触发
|
|
|
|
+ eCmrRangeNero, //!< 距离曝光, 无零位触发
|
|
|
|
+ eCmrRangeZero, //!< 距离曝光, 有零位触发
|
|
|
|
+} SCDCMR_MODE_E;
|
|
|
|
+
|
|
|
|
+typedef struct _cmr_cmds_ { // must < 60 bytes
|
|
|
|
+ SCDEV_CMD_E cmdID ; //!<
|
|
|
|
+ SCDCMR_MODE_E trigger_emode ; //!< ref: SCDCMR_MODE_E
|
|
|
|
+ int interval ; //!<
|
|
|
|
+ int angOffset ; //!<
|
|
|
|
+ unsigned int msgCount; //!<
|
|
|
|
+ float strAngle , stpAngle; //!<
|
|
|
|
+} SCDCMD_CAMERA_S ;
|
|
|
|
+
|
|
|
|
+#define CMR_NUMBER 6 // 1 trige + 6 flash
|
|
|
|
+typedef struct {
|
|
|
|
+ SCDEV_CMD_E statID ; //!<
|
|
|
|
+ unsigned int flashCount[CMR_NUMBER] ;
|
|
|
|
+ unsigned int trigCount ;
|
|
|
|
+} SCDRPT_CAMERA_S ;
|
|
|
|
+
|
|
|
|
+typedef struct{
|
|
|
|
+ SCDEV_CMD_E cmdID;
|
|
|
|
+ char dataDir[60];
|
|
|
|
+}SCDCMD_DATA_DIR_S;
|
|
|
|
+
|
|
|
|
+typedef struct {//lidarsvr-657
|
|
|
|
+ unsigned int freq12;//freq1[15:0] freq2[31:16]
|
|
|
|
+ unsigned int freq34;//freq3[15:0] freq4[31:16]
|
|
|
|
+ unsigned int freqRef;//base freq
|
|
|
|
+ unsigned int freqRefSPeriod;//freq start Period
|
|
|
|
+ unsigned int scanFreq;
|
|
|
|
+ unsigned int onoff;
|
|
|
|
+} SCDCMD_MTA_S;
|
|
|
|
+
|
|
|
|
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
+// * <3/3> Programming
|
|
|
|
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
+/*
|
|
|
|
+typedef struct _prog_cmds_ {
|
|
|
|
+ SCDEV_CMD_E cmdID;
|
|
|
|
+ //basic ...
|
|
|
|
+ int echo_etype; //0x04 by default ; ref: ECHO_TYPE_E
|
|
|
|
+ int laserFreqKHz; //
|
|
|
|
+ int laserFirePwr; // %
|
|
|
|
+ float scanAngleSpeed; // RPM
|
|
|
|
+ float stagAngleSpeed; // RPM, obsolete
|
|
|
|
+ //advanced ...
|
|
|
|
+ int range_from, range_to; //the ranging scope
|
|
|
|
+ int angle_start, angle_stop; //the anguar scope
|
|
|
|
+ int prog_emode; //0x0 by default ; obsolete : ref : SCDSCAN_TYPE_E ;
|
|
|
|
+} SCDCMD_PROGRM_S;
|
|
|
|
+*/
|
|
|
|
+//sdk2.0 to here
|
|
|
|
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
+// * 数据采集
|
|
|
|
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
+#define MPMODE_REVISE_RANGE (120) //!< MP模式过滤杂点数据 单位m
|
|
|
|
+typedef enum {
|
|
|
|
+ eProgrmModeNon = 0,
|
|
|
|
+ eProgrmModeMP = 1,
|
|
|
|
+}SCDMODE_PROGRAM_E;
|
|
|
|
+
|
|
|
|
+#define ROI_NUMBER (2)
|
|
|
|
+
|
|
|
|
+typedef enum {
|
|
|
|
+ eNetFlow = 0x01,
|
|
|
|
+ eDeviceSave = 0x02,
|
|
|
|
+ ePCSave = 0x04, //?
|
|
|
|
+ eUSBSave = 0x08,
|
|
|
|
+ eMemorySave = 0x10,
|
|
|
|
+}SCDMODE_DATAPLACE_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef enum {
|
|
|
|
+ eFileStay, // no action to file handler
|
|
|
|
+ eFileNew,
|
|
|
|
+ eFileRenew,
|
|
|
|
+ eFileClose,
|
|
|
|
+ eFileCloseAll,
|
|
|
|
+ eFileImpClose,
|
|
|
|
+ eFileIssClose,
|
|
|
|
+} LiDARImp_Action_E;
|
|
|
|
+
|
|
|
|
+/************************************************************************************
|
|
|
|
+ *
|
|
|
|
+ *************************************************************************************/
|
|
|
|
+typedef enum {
|
|
|
|
+ ePoints_NULL ,
|
|
|
|
+ ePoints_NetFlow , //eNetFlow = 0x01,
|
|
|
|
+ ePoints_DevSave , //eDeviceSave = 0x02 ,
|
|
|
|
+ ePoints_PcSave , //ePCSave = 0x04 ,
|
|
|
|
+ ePoints_UsbSave , //eUSBSave = 0x08,
|
|
|
|
+ ePoints_MemSave , //eMemorySave = 0x10,
|
|
|
|
+} SCDMODE_DATAPLACE_E , Point_DataFlow_E;
|
|
|
|
+
|
|
|
|
+typedef enum {
|
|
|
|
+ eDataNULL ,
|
|
|
|
+ eIMPDATA , //= 0x1 ,
|
|
|
|
+ eXYZIDATA , //= 0x2 ,
|
|
|
|
+ eARIDATA , //= 0x4 ,
|
|
|
|
+ eCRSDATA , //= 0x8 ,
|
|
|
|
+ eWUDDATA , //= 0x10,
|
|
|
|
+ eNARIDATA , //= 0x12,
|
|
|
|
+ eGEOXYZDAT , //= 0x14,
|
|
|
|
+ eCPTDATA , //= 0x16,
|
|
|
|
+ eSTDATA , //= 0x18,
|
|
|
|
+ ePLRDATA , //= 0x20,
|
|
|
|
+ eISSDATA , //= 0x21,
|
|
|
|
+ ePMISSDATA , //= 0x22,
|
|
|
|
+} DATA_TYPE_E , Point_DataType_E ;
|
|
|
|
+
|
|
|
|
+//
|
|
|
|
+typedef struct {
|
|
|
|
+ // data collecting Setups
|
|
|
|
+ LDRDEV_CMD_S cmdID ;
|
|
|
|
+ Point_DataFlow_E data_flow ; // storePlace ;
|
|
|
|
+ Point_DataType_E data_type ; // saving format
|
|
|
|
+} SCDCMD_DCTRL_S , SCDCMD_DATACTRL_S ;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct _prog_cmds_ {
|
|
|
|
+ SCDEV_CMD_E cmdID;
|
|
|
|
+ //basic ...
|
|
|
|
+ int echo_etype; //0x04 by default ; ref: ECHO_TYPE_E
|
|
|
|
+ int laserFreqKHz; //
|
|
|
|
+ int laserFirePwr; // %
|
|
|
|
+ float scanAngleSpeed; // RPM
|
|
|
|
+ float stagAngleSpeed; // RPM, obsolete
|
|
|
|
+ //advanced ...
|
|
|
|
+ int range_from, range_to; //the ranging scope
|
|
|
|
+ int angle_start, angle_stop; //the anguar scope
|
|
|
|
+ int prog_emode; //0x0 by default ; obsolete : ref : SCDSCAN_TYPE_E ;
|
|
|
|
+} SCDCMD_PROGRM_S;
|
|
|
|
+
|
|
|
|
+typedef struct{
|
|
|
|
+ float sHoriAngle;// 0到360
|
|
|
|
+ float sVertAngle;// -25到15
|
|
|
|
+ float ptzTurnSpd;// 0.1到0.5度每秒, 0为不转
|
|
|
|
+ unsigned char scanDataFrame; //frame number
|
|
|
|
+ unsigned char state;
|
|
|
|
+ unsigned short recvTmOutMs;//超时时间ms,0表示不设置
|
|
|
|
+ SCDCMD_PROGRM_S prog;
|
|
|
|
+ unsigned char ptzPosDelayTime;//转到指定位置后延时扫描时间,单位s
|
|
|
|
+} SCDCMD_MOV_PROGRM_S;//后面考虑移出
|
|
|
|
+
|
|
|
|
+typedef struct{
|
|
|
|
+ int state;//1表示运行中,0表示空闲
|
|
|
|
+} SCDCMD_GET_PROSTATE_S;
|
|
|
|
+
|
|
|
|
+typedef struct{
|
|
|
|
+ int onoff;//1打开0关闭
|
|
|
|
+ unsigned char vol;//level 1-30
|
|
|
|
+} SCDCMD_CTRL_ALARM_S;
|
|
|
|
+
|
|
|
|
+typedef struct{
|
|
|
|
+ unsigned int power;
|
|
|
|
+ float voltage;
|
|
|
|
+ float current;
|
|
|
|
+} SCDCMD_GET_BATINFO_S;
|
|
|
|
+
|
|
|
|
+typedef struct{
|
|
|
|
+ unsigned char ctrl;//1 reset, 2 move to pos, 3 get pos
|
|
|
|
+ float HoriAngle;
|
|
|
|
+ float VertAngle;
|
|
|
|
+} SCDCMD_CTL_PTZ_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ int request; //
|
|
|
|
+} SCDCMD_APPDeviceMeta_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ float tempDc ; //温度,单位°
|
|
|
|
+ float batPer; //电池电量百分比
|
|
|
|
+ float tfCapPer; //容量百分比 如:60.1,表示容量已用60.1%
|
|
|
|
+ int deviceID ; //序列号
|
|
|
|
+ char softVer[16];//固件版本
|
|
|
|
+ char hwVer[8]; //硬件版本
|
|
|
|
+ char proctorData[8];//生产日期,如:20220801
|
|
|
|
+} SCDRPT_APPDeviceMeta_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ int request; //
|
|
|
|
+} SCDCMD_APPCountPro_S;
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ unsigned short count; //如5个工程
|
|
|
|
+} SCDRPT_APPCountPro_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ unsigned short num; // 如:0-4
|
|
|
|
+} SCDCMD_APPGetPro_S;
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ char progId[13]; //220810181012
|
|
|
|
+ char proName[22]; //工程名称
|
|
|
|
+} SCDRPT_APPGetPro_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ char progId[13]; //工程id
|
|
|
|
+} SCDCMD_APPGetProg_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ char progStartTime[16]; //开始时间: 20220803181000
|
|
|
|
+ unsigned int proRunTime; // 作业时长,单位秒
|
|
|
|
+ unsigned short proRoom; //工程作业所占空间大小,单位MB
|
|
|
|
+ char pos[40];
|
|
|
|
+} SCDRPT_APPGetProg_S;
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ char progId[13]; //工程id
|
|
|
|
+} SCDCMD_APPGetCommPro_S;
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ char proComment[53]; //工程备注
|
|
|
|
+} SCDRPT_APPGetCommPro_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ char progId[13]; //工程id
|
|
|
|
+ char newProName[22]; //新工程名称
|
|
|
|
+} SCDCMD_APPUpdatePro_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ int updateResult; //0 表示成功,其他值失败
|
|
|
|
+} SCDRPT_APPUpdatePro_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ char progId[13]; //工程id
|
|
|
|
+} SCDCMD_APPDeletePro_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ int deleteResult; //0 表示成功,其他值失败
|
|
|
|
+} SCDRPT_APPDeletePro_S;
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ char progId[13]; //工程id
|
|
|
|
+ char proComment[53];
|
|
|
|
+} SCDCMD_APPAddCommPro_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ int addResult; //0 表示成功,其他值失败
|
|
|
|
+} SCDRPT_APPAddCommPro_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ char proName[22]; //工程名称
|
|
|
|
+ char pos[40];//位置信息
|
|
|
|
+} SCDCMD_APPCreatePro_S;
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ int newResult;
|
|
|
|
+} SCDRPT_APPCreatePro_S;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ SCDEV_CMD_E cmdID;
|
|
|
|
+ int startResult; //0 表示成功,其他值失败
|
|
|
|
+} SCDRPT_PROGRAMStart_S;
|
|
|
|
+
|
|
|
|
+typedef struct {
|
|
|
|
+ SCDEV_CMD_E cmdID;
|
|
|
|
+ int stopresult; //0 表示成功,其他值失败
|
|
|
|
+ char progId[13]; //当前工程id
|
|
|
|
+} SCDRPT_PROGRAMStop_S;
|
|
|
|
+
|
|
|
|
+typedef struct{
|
|
|
|
+ unsigned char flag;//0 表示读,1表示写
|
|
|
|
+ unsigned int reg;
|
|
|
|
+ unsigned int value;
|
|
|
|
+}SCDCMD_REGISTER_S;
|
|
|
|
+
|
|
|
|
+//批量读请求
|
|
|
|
+typedef struct{
|
|
|
|
+ //批量地址数组,最大可读取16组地址数据,当只需查询3组地址数据时,后13组数据用0填充
|
|
|
|
+ unsigned int request[16];
|
|
|
|
+}SCDCMD_BATCH_READ_S;
|
|
|
|
+
|
|
|
|
+//批量读反馈
|
|
|
|
+typedef struct{
|
|
|
|
+ //批量地址数组对应的value
|
|
|
|
+ unsigned int response[16];
|
|
|
|
+}SCDRPT_BATCH_READ_S;
|
|
|
|
+
|
|
|
|
+//批量写请求
|
|
|
|
+typedef struct{
|
|
|
|
+ //批量地址、数值数组,地址、数值交替出现,最多可写8组数据,当只需写3组数据时,后5组数据用0填充
|
|
|
|
+ unsigned int request[16];
|
|
|
|
+}SCDCMD_BATCH_WRITE_S;
|
|
|
|
+
|
|
|
|
+//批量写反馈
|
|
|
|
+typedef struct{
|
|
|
|
+ //批量地址、数值数组,地址、数值交替出现
|
|
|
|
+ unsigned int response[16];
|
|
|
|
+}SCDRPT_BATCH_WRITE_S;
|
|
|
|
+
|
|
|
|
+/// 发现设备命令内容结构
|
|
|
|
+typedef struct SCDCMD_FINDDEV_S
|
|
|
|
+{
|
|
|
|
+ unsigned char request[64]; ///< 这里的body只是为了占位里面的命令内容将会被忽略
|
|
|
|
+}SCDCMD_FINDDEV_S;
|
|
|
|
+
|
|
|
|
+/// 发现设备命令回应结构
|
|
|
|
+typedef struct SCDRPT_FINDDEV_S
|
|
|
|
+{
|
|
|
|
+ uint8_t arrui8Vender[16]; ///< 设备厂商名称
|
|
|
|
+ uint8_t arrui8devName[16]; ///< 设备名称
|
|
|
|
+ uint32_t ui32devVersion; ///< 设备程序版本
|
|
|
|
+ uint32_t ui32devStatus; ///< 设备状态
|
|
|
|
+ uint32_t ui32devMAC[2]; ///< 设备MAC
|
|
|
|
+ uint32_t ui32devIPMode; ///< 设备当前IP配置模式
|
|
|
|
+ uint32_t ui32devIP; ///< 设备当前IP
|
|
|
|
+ uint32_t ui32devMask; ///< 设备当前子网掩码
|
|
|
|
+ uint32_t ui32devGateway; ///< 设备当前网关
|
|
|
|
+}SCDRPT_FINDDEV_S;
|
|
|
|
+
|
|
|
|
+/// IP模式配置设置命令
|
|
|
|
+typedef struct SCDCMD_IPCFG_S
|
|
|
|
+{
|
|
|
|
+ uint32_t ui32mode; ///< IP配置模式
|
|
|
|
+ uint32_t ui32IP; ///< 当前配置的IP
|
|
|
|
+ uint32_t ui32mask; ///< 当前要配置的子网掩码
|
|
|
|
+ uint32_t ui32gateway;///< 当前要配置的网关
|
|
|
|
+ uint32_t ui32MAC[2]; ///< MAC地址,根据这个去选择是否接受配置
|
|
|
|
+}SCDCMD_IPCFG_S;
|
|
|
|
+/// IP模式配置命令返回
|
|
|
|
+typedef struct SCDRPT_IPCFG_S
|
|
|
|
+{
|
|
|
|
+ uint32_t ui32status; ///< 返回状态可能的定义见LiDARIPCfg.cpp中ipcfg函数返回值
|
|
|
|
+}SCDRPT_IPCFG_S;
|
|
|
|
+
|
|
|
|
+/// 心跳包命令
|
|
|
|
+typedef struct SCDCMD_HEARTBEAT_S
|
|
|
|
+{
|
|
|
|
+ uint32_t devstatus; ///< 写的话要写的状态值。0 - 空闲 1 - 只读 2 - 控制
|
|
|
|
+ uint8_t request[60];
|
|
|
|
+}SCDCMD_HEARTBEAT_S ;
|
|
|
|
+/// 心跳包命令返回
|
|
|
|
+typedef struct SCDRPT_HEARTBEAT_S
|
|
|
|
+{
|
|
|
|
+ uint32_t cmdstatus; ///< 读的话返回设备状态,写的话返回写入后的状态
|
|
|
|
+ uint8_t response[60]; ///< 命令占位
|
|
|
|
+}SCDRPT_HEARTBEAT_S;
|
|
|
|
+
|
|
|
|
+/// DAC的设备类型
|
|
|
|
+typedef enum DAC_DEV_TYPE
|
|
|
|
+{
|
|
|
|
+ DAC101 = 0,
|
|
|
|
+ DAC104 = 1,
|
|
|
|
+}DAC_DEV_TYPE;
|
|
|
|
+/// DAC设备通道表示,目前最多4通道
|
|
|
|
+typedef enum DAC_DEV_CHANNEL
|
|
|
|
+{
|
|
|
|
+ CHANNEL_0 = 0,
|
|
|
|
+ CHANNEL_1 = 1,
|
|
|
|
+ CHANNEL_2 = 2,
|
|
|
|
+ CHANNEL_3 = 3,
|
|
|
|
+ CHANNEL_ALL = 4,
|
|
|
|
+}DAC_DEV_CHANNEL;
|
|
|
|
+/// DAC电压输出设置
|
|
|
|
+typedef struct SCDCMD_DAC_S
|
|
|
|
+{
|
|
|
|
+ DAC_DEV_TYPE dactype;
|
|
|
|
+ DAC_DEV_CHANNEL dacchannel;
|
|
|
|
+ float Voltage;
|
|
|
|
+}SCDCMD_DAC_S;
|
|
|
|
+/// DAC电压设置反馈
|
|
|
|
+typedef struct SCDRPT_DAC_S
|
|
|
|
+{
|
|
|
|
+ uint32_t status; ///< 设置状态
|
|
|
|
+}SCDRPT_DAC_S;
|
|
|
|
+/// 温度芯片的设备类型
|
|
|
|
+typedef enum TMP_DEV_TYPE
|
|
|
|
+{
|
|
|
|
+ TMP422 = 0,
|
|
|
|
+}TMP_DEV_TYPE;
|
|
|
|
+/// 温度芯片设备通道表示,目前最多5通道
|
|
|
|
+typedef enum TMP_DEV_CHANNEL
|
|
|
|
+{
|
|
|
|
+ TMP_LOCAL = 0,
|
|
|
|
+ TMP_REMOTE_1 = 1,
|
|
|
|
+ TMP_REMOTE_2 = 2,
|
|
|
|
+ TMP_REMOTE_3 = 3,
|
|
|
|
+ TMP_REMOTE_4 = 4,
|
|
|
|
+}TMP_DEV_CHANNEL;
|
|
|
|
+/// 温度读取请求
|
|
|
|
+typedef struct SCDCMD_TMP_S
|
|
|
|
+{
|
|
|
|
+ TMP_DEV_TYPE tmptype;
|
|
|
|
+ TMP_DEV_CHANNEL tmpchannel;
|
|
|
|
+}SCDCMD_TMP_S;
|
|
|
|
+/// 温度读取反馈
|
|
|
|
+typedef struct SCDRPT_TMP_S
|
|
|
|
+{
|
|
|
|
+ TMP_DEV_TYPE tmptype;
|
|
|
|
+ TMP_DEV_CHANNEL tmpchannel;
|
|
|
|
+ uint32_t status; ///< 返回读取状态
|
|
|
|
+ float tmp_value; ///< 返回读取到的值
|
|
|
|
+}SCDRPT_TMP_S;
|
|
|
|
+
|
|
|
|
+/// ADC转换的设备类型
|
|
|
|
+typedef enum ADC_DEV_TYPE
|
|
|
|
+{
|
|
|
|
+ XADC = 0,
|
|
|
|
+}ADC_DEV_TYPE;
|
|
|
|
+/// ADC读取请求
|
|
|
|
+typedef struct SCDCMD_ADC_S
|
|
|
|
+{
|
|
|
|
+ ADC_DEV_TYPE adctype;
|
|
|
|
+ uint32_t adcchannel;
|
|
|
|
+}SCDCMD_ADC_S;
|
|
|
|
+/// ADC读取反馈
|
|
|
|
+typedef struct SCDRPT_ADC_S
|
|
|
|
+{
|
|
|
|
+ ADC_DEV_TYPE adctype;
|
|
|
|
+ uint32_t adcchannel;
|
|
|
|
+ uint32_t status; ///< 返回读取状态
|
|
|
|
+ float adc_value; ///< 返回读取到的值
|
|
|
|
+}SCDRPT_ADC_S;
|
|
|
|
+
|
|
|
|
+/// 配置文件控制请求
|
|
|
|
+typedef struct SCDCMD_CFGCTRL
|
|
|
|
+{
|
|
|
|
+ uint32_t flag; ///< 0为读,1为写
|
|
|
|
+ uint32_t total_lens; ///< 如果标志位读,则是已读取到的数量,如果是写,则是要写入的总数
|
|
|
|
+ uint32_t data_offset; ///< 如果为读,此位无效,如果位写,此为是正在写入数据在整个数据中的偏移
|
|
|
|
+ uint8_t data_buf[1016]; ///< 文件数据
|
|
|
|
+}SCDCMD_CFGCTRL_S;
|
|
|
|
+/// 配置文件控制反馈
|
|
|
|
+typedef struct SCDRPT_CFGCTRL
|
|
|
|
+{
|
|
|
|
+ uint32_t total_lens; ///< 如果为读命令的回应,要读取文件的整体大小,如果是写命令的应答,则是写入了多少文件
|
|
|
|
+ uint32_t data_offset; ///< 如果为读命令的回应,就是当前包在整体的偏移位置,如果写写命令的应答,此位无效
|
|
|
|
+ uint8_t data_buf[1020]; ///< 文件数据
|
|
|
|
+}SCDRPT_CFGCTRL_S;
|
|
|
|
+/***********************************************************************
|
|
|
|
+ ***********************************************************************
|
|
|
|
+ **** Communication Interface
|
|
|
|
+ ***********************************************************************
|
|
|
|
+ ***********************************************************************/
|
|
|
|
+typedef struct cmd_lidar_L1 {
|
|
|
|
+ LiDAR_MSGID_E cmdId ; //!<
|
|
|
|
+ int isAsk ;
|
|
|
|
+ union {
|
|
|
|
+ SCDCMD_ENVIR_S envCtrl; //! SCDCMD_TIMSYN_S synData ;
|
|
|
|
+ SCDRPT_ENVIR_S envRprt;
|
|
|
|
+ SCDRPT_ENVIR_EXT_S envExtRprt;
|
|
|
|
+ SCDRPT_PNTCLD_S pntRprt; //! real time data collection, before : infoData
|
|
|
|
+ SCDCMD_LASER_S lsrCtrl; //!
|
|
|
|
+ SCDRPT_LASER_S lsrRprt;
|
|
|
|
+ SCDCMD_SCANER_S scnCtrl; //!
|
|
|
|
+ SCDRPT_SCANER_S scnRprt;
|
|
|
|
+ SCDCMD_PROGRM_S prgCtrl; //!
|
|
|
|
+ SCDCMD_REGISTER_S regCtrl; //!
|
|
|
|
+ SCDCMD_DATACTRL_S dataCtrl;
|
|
|
|
+ // USBCMR_CTRL_S umrData ; //!
|
|
|
|
+ // USBCMR_TRIG_S umrTrig ; //!
|
|
|
|
+ SCDCMD_TURRET_S stgData ;
|
|
|
|
+ SCDRPT_TURRET_S stgRprt;
|
|
|
|
+ // SCDCMD_STEPMOTOR_S stepMtoData ; //!
|
|
|
|
+ // SCADA_FPGA_STATE fpgaData ; //! FPGA状态 --merged with regCtrl ;
|
|
|
|
+ // SCADA_DATAFUN_S storageData ; //!
|
|
|
|
+ // SCDCMD_DMI_S dmiData ; //!
|
|
|
|
+ SCDCMD_CAMERA_S pmCmrData ; //!
|
|
|
|
+ SCDRPT_CAMERA_S cmrRprt;
|
|
|
|
+ // SCDCMD_PALM_S pmDate ; //!
|
|
|
|
+ // SCDCMD_PALMSTG_S pmStgData ; //!
|
|
|
|
+ // SCDCFG_LIMIT_S limitData ;
|
|
|
|
+ SCDCMD_MTA_S mtaData;
|
|
|
|
+ SCDCMD_APPDeviceMeta_S appDevMeatCtrl;
|
|
|
|
+ SCDRPT_APPDeviceMeta_S appDevMeatRprt;
|
|
|
|
+ SCDCMD_APPCountPro_S appCountCtrl;
|
|
|
|
+ SCDRPT_APPCountPro_S appCountRprt;
|
|
|
|
+ SCDCMD_APPGetPro_S appGetProCtrl;
|
|
|
|
+ SCDRPT_APPGetPro_S appGetProRprt;
|
|
|
|
+ SCDCMD_APPGetProg_S appGetProgCtrl;
|
|
|
|
+ SCDRPT_APPGetProg_S appGetProgRprt;
|
|
|
|
+ SCDCMD_APPGetCommPro_S appGetCommProCtrl;
|
|
|
|
+ SCDRPT_APPGetCommPro_S appGetCommProRprt;
|
|
|
|
+ SCDCMD_APPUpdatePro_S appUpdateProCtrl;
|
|
|
|
+ SCDRPT_APPUpdatePro_S appUpdateProRprt;
|
|
|
|
+ SCDCMD_APPDeletePro_S appDeleteProCtrl;
|
|
|
|
+ SCDRPT_APPDeletePro_S appDeleteProRprt;
|
|
|
|
+ //SCDCMD_APPAddCommPro_S appAddCommProCtrl;
|
|
|
|
+ SCDRPT_APPAddCommPro_S appAddCommProRprt;
|
|
|
|
+ SCDCMD_APPCreatePro_S appCreateProCtrl;
|
|
|
|
+ SCDRPT_APPCreatePro_S appCreateProRprt;
|
|
|
|
+ SCDRPT_PROGRAMStart_S appProgramStartRprt;
|
|
|
|
+ SCDRPT_PROGRAMStop_S appProgramStopRprt;
|
|
|
|
+
|
|
|
|
+ SCDCMD_BATCH_READ_S batchReadCtrl;
|
|
|
|
+ SCDRPT_BATCH_READ_S batchReadRprt;
|
|
|
|
+ SCDCMD_BATCH_WRITE_S batchWriteCtrl;
|
|
|
|
+ SCDRPT_BATCH_WRITE_S batchWriteRprt;
|
|
|
|
+
|
|
|
|
+ SCDCMD_DATA_DIR_S dataDir;
|
|
|
|
+
|
|
|
|
+ SCDCMD_MOV_PROGRM_S movPrgCtrl;
|
|
|
|
+ SCDCMD_GET_PROSTATE_S getPrgState;
|
|
|
|
+ SCDCMD_CTRL_ALARM_S ctrlAlarm;
|
|
|
|
+ SCDCMD_GET_BATINFO_S getBatInfo;
|
|
|
|
+ SCDCMD_CTL_PTZ_S ctrlPtz;
|
|
|
|
+
|
|
|
|
+ SCDCMD_DAC_S setdacinfo;
|
|
|
|
+ SCDRPT_DAC_S setdacrprt;
|
|
|
|
+ SCDCMD_TMP_S gettempinfo;
|
|
|
|
+ SCDRPT_TMP_S gettemprprt;
|
|
|
|
+ SCDCMD_ADC_S getadcinfo;
|
|
|
|
+ SCDRPT_ADC_S getadcrprt;
|
|
|
|
+
|
|
|
|
+ char msgstream[64];
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ cmd_lidar_L1() {
|
|
|
|
+ cmdId = eLidarReset ; // eMsgSoftCk ;
|
|
|
|
+ isAsk = false ;
|
|
|
|
+ }
|
|
|
|
+} LIDAR_CMDRPT_U ;
|
|
|
|
+
|
|
|
|
+const char LIDAR_COMMAND_MARK[8] = "A7C7A5C";
|
|
|
|
+typedef struct comu_lidar_L1 {
|
|
|
|
+ const char command_mark[8] = "A7C7A5C";
|
|
|
|
+ LIDAR_CMDRPT_U commander;
|
|
|
|
+ unsigned int check_sum;
|
|
|
|
+} LIDAR_COMMAND_S ; //before: SCADA_CMDRPTS_S
|
|
|
|
+
|
|
|
|
+/// 后续再添加的内容必须使用后边定义的结构体,因为协议已经定义变长,但是实际上旧的结构仍不支持
|
|
|
|
+typedef struct LIDAR_CMDRPT_U1 {
|
|
|
|
+ union BODY{
|
|
|
|
+ /// 发现设备命令与返回
|
|
|
|
+ SCDCMD_FINDDEV_S findDevicereq;
|
|
|
|
+ SCDRPT_FINDDEV_S findDeviceresp;
|
|
|
|
+ /// IP模式配置设备命令与返回
|
|
|
|
+ SCDCMD_IPCFG_S IPCfgreq;
|
|
|
|
+ SCDRPT_IPCFG_S IPCfgresp;
|
|
|
|
+ /// 心跳包命令与返回
|
|
|
|
+ SCDCMD_HEARTBEAT_S heartBeatreq;
|
|
|
|
+ SCDRPT_HEARTBEAT_S heartBeatresp;
|
|
|
|
+ /// 配置文件控制命令
|
|
|
|
+ SCDCMD_CFGCTRL_S cfgctrlreq;
|
|
|
|
+ SCDRPT_CFGCTRL_S cfgctrlresp;
|
|
|
|
+
|
|
|
|
+ char msgstream[LIDAR_BODY_MAX];
|
|
|
|
+ }unibody;
|
|
|
|
+} LIDAR_CMDRPT_U1 ;
|
|
|
|
+/// OpenLiDAR协议命令头
|
|
|
|
+typedef struct OPEN_LIDAR_HEAD
|
|
|
|
+{
|
|
|
|
+ char strsyncword[8]; ///< 同步字,固定为"A7C7A5C"
|
|
|
|
+ uint16_t ui16cmdid; ///< 命令id,具体可接受定义见枚举类型LiDAR_MSGID_E定义
|
|
|
|
+ uint16_t ui16lens; ///< body段的实际长度,可以设置为0,如果设置为0的话则body段为64字节
|
|
|
|
+ uint32_t reqid; ///< reqid命令包的请求ID,回复包的回复ID也使用此位并且回复包需要和命令包一致
|
|
|
|
+}OPEN_LIDAR_HEAD;
|
|
|
|
+/// OpenLiDAR协议命令尾
|
|
|
|
+typedef struct OPEN_LIDAR_TAIL
|
|
|
|
+{
|
|
|
|
+ uint32_t check_sum; ///< 协议包除去同步字后整体的crc32校验值
|
|
|
|
+}OPEN_LIDAR_TAIL;
|
|
|
|
+
|
|
|
|
+/// 新的OpenLiDAR协议结构
|
|
|
|
+typedef struct LIDAR_COMMAND_S_1
|
|
|
|
+{
|
|
|
|
+ OPEN_LIDAR_HEAD sthead; ///< 协议命令头
|
|
|
|
+ LIDAR_CMDRPT_U1 commander; ///< 请求包或应答包的具体数据
|
|
|
|
+ OPEN_LIDAR_TAIL sttril; ///< 尾包,crc校验值
|
|
|
|
+} LIDAR_COMMAND_S_1;
|
|
|
|
+
|
|
|
|
+#pragma pack()
|
|
|
|
+#endif
|