Quellcode durchsuchen

change tool_config_lidar_leishen.

yuchuli vor 1 Jahr
Ursprung
Commit
21b709bc40

+ 1 - 0
src/common/ndt_gpu/ndt_gpu.pro

@@ -20,6 +20,7 @@ QMAKE_CXXFLAGS += -std=gnu++17
 
 SOURCES +=  \
 
+#INCLUDEPATH += /usr/local/cuda-10.2/targets/aarch64-linux/include/crt
 #INCLUDEPATH += /home/nvidia/eigentem
 unix:INCLUDEPATH += /usr/include/eigen3
 unix:INCLUDEPATH += /usr/include/pcl-1.8

+ 2 - 2
src/fusion/fusion_gpsndt/main.cpp

@@ -433,10 +433,10 @@ int main(int argc, char *argv[])
     gfault->SetFaultState(0,0,"Initialize.");
 
     gstrfusionmsg = xparam.GetParam("fusionmsg","fusion_gpslidar");
-    gstrgpsmsg = xparam.GetParam("gpsmsg","ins550d_gpsimu");
+    gstrgpsmsg = xparam.GetParam("gpsmsg","hcp1_gpsimu");
     gstrndtmsg = xparam.GetParam("ndtgpsposmsg","ndtgpspos");
     gstrlidaronly = xparam.GetParam("LidarOnly","false");
-    gstrfusiongpsimumsg = xparam.GetParam("fusiongpsimumsg","fusion_gpsimu");
+    gstrfusiongpsimumsg = xparam.GetParam("fusiongpsimumsg","hcp2_gpsimu");
     gstrshareudp = xparam.GetParam("shareudp","true");
     gstrsharegpsimu = xparam.GetParam("sharegpsimu","true");
 

+ 29 - 7
src/tool/tool_config_lidar_leishen/mainwindow.cpp

@@ -178,12 +178,12 @@ void MainWindow::on_pushButton_Param_Get_clicked()
         ui->lineEdit_Param_IPSrc->setText(strsrcip);
         char strdstip[256];
         snprintf(strdstip,256,"%d.%d.%d.%d",ethparam[4],ethparam[5],ethparam[6],ethparam[7]);
-        ui->lineEdit_Param_IPSrc->setText(strdstip);
+        ui->lineEdit_Param_IPDest->setText(strdstip);
         int nDataPort = ethparam[14]*256 + ethparam[15];
-        ui->lineEdit_DataPort->setText(QString::number(nDataPort));
+        ui->lineEdit_Param_DataPort->setText(QString::number(nDataPort));
         int nDevPort = ethparam[16]*256 + ethparam[17];
-        mnDevPort = nDevPort;
-        ui->lineEdit_DevPort->setText(QString::number(nDevPort));
+//        mnDevPort = nDevPort;
+        ui->lineEdit_Param_DevPort->setText(QString::number(nDevPort));
         mbParam_Get = true;
         ui->pushButton_Param_Set->setEnabled(true);
     }
@@ -278,7 +278,25 @@ void MainWindow::on_pushButton_Param_Set_clicked()
     memcpy(pdata + 10 + 14,strDataPort,2);
     memcpy(pdata + 10 + 16,strDevPort,2);
 
-//    mpUDPSocket_Dev->writeDatagram(basend.data(),basend.size(),QHostAddress(mstrDevIP),mnDevPort);
+    int motorhz = 10;
+    if(ui->comboBox_MotorSpeed->currentIndex() == 0)motorhz = 5;
+    if(ui->comboBox_MotorSpeed->currentIndex() == 2)motorhz = 20;
+
+    motorhz = motorhz * 60;
+    unsigned short nMotorhz_High = motorhz/256;
+    unsigned short nMotorhz_Low = motorhz - nMotorhz_High*256;
+    unsigned char strmotor[2];
+    strmotor[0] = static_cast<unsigned char>(nMotorhz_High);
+    strmotor[1] = static_cast<unsigned char>(nMotorhz_Low);
+    memcpy(pdata+8,strmotor,2);
+
+    pdata[0] = 0xAA; pdata[1] = 0x00; pdata[2] = 0xFF; pdata[3] = 0x11;
+    pdata[4] = 0x22; pdata[5] = 0x22; pdata[6] = 0xAA; pdata[7] = 0xAA;
+
+
+
+    mpUDPSocket_Dev->writeDatagram(basend.data(),basend.size(),QHostAddress(mstrDevIP),mnDevPort);
+    mpUDPSocket_Dev->flush();
     QMessageBox::information(this,tr("Info"),tr("设置成功"),QMessageBox::YesAll);
 }
 
