Browse Source

add eps angle decode for detection chassis module and add send enable signal for chassis_test

yuchuli 1 year ago
parent
commit
8723c0c1ff

+ 2 - 1
src/chassis_test/shenlan_test/mainwindow.cpp

@@ -107,7 +107,8 @@ void MainWindow::ShareChassisDebug()
     pstr.reset(str);
     if(decition_debug.SerializeToArray(str,nsize))
     {
-        iv::modulecomm::ModuleSendMsg(mpaVechicleDeciton,str,nsize);
+        if(ui->start_send->isChecked())
+         iv::modulecomm::ModuleSendMsg(mpaVechicleDeciton,str,nsize);
     }
     else
     {

+ 1 - 1
src/chassis_test/shenlan_test/mainwindow.ui

@@ -737,7 +737,7 @@
        <item row="1" column="0">
         <widget class="QCheckBox" name="start_send">
          <property name="enabled">
-          <bool>false</bool>
+          <bool>true</bool>
          </property>
          <property name="text">
           <string>握手信号</string>

+ 24 - 0
src/detection/detection_chassis/decodechassis.cpp

@@ -496,6 +496,30 @@ int ProcShenLanCANFDChassis(void *pa, iv::can::canmsg *pmsg)
                 std::cout<<" 1CC not 64 bytes. 1CC bytes: "<<praw->len()<<std::endl;
             }
         }
+        if(praw->id() == 0x18a)
+        {
+            unsigned char byte[64];
+            double ang;
+            if(praw->len() == 64)
+            {
+                memcpy(byte,praw->data().data(),64);
+                unsigned int value;
+                value = byte[0]&0xFF;
+                value = (value<<8) +  static_cast<unsigned int >( byte[1]);
+                if(value<32767)
+                    ang = static_cast<double>(value) * 0.1;
+                else
+                    ang=static_cast<double>(value) * 0.1-65536*0.1;
+
+                xchassis.set_angle_feedback(static_cast<float>(ang));
+                ShareChassis(pa,&xchassis);
+                std::cout<<"ang: "<<xchassis.angle_feedback()<<std::endl;
+            }
+            else
+            {
+                std::cout<<" 1CC not 64 bytes. 1CC bytes: "<<praw->len()<<std::endl;
+            }
+        }
 
     }