@@ -309,6 +327,8 @@ void MainWindow::onSocketDevRead()
             xUDPPac.mba = datagram.data();
             xUDPPac.mhost = datagram.senderAddress();
             xUDPPac.mnPort = static_cast<unsigned short>(datagram.senderPort()) ;
+            std::cout<<" dev send port : "<<xUDPPac.mnPort<<std::endl;
+            mnDevPort = xUDPPac.mnPort;
             if(mvectorUDPPac_Dev.size()>=10)
             {
                 mvectorUDPPac_Dev.erase(mvectorUDPPac_Dev.begin());
@@ -335,6 +355,7 @@ void MainWindow::onSocketDataRead()
             xUDPPac.mba = datagram.data();
             xUDPPac.mhost = datagram.senderAddress();
             xUDPPac.mnPort = static_cast<unsigned short>(datagram.senderPort()) ;
+
             if(mvectorUDPPac_Data.size()>=100)
             {
                 mvectorUDPPac_Data.erase(mvectorUDPPac_Data.begin());
@@ -351,7 +372,8 @@ void MainWindow::onTimer()
     if(mbListenning)
     {
         char strout[1000];
-        snprintf(strout,1000,"Data Packet:%d     Device Packete:%d",mnDataPacCount,mnDevPacCount);
+        snprintf(strout,1000,"%s | Last Second Recv | Data Packet:%d     Device Packet:%d",QDateTime::currentDateTime().toString("hh:mm::ss:zzz").toLatin1().data(),
+                 mnDataPacCount,mnDevPacCount);
         ui->plainTextEdit->setPlainText(strout);
 
     }
@@ -370,7 +392,7 @@ bool MainWindow::CheckMacSame()
     if(nsize<=1)return  true;
     for(i=1;i<nsize;i++)
     {
-        QByteArray ba = mvectorUDPPac_Dev[i].mba.data();
+        QByteArray ba = mvectorUDPPac_Dev[i].mba;
         char * pdata = ba.data();
         if(ba.size() != 1206)
         {

+ 1 - 0
src/tool/tool_config_lidar_leishen/mainwindow.h

@@ -7,6 +7,7 @@
 #include <QNetworkDatagram>
 #include <QHostAddress>
 #include <QTimer>
+#include <QDateTime>
 
 #include <memory>
 #include <vector>

BIN
src/tool/tool_xodrobj/dest.png


+ 32 - 10
src/tool/tool_xodrobj/mainwindow.ui

@@ -1,7 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0">
  <class>MainWindow</class>
- <widget class="QMainWindow" name="MainWindow" >
-  <property name="geometry" >
+ <widget class="QMainWindow" name="MainWindow">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
@@ -9,16 +10,37 @@
     <height>300</height>
    </rect>
   </property>
-  <property name="windowTitle" >
+  <property name="windowTitle">
    <string>MainWindow</string>
   </property>
-  <widget class="QMenuBar" name="menuBar" />
-  <widget class="QToolBar" name="mainToolBar" />
-  <widget class="QWidget" name="centralWidget" />
-  <widget class="QStatusBar" name="statusBar" />
+  <property name="windowIcon">
+   <iconset resource="xodrobj.qrc">
+    <normaloff>:/dest.png</normaloff>:/dest.png</iconset>
+  </property>
+  <widget class="QWidget" name="centralWidget"/>
+  <widget class="QMenuBar" name="menuBar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>400</width>
+     <height>22</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QToolBar" name="mainToolBar">
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+  </widget>
+  <widget class="QStatusBar" name="statusBar"/>
  </widget>
- <layoutDefault spacing="6" margin="11" />
- <pixmapfunction></pixmapfunction>
- <resources/>
+ <layoutdefault spacing="6" margin="11"/>
+ <resources>
+  <include location="xodrobj.qrc"/>
+ </resources>
  <connections/>
 </ui>

+ 3 - 0
src/tool/tool_xodrobj/tool_xodrobj.pro

@@ -80,3 +80,6 @@ LIBS += -livprotoif
 if(contains(DEFINES,USE_UTM)){
 LIBS += -lGeographic
 }
+
+RESOURCES += \
+    xodrobj.qrc

+ 5 - 0
src/tool/tool_xodrobj/xodrobj.qrc

@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/">
+        <file>dest.png</file>
+    </qresource>
+</RCC>