2 Commits 2c382aff22 ... eef5eeed10

Autore SHA1 Messaggio Data
  liyupeng eef5eeed10 Merge branch 'master' of http://116.63.46.168:3000/ADPilot/modularization 2 mesi fa
  liyupeng d1b484337b first commit hardware-in-loop 2 mesi fa
64 ha cambiato i file con 4864 aggiunte e 0 eliminazioni
  1. 3 0
      src/python/cameradecision_signlight/.idea/.gitignore
  2. 8 0
      src/python/cameradecision_signlight/.idea/cameradecision_signlight.iml
  3. 24 0
      src/python/cameradecision_signlight/.idea/inspectionProfiles/Project_Default.xml
  4. 6 0
      src/python/cameradecision_signlight/.idea/inspectionProfiles/profiles_settings.xml
  5. 8 0
      src/python/cameradecision_signlight/.idea/modules.xml
  6. 97 0
      src/python/cameradecision_signlight/PyModuleCommModule.py
  7. 215 0
      src/python/cameradecision_signlight/cameradecision.py
  8. 132 0
      src/python/cameradecision_signlight/cameradecisionmain.py
  9. 1 0
      src/python/cameradecision_signlight/license
  10. 1 0
      src/python/cameradecision_signlight/machineID
  11. 0 0
      src/python/cameradecision_signlight/proto/__init__.py
  12. 28 0
      src/python/cameradecision_signlight/proto/cameraobject.proto
  13. 195 0
      src/python/cameradecision_signlight/proto/cameraobject_pb2.py
  14. 12 0
      src/python/cameradecision_signlight/proto/cameraobjectarray.proto
  15. 79 0
      src/python/cameradecision_signlight/proto/cameraobjectarray_pb2.py
  16. 33 0
      src/python/cameradecision_signlight/proto/chassis.proto
  17. 237 0
      src/python/cameradecision_signlight/proto/chassis_pb2.py
  18. 15 0
      src/python/cameradecision_signlight/proto/decitionspeedlimit.proto
  19. 118 0
      src/python/cameradecision_signlight/proto/decitionspeedlimit_pb2.py
  20. 16 0
      src/python/cameradecision_signlight/proto/lightarray.proto
  21. 177 0
      src/python/cameradecision_signlight/proto/lightarray_pb2.py
  22. 51 0
      src/python/cameradecision_signlight/proto/object.proto
  23. 421 0
      src/python/cameradecision_signlight/proto/object_pb2.py
  24. 11 0
      src/python/cameradecision_signlight/proto/objectarray.proto
  25. 79 0
      src/python/cameradecision_signlight/proto/objectarray_pb2.py
  26. 24 0
      src/python/cameradecision_signlight/readme.md
  27. 13 0
      src/python/cameradecision_signlight/setup.py
  28. 97 0
      src/python/cameradecision_signlight_speedcontrol/PyModuleCommModule.py
  29. 210 0
      src/python/cameradecision_signlight_speedcontrol/cameradecision.py
  30. 158 0
      src/python/cameradecision_signlight_speedcontrol/cameradecisionmain.py
  31. 1 0
      src/python/cameradecision_signlight_speedcontrol/license
  32. 1 0
      src/python/cameradecision_signlight_speedcontrol/machineID
  33. 0 0
      src/python/cameradecision_signlight_speedcontrol/proto/__init__.py
  34. 28 0
      src/python/cameradecision_signlight_speedcontrol/proto/cameraobject.proto
  35. 195 0
      src/python/cameradecision_signlight_speedcontrol/proto/cameraobject_pb2.py
  36. 12 0
      src/python/cameradecision_signlight_speedcontrol/proto/cameraobjectarray.proto
  37. 79 0
      src/python/cameradecision_signlight_speedcontrol/proto/cameraobjectarray_pb2.py
  38. 33 0
      src/python/cameradecision_signlight_speedcontrol/proto/chassis.proto
  39. 237 0
      src/python/cameradecision_signlight_speedcontrol/proto/chassis_pb2.py
  40. 15 0
      src/python/cameradecision_signlight_speedcontrol/proto/decitionspeedlimit.proto
  41. 118 0
      src/python/cameradecision_signlight_speedcontrol/proto/decitionspeedlimit_pb2.py
  42. 16 0
      src/python/cameradecision_signlight_speedcontrol/proto/lightarray.proto
  43. 177 0
      src/python/cameradecision_signlight_speedcontrol/proto/lightarray_pb2.py
  44. 51 0
      src/python/cameradecision_signlight_speedcontrol/proto/object.proto
  45. 421 0
      src/python/cameradecision_signlight_speedcontrol/proto/object_pb2.py
  46. 11 0
      src/python/cameradecision_signlight_speedcontrol/proto/objectarray.proto
  47. 79 0
      src/python/cameradecision_signlight_speedcontrol/proto/objectarray_pb2.py
  48. 24 0
      src/python/cameradecision_signlight_speedcontrol/readme.md
  49. 13 0
      src/python/cameradecision_signlight_speedcontrol/setup.py
  50. 97 0
      src/python/vehiclecountdemo/PyModuleCommModule.py
  51. 80 0
      src/python/vehiclecountdemo/coco.names
  52. 1 0
      src/python/vehiclecountdemo/license
  53. 1 0
      src/python/vehiclecountdemo/machineID
  54. 0 0
      src/python/vehiclecountdemo/proto/__init__.py
  55. 28 0
      src/python/vehiclecountdemo/proto/cameraobject.proto
  56. 195 0
      src/python/vehiclecountdemo/proto/cameraobject_pb2.py
  57. 12 0
      src/python/vehiclecountdemo/proto/cameraobjectarray.proto
  58. 79 0
      src/python/vehiclecountdemo/proto/cameraobjectarray_pb2.py
  59. 16 0
      src/python/vehiclecountdemo/proto/rawpic.proto
  60. 118 0
      src/python/vehiclecountdemo/proto/rawpic_pb2.py
  61. 21 0
      src/python/vehiclecountdemo/readme.md
  62. 13 0
      src/python/vehiclecountdemo/setup.py
  63. 131 0
      src/python/vehiclecountdemo/vehiclecount.py
  64. 92 0
      src/python/vehiclecountdemo/vehiclecountmain.py

+ 3 - 0
src/python/cameradecision_signlight/.idea/.gitignore

@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml

+ 8 - 0
src/python/cameradecision_signlight/.idea/cameradecision_signlight.iml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 24 - 0
src/python/cameradecision_signlight/.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,24 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="ignoredPackages">
+        <value>
+          <list size="11">
+            <item index="0" class="java.lang.String" itemvalue="tqdm" />
+            <item index="1" class="java.lang.String" itemvalue="tensorboard" />
+            <item index="2" class="java.lang.String" itemvalue="thop" />
+            <item index="3" class="java.lang.String" itemvalue="torch" />
+            <item index="4" class="java.lang.String" itemvalue="torchvision" />
+            <item index="5" class="java.lang.String" itemvalue="psutil" />
+            <item index="6" class="java.lang.String" itemvalue="certifi" />
+            <item index="7" class="java.lang.String" itemvalue="requests" />
+            <item index="8" class="java.lang.String" itemvalue="easydict" />
+            <item index="9" class="java.lang.String" itemvalue="numba" />
+            <item index="10" class="java.lang.String" itemvalue="progress" />
+          </list>
+        </value>
+      </option>
+    </inspection_tool>
+  </profile>
+</component>

+ 6 - 0
src/python/cameradecision_signlight/.idea/inspectionProfiles/profiles_settings.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="USE_PROJECT_PROFILE" value="false" />
+    <version value="1.0" />
+  </settings>
+</component>

+ 8 - 0
src/python/cameradecision_signlight/.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/cameradecision_signlight.iml" filepath="$PROJECT_DIR$/.idea/cameradecision_signlight.iml" />
+    </modules>
+  </component>
+</project>

+ 97 - 0
src/python/cameradecision_signlight/PyModuleCommModule.py

@@ -0,0 +1,97 @@
+
+import threading  
+import time  
+
+import modulecommpython
+import numpy as np 
+import ctypes
+
+
+modulelock = threading.Lock()  
+nThread = 0
+
+class PyModuleComm:
+    def __init__(self,strname):  
+        # 初始化代码... 
+        checklib=ctypes.CDLL('./libchecklicence.so')
+        a=checklib._ZN12Checklicence12CheckLinceseEv()
+        if a != 1:
+            exit(0)
+            
+        print("name: ",strname)
+        self.strmemname = strname
+        self.mbRegister = False
+        global nThread
+        nThread = nThread+1
+        self.mnMode = 0
+        print("nThread = ",nThread)
+        self.obj = modulecommpython.get_ca_object()
+        pass  
+
+    def RegisterRecv(self,call):
+        if self.mbRegister:
+            print(" Have register, can't register other.")
+            return
+        print("Register: ",self.strmemname)
+        self.mpcall = call
+        self.mbRegister = True
+        self.mbRun = True
+        self.mpthread = threading.Thread(target=self.threadrecvdata, args=(self.strmemname,))  
+        self.mpthread.start()
+        print("complete create thread.")
+        self.mnMode = 1
+        self.obj.RegisterRecv(self.strmemname)
+
+    def RegiseterSend(self,nSize,nPacCount):
+        if self.mbRegister:
+            print(" Have register, can't register other.")
+            return
+        print("Register: ",self.strmemname)
+        self.mnsize = nSize
+        self.mnPacCount = nPacCount
+        self.mbRegister = True
+        self.mnMode = 2
+        self.obj.RegisterSend(self.strmemname,nSize,nPacCount)
+    
+    def SendData(self,arr,nsendsize):      
+    #    nrealsize = np.zeros(1, dtype=np.int32)  
+        nrtn = self.obj.SendData(arr,nsendsize)
+  
+    def threadrecvdata(self, arg):  
+        # 这个函数将被线程执行  
+ #       print(f"线程开始执行,参数是 {arg}")  
+        nBuffSize = int(1000)
+        arr = np.zeros(nBuffSize,dtype=np.int8)
+        recvtime = np.zeros(1,dtype=np.int64)
+        nrealsize = np.zeros(1,dtype=np.int32)
+        while 1:
+            nrtn = self.obj.RecvData(arr,nBuffSize,nrealsize,recvtime)
+            if nrtn > 0:
+                self.mpcall(arr,nrtn,recvtime)
+            else:
+                pass
+            if nrtn < 0:
+                nBuffSize = int(nrealsize[0] * 2)
+                arr = np.zeros(nBuffSize,dtype=np.int8)
+            else:
+                time.sleep(0.001)
+            
+        print("threadrecvdata complete.")
+
+    def stop_thread(self):
+        self.mbRun = False
+        self.mpthread.join()
+  
+    def start_thread(self, arg):  
+        # 创建线程对象,target参数指向要在线程中运行的函数  
+        self.mbRun = True
+        self.mpthread = threading.Thread(target=self.my_function, args=(arg,))  
+          
+        # 启动线程  
+        self.mpthread.start()  
+          
+        # 可以在这里添加其他代码,主线程会继续执行  
+        print("主线程继续执行...")  
+  
+        # 如果需要等待线程结束,可以调用 join() 方法  
+        # thread.join()  

+ 215 - 0
src/python/cameradecision_signlight/cameradecision.py

@@ -0,0 +1,215 @@
+
+import proto.cameraobjectarray_pb2 as cameraobjectarray_pb2
+import proto.decitionspeedlimit_pb2 as decitionspeedlimit_pb2
+import proto.lightarray_pb2 as lightarray_pb2
+import proto.objectarray_pb2 as objectarray_pb2
+
+import math
+from typing import List  
+
+from datetime import datetime, timedelta  
+import time
+from xdg.Config import setIconSize
+
+
+class Point2D:
+    def __init__(self, x, y,hdg):
+        self.mx = x
+        self.my = y
+        self.mhdg = hdg
+        while self.mhdg < 0:
+            self.mhdg = self.mhdg + 2.0* math.pi
+        while self.mhdg >= 2.0*math.pi:
+            self.mhdg = self.mhdg - 2.0* math.pi
+        
+
+    def __str__(self):  
+        return f"Point2D({self.mx}, {self.my})"  
+
+class CameraDecision:  
+    def __init__(self):  
+        # 初始化代码...  
+        self.mendacc = -0.7  #抵达终点时的减速度为-0.7
+        self.mmaxwheel = 430 #最大方向盘角度
+        self.mdefaultacc = 1.0  #加速时的acc
+        self.mspeed = 10.0  #运行速度10km/h
+        self.mstopdistoobs = 6.0 #在距离障碍物多远停住
+        self.mstopdisacc = -1.0  #有障碍物时的减速度
+        self.mvehwidth = 2.3  #从车宽
+        self.acc_init = False
+        
+        self.lamp_counter_sign = 0
+        self.lamp_counter_light = 0
+        self.lamp_counter_lidar = 0  
+        
+        pass
+
+    def CalcDecision(self,xobjarray_sign : cameraobjectarray_pb2.cameraobjectarray,
+                     xobjarray_light: lightarray_pb2.Lightarray,
+                     xobjarray_lidar: objectarray_pb2.objectarray):
+
+        acc = 0.0   #加速度数值,m/s2  >0 加速  <0 制动
+        wheel = 0.0   #方向盘转角,>0 左转  <0 右转 -430----430
+        speed = 0.0  #车速
+        leftLamp = False   #左转向灯
+        rightLamp = False  #右转向灯
+
+        for pobj in xobjarray_sign.obj:
+            print(f"sigh type: {pobj.type} x : {pobj.x} y: {pobj.y}")   #获取摄像头感知结果的方法,其它数据可以查看proto文件用pobj.{名称}获取
+
+        for light in xobjarray_light.light:
+            print(f"light type: {light.type} x: {light.center.x} y: {light.center.x}")
+
+        for lidar in xobjarray_lidar.obj:
+            print(f"lidar obj type: {lidar.mnType} x: {lidar.centroid.x} y: {lidar.centroid.y} z: {lidar.centroid.z}")
+
+
+
+        ######################在此编写代码给出决策数值##################
+
+        for pobj in xobjarray_sign.obj:
+            if pobj.type =="Left":
+                wheel = 30
+                leftLamp = True
+            if pobj.type =="Right":
+                wheel = -30
+                rightLamp = True
+
+            if pobj.type == "Park":
+                if self.lamp_counter_sign % 10 < 5:
+                    leftLamp = True
+                    rightLamp = False
+                else:
+                    leftLamp = False
+                    rightLamp = True
+                self.lamp_counter_sign += 1
+
+        for light in xobjarray_light.light:
+            if light.type == 1:
+                leftLamp = True
+            elif light.type == 2:
+                if self.lamp_counter_light % 10 < 5:
+                    leftLamp = True
+                    rightLamp = False
+                else:
+                    leftLamp = False
+                    rightLamp = True
+                self.lamp_counter_light += 1
+
+        for lidar in xobjarray_lidar.obj:
+            if lidar.centroid.y > 0 and lidar.centroid.y < 15 :
+                if lidar.centroid.x > (-2 - lidar.dimensions.x*0.5) and lidar.centroid.x < (2 + lidar.dimensions.x *0.5):
+                    print("obstacle ahead !!!")
+                    if self.lamp_counter_lidar % 10 < 5:
+                        leftLamp = True
+                        rightLamp = False
+                    else:
+                        leftLamp = False
+                        rightLamp = True
+                    self.lamp_counter_lidar += 1
+
+        ############################################################
+
+        xdecisiion = decitionspeedlimit_pb2.decitionspeedlimit()
+        xdecisiion.wheelAngle = wheel
+        xdecisiion.accelerator = acc
+        xdecisiion.brake = 0
+        xdecisiion.speed = speed
+        xdecisiion.leftLamp = leftLamp
+        xdecisiion.rightLamp = rightLamp
+        if acc < 0:
+            xdecisiion.brake = acc
+            xdecisiion.torque = 0
+        else:
+            xdecisiion.brake = 0
+            fVehWeight = 1800
+            # fg = 9.8
+            fRollForce = 50
+            fRatio = 2.5
+            fNeed = fRollForce + fVehWeight*acc
+            xdecisiion.torque = (fNeed/fRatio)*0.08
+
+        return xdecisiion
+
+
+
+    def is_point_in_rotated_rectangle(self,x, y, x1, y1, yaw, l, w):  
+        # 将长方形的左下角坐标转换到原点  
+        x_rel = x - x1  
+        y_rel = y - y1  
+  
+        # 计算旋转矩阵(逆时针旋转)  
+        # | cos(yaw)  -sin(yaw) |  
+        # | sin(yaw)   cos(yaw) |  
+        cos_yaw = math.cos(yaw)  
+        sin_yaw = math.sin(yaw)  
+      
+        # 应用旋转矩阵到相对坐标  
+        x_rotated = x_rel * cos_yaw + y_rel * sin_yaw  
+        y_rotated = -x_rel * sin_yaw + y_rel * cos_yaw  
+  
+        # 判断点是否在旋转后的长方形内  
+        # 长方形的边界在旋转后的坐标系中是 [-l/2, l/2] x [-w/2, w/2]  
+        if -l/2 <= x_rotated <= l/2 and -w/2 <= y_rotated <= w/2:  
+            return True  
+        else:  
+            return False  
+  
+
+    def GaussProj(self,lon,lat):
+        iPI = 0.0174532925199433
+        ZoneWide = 6
+        a = 6378245.0
+        f = 1.0 / 298.3
+        ProjNo = int(lon / ZoneWide)
+        longitude0 = ProjNo * ZoneWide + ZoneWide / 2
+        longitude0 = longitude0 * iPI
+        latitude0 = 0
+        longitude1 = lon * iPI #经度转换为弧度
+        latitude1 = lat * iPI #//纬度转换为弧度
+        e2 = 2 * f - f * f
+        ee = e2 * (1.0 - e2)
+        NN = a / math.sqrt(1.0 - e2 * math.sin(latitude1)*math.sin(latitude1))
+        T = math.tan(latitude1)*math.tan(latitude1)
+        C = ee * math.cos(latitude1)*math.cos(latitude1)
+        A = (longitude1 - longitude0)*math.cos(latitude1)
+        M = a * ((1 - e2 / 4 - 3 * e2*e2 / 64 - 5 * e2*e2*e2 / 256)*latitude1 - (3 * e2 / 8 + 3 * e2*e2 / 32 + 45 * e2*e2*e2 / 1024)*math.sin(2 * latitude1)+ (15 * e2*e2 / 256 + 45 * e2*e2*e2 / 1024)*math.sin(4 * latitude1) - (35 * e2*e2*e2 / 3072)*math.sin(6 * latitude1))
+        xval = NN * (A + (1 - T + C)*A*A*A / 6 + (5 - 18 * T + T * T + 72 * C - 58 * ee)*A*A*A*A*A / 120)
+        yval = M + NN * math.tan(latitude1)*(A*A / 2 + (5 - T + 9 * C + 4 * C*C)*A*A*A*A / 24 + (61 - 58 * T + T * T + 600 * C - 330 * ee)*A*A*A*A*A*A / 720)
+        X0 = 1000000 * (ProjNo + 1) + 500000
+        Y0 = 0
+        xval = xval + X0; yval = yval + Y0;
+        X = xval
+        Y = yval
+        return X,Y
+    
+    def GaussProjInvCal(self,X,Y):
+        iPI = 0.0174532925199433   #3.1415926535898/180.0;
+        a = 6378245.0
+        f = 1.0 / 298.3 # //54年北京坐标系参数
+                #////a=6378140.0; f=1/298.257; //80年西安坐标系参数
+        ZoneWide = 6  # ////6度带宽
+        ProjNo = int(X / 1000000)  # //查找带号
+        longitude0 = (ProjNo - 1) * ZoneWide + ZoneWide / 2
+        longitude0 = longitude0 * iPI  # //中央经线
+        X0 = ProjNo * 1000000 + 500000  
+        Y0 = 0
+        xval = X - X0; yval = Y - Y0 #//带内大地坐标
+        e2 = 2 * f - f * f 
+        e1 = (1.0 - math.sqrt(1 - e2)) / (1.0 + math.sqrt(1 - e2))
+        ee = e2 / (1 - e2)
+        M = yval
+        u = M / (a*(1 - e2 / 4 - 3 * e2*e2 / 64 - 5 * e2*e2*e2 / 256))
+        fai = u + (3 * e1 / 2 - 27 * e1*e1*e1 / 32)*math.sin(2 * u) + (21 * e1*e1 / 16 - 55 * e1*e1*e1*e1 / 32)*math.sin(4 * u)+ (151 * e1*e1*e1 / 96)*math.sin(6 * u) + (1097 * e1*e1*e1*e1 / 512)*math.sin(8 * u)
+        C = ee * math.cos(fai)*math.cos(fai)
+        T = math.tan(fai)*math.tan(fai)
+        NN = a / math.sqrt(1.0 - e2 * math.sin(fai)*math.sin(fai))
+        R = a * (1 - e2) / math.sqrt((1 - e2 * math.sin(fai)*math.sin(fai))*(1 - e2 * math.sin(fai)*math.sin(fai))*(1 - e2 * math.sin(fai)*math.sin(fai)))
+        D = xval / NN
+        #//计算经度(Longitude) 纬度(Latitude)
+        longitude1 = longitude0 + (D - (1 + 2 * T + C)*D*D*D / 6 + (5 - 2 * C + 28 * T - 3 * C*C + 8 * ee + 24 * T*T)*D*D*D*D*D / 120) / math.cos(fai)
+        latitude1 = fai - (NN*math.tan(fai) / R)*(D*D / 2 - (5 + 3 * T + 10 * C - 4 * C*C - 9 * ee)*D*D*D*D / 24 + (61 + 90 * T + 298 * C + 45 * T*T - 256 * ee - 3 * C*C)*D*D*D*D*D*D / 720)
+        #//转换为度 DD
+        longitude = longitude1 / iPI
+        latitude = latitude1 / iPI
+        return longitude,latitude

+ 132 - 0
src/python/cameradecision_signlight/cameradecisionmain.py

@@ -0,0 +1,132 @@
+import modulecommpython
+import numpy as np  
+import time
+import sys 
+
+import proto.cameraobjectarray_pb2 as cameraobjectarray_pb2
+import proto.decitionspeedlimit_pb2 as decitionspeedlimit_pb2
+import proto.lightarray_pb2 as lightarray_pb2
+import proto.objectarray_pb2 as objectarray_pb2
+
+from PyModuleCommModule import PyModuleComm
+from cameradecision import CameraDecision
+
+
+time_objectarray_sign = 0
+msg_cameraobjectarray_sign = cameraobjectarray_pb2.cameraobjectarray()
+
+time_objectarray_light = 0
+msg_cameraobjectarray_light = lightarray_pb2.Lightarray()
+
+time_objectarray_lidar = 0
+msg_lidarobjectarray_lidar = objectarray_pb2.objectarray()
+
+
+gdecision = CameraDecision()
+
+def cameraobjectarray_callback(arr : np,nsize,time):
+    global msg_cameraobjectarray_sign
+    global time_objectarray_light
+    sub_arr = arr[0:nsize]
+    databytes = sub_arr.tobytes() #sub_arr.tostring()
+    msg = cameraobjectarray_pb2.cameraobjectarray()
+    msg.ParseFromString(databytes)
+    msg_cameraobjectarray_sign = msg
+    time_objectarray_light = time
+ #   length = len(msg_cameraobjectarray.obj)
+ #   print("obj size: ",length)
+    pass
+
+def Lightarray_callback(arr : np,nsize,time):
+    global msg_cameraobjectarray_light
+    global time_objectarray_light
+    sub_arr = arr[0:nsize]
+    databytes = sub_arr.tobytes() #sub_arr.tostring()
+    msg = lightarray_pb2.Lightarray()
+    msg.ParseFromString(databytes)
+    msg_cameraobjectarray_light = msg
+    time_objectarray_light = time
+ #   length = len(msg_cameraobjectarray_light.light)
+ #   print("obj size: ",length)
+    pass
+
+def Lidararray_callback(arr : np,nsize,time):
+    global msg_lidarobjectarray_lidar
+    global time_objectarray_lidar
+    sub_arr = arr[0:nsize]
+    databytes = sub_arr.tobytes() #sub_arr.tostring()
+    msg = objectarray_pb2.objectarray()
+    msg.ParseFromString(databytes)
+    msg_lidarobjectarray_lidar = msg
+    time_objectarray_lidar = time
+    # length = len(msg_lidarobjectarray_lidar.obj)
+    # print("obj size: ",length)
+    pass
+
+    
+def SendDefDecision(md : PyModuleComm):
+    pass
+
+def MakeDecision(md : PyModuleComm,  
+                 xobjarray_sign: cameraobjectarray_pb2.cameraobjectarray,
+                 xobjarray_light: lightarray_pb2.Lightarray,
+                 xobjarray_lidar:objectarray_pb2.objectarray):
+    
+    global gdecision
+
+    if (len(xobjarray_light.light) == 0) and (len(xobjarray_sign.obj) == 0) and (len(xobjarray_lidar.obj) == 0):
+        print(" no object")
+        return
+#    print("map1 point lenth: ",length)
+    xdecision = gdecision.CalcDecision(xobjarray_sign,xobjarray_light,xobjarray_lidar)
+    serialized_str = xdecision.SerializeToString()  
+    serialized_array = np.frombuffer(serialized_str, dtype=np.uint8)  
+    length = len(serialized_array)
+    md.SendData(serialized_array,length)
+    pass
+
+
+def main():  
+
+    global msg_cameraobjectarray_sign
+    global msg_cameraobjectarray_light
+    global msg_lidarobjectarray_lidar
+
+    # 初始化一个变量  
+    count = 0
+    count = 3.5/1.5
+    count = int(count)
+    print("count = ",count)  
+
+
+    mobj_sign = PyModuleComm("signarray")
+    mobj_sign.RegisterRecv(cameraobjectarray_callback)
+
+    mobj_light = PyModuleComm("lightarray")
+    mobj_light.RegisterRecv(Lightarray_callback)
+
+
+    mobj_lidar = PyModuleComm("lidar_track")
+    mobj_lidar.RegisterRecv(Lidararray_callback)
+
+    
+
+    md = PyModuleComm("decitonspeedlimit")
+    md.RegiseterSend(100000,1)
+    # 使用while循环,只要count小于10,就继续循环  
+    while count < 10:
+
+        MakeDecision(md,msg_cameraobjectarray_sign,msg_cameraobjectarray_light,msg_lidarobjectarray_lidar)
+        #clean data
+        msg_cameraobjectarray_sign = cameraobjectarray_pb2.cameraobjectarray()
+        msg_cameraobjectarray_light = lightarray_pb2.Lightarray()
+        msg_lidarobjectarray_lidar = objectarray_pb2.objectarray()
+
+        time.sleep(0.05)
+
+  
+    print("循环结束!")  
+  
+# 调用main函数  
+if __name__ == "__main__":  
+    main()

+ 1 - 0
src/python/cameradecision_signlight/license

@@ -0,0 +1 @@
+d737984cd907d53057feb8c8f6db3d9196923a8fd2a6f514977d94b97f72edc6

+ 1 - 0
src/python/cameradecision_signlight/machineID

@@ -0,0 +1 @@
+91h8884366kk1698h903kl108km9904m

+ 0 - 0
src/python/cameradecision_signlight/proto/__init__.py


+ 28 - 0
src/python/cameradecision_signlight/proto/cameraobject.proto

@@ -0,0 +1,28 @@
+syntax = "proto2";
+
+package iv.vision;
+
+message cameraobject
+{
+  optional int32 id = 1;   
+  optional string type = 2;  
+  optional float con = 3;   
+  optional int32 objmovestate = 4;  
+  optional int32 objawaystate = 5;  
+  optional int32 objcutstate = 6;  
+  optional int32 trajectime = 7;   
+  optional int32 lineid = 8;        
+  optional float w = 9;            
+  optional float h = 10;           
+  optional float Azimuth = 11;     
+  optional float speedx = 12;       
+  optional float speedy = 13;      
+  optional float accelerationx = 14;  
+  optional float accelerationy = 15;  
+  optional float x = 16; 
+  optional float y = 17; 
+  optional float outpointx = 18;  
+  optional float outpointy = 19;   
+};
+
+

+ 195 - 0
src/python/cameradecision_signlight/proto/cameraobject_pb2.py

@@ -0,0 +1,195 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: cameraobject.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='cameraobject.proto',
+  package='iv.vision',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x12\x63\x61meraobject.proto\x12\tiv.vision\"\xcb\x02\n\x0c\x63\x61meraobject\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x0b\n\x03\x63on\x18\x03 \x01(\x02\x12\x14\n\x0cobjmovestate\x18\x04 \x01(\x05\x12\x14\n\x0cobjawaystate\x18\x05 \x01(\x05\x12\x13\n\x0bobjcutstate\x18\x06 \x01(\x05\x12\x12\n\ntrajectime\x18\x07 \x01(\x05\x12\x0e\n\x06lineid\x18\x08 \x01(\x05\x12\t\n\x01w\x18\t \x01(\x02\x12\t\n\x01h\x18\n \x01(\x02\x12\x0f\n\x07\x41zimuth\x18\x0b \x01(\x02\x12\x0e\n\x06speedx\x18\x0c \x01(\x02\x12\x0e\n\x06speedy\x18\r \x01(\x02\x12\x15\n\raccelerationx\x18\x0e \x01(\x02\x12\x15\n\raccelerationy\x18\x0f \x01(\x02\x12\t\n\x01x\x18\x10 \x01(\x02\x12\t\n\x01y\x18\x11 \x01(\x02\x12\x11\n\toutpointx\x18\x12 \x01(\x02\x12\x11\n\toutpointy\x18\x13 \x01(\x02')
+)
+
+
+
+
+_CAMERAOBJECT = _descriptor.Descriptor(
+  name='cameraobject',
+  full_name='iv.vision.cameraobject',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='id', full_name='iv.vision.cameraobject.id', index=0,
+      number=1, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='type', full_name='iv.vision.cameraobject.type', index=1,
+      number=2, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='con', full_name='iv.vision.cameraobject.con', index=2,
+      number=3, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='objmovestate', full_name='iv.vision.cameraobject.objmovestate', index=3,
+      number=4, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='objawaystate', full_name='iv.vision.cameraobject.objawaystate', index=4,
+      number=5, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='objcutstate', full_name='iv.vision.cameraobject.objcutstate', index=5,
+      number=6, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='trajectime', full_name='iv.vision.cameraobject.trajectime', index=6,
+      number=7, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='lineid', full_name='iv.vision.cameraobject.lineid', index=7,
+      number=8, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='w', full_name='iv.vision.cameraobject.w', index=8,
+      number=9, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='h', full_name='iv.vision.cameraobject.h', index=9,
+      number=10, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='Azimuth', full_name='iv.vision.cameraobject.Azimuth', index=10,
+      number=11, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='speedx', full_name='iv.vision.cameraobject.speedx', index=11,
+      number=12, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='speedy', full_name='iv.vision.cameraobject.speedy', index=12,
+      number=13, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='accelerationx', full_name='iv.vision.cameraobject.accelerationx', index=13,
+      number=14, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='accelerationy', full_name='iv.vision.cameraobject.accelerationy', index=14,
+      number=15, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.vision.cameraobject.x', index=15,
+      number=16, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.vision.cameraobject.y', index=16,
+      number=17, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='outpointx', full_name='iv.vision.cameraobject.outpointx', index=17,
+      number=18, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='outpointy', full_name='iv.vision.cameraobject.outpointy', index=18,
+      number=19, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=34,
+  serialized_end=365,
+)
+
+DESCRIPTOR.message_types_by_name['cameraobject'] = _CAMERAOBJECT
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+cameraobject = _reflection.GeneratedProtocolMessageType('cameraobject', (_message.Message,), dict(
+  DESCRIPTOR = _CAMERAOBJECT,
+  __module__ = 'cameraobject_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.cameraobject)
+  ))
+_sym_db.RegisterMessage(cameraobject)
+
+
+# @@protoc_insertion_point(module_scope)

+ 12 - 0
src/python/cameradecision_signlight/proto/cameraobjectarray.proto

@@ -0,0 +1,12 @@
+
+syntax = "proto2";
+
+package iv.vision;
+
+import "cameraobject.proto";
+
+message cameraobjectarray
+{
+  repeated cameraobject obj = 1;
+  optional int64 mstime = 2;
+};

+ 79 - 0
src/python/cameradecision_signlight/proto/cameraobjectarray_pb2.py

@@ -0,0 +1,79 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: cameraobjectarray.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from . import cameraobject_pb2 as cameraobject__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='cameraobjectarray.proto',
+  package='iv.vision',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x17\x63\x61meraobjectarray.proto\x12\tiv.vision\x1a\x12\x63\x61meraobject.proto\"I\n\x11\x63\x61meraobjectarray\x12$\n\x03obj\x18\x01 \x03(\x0b\x32\x17.iv.vision.cameraobject\x12\x0e\n\x06mstime\x18\x02 \x01(\x03')
+  ,
+  dependencies=[cameraobject__pb2.DESCRIPTOR,])
+
+
+
+
+_CAMERAOBJECTARRAY = _descriptor.Descriptor(
+  name='cameraobjectarray',
+  full_name='iv.vision.cameraobjectarray',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='obj', full_name='iv.vision.cameraobjectarray.obj', index=0,
+      number=1, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='mstime', full_name='iv.vision.cameraobjectarray.mstime', index=1,
+      number=2, type=3, cpp_type=2, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=58,
+  serialized_end=131,
+)
+
+_CAMERAOBJECTARRAY.fields_by_name['obj'].message_type = cameraobject__pb2._CAMERAOBJECT
+DESCRIPTOR.message_types_by_name['cameraobjectarray'] = _CAMERAOBJECTARRAY
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+cameraobjectarray = _reflection.GeneratedProtocolMessageType('cameraobjectarray', (_message.Message,), dict(
+  DESCRIPTOR = _CAMERAOBJECTARRAY,
+  __module__ = 'cameraobjectarray_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.cameraobjectarray)
+  ))
+_sym_db.RegisterMessage(cameraobjectarray)
+
+
+# @@protoc_insertion_point(module_scope)

+ 33 - 0
src/python/cameradecision_signlight/proto/chassis.proto

@@ -0,0 +1,33 @@
+syntax = "proto2";
+
+package iv;
+
+message chassis
+{
+  optional int64 time = 1; //ms
+  optional int32 EPSMode = 2  [default = 0]; //0 idle 1 Manual 2 Auto
+  optional int32 EPBFault = 3 [default = 0];  //0 No 1 Have Fault
+  optional int32 DriveMode = 4;      //0 Manual 1 Auto
+  optional int32 Shift = 5;  //0 N  1 D   2 R  3 P  hapo:1p2r3n4d
+  optional int32 AEBAvailable = 6;
+  optional int32 CDDAvailable = 7;
+  optional int32 angle_feedback = 8;
+  optional float torque = 9;
+  optional float vel = 10;   //km/h
+  optional float accstep = 11;
+  optional float soc = 12;
+  optional float brake_feedback = 13;
+  optional int32 EPB_feedback = 14;
+  optional int32 EmergencyStop_feedback = 15;
+  optional int32 brakelight_feedback = 16;
+  optional float range_feedback = 17;
+  optional int32 drivectrltype_feedback = 18;
+  optional int32 brakectrltype_feedback = 19;
+  optional int32 epsctrltype_feedback = 20;
+  optional float frontleftwheel_feedback = 21;
+  optional float frontrightwheel_feedback = 22;
+  optional float rearleftwheel_feedback = 23;
+  optional float rearrightwheel_feedback = 24;
+  optional float engine_speed = 25;
+  
+};

+ 237 - 0
src/python/cameradecision_signlight/proto/chassis_pb2.py

@@ -0,0 +1,237 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: chassis.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='chassis.proto',
+  package='iv',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\rchassis.proto\x12\x02iv\"\xdc\x04\n\x07\x63hassis\x12\x0c\n\x04time\x18\x01 \x01(\x03\x12\x12\n\x07\x45PSMode\x18\x02 \x01(\x05:\x01\x30\x12\x13\n\x08\x45PBFault\x18\x03 \x01(\x05:\x01\x30\x12\x11\n\tDriveMode\x18\x04 \x01(\x05\x12\r\n\x05Shift\x18\x05 \x01(\x05\x12\x14\n\x0c\x41\x45\x42\x41vailable\x18\x06 \x01(\x05\x12\x14\n\x0c\x43\x44\x44\x41vailable\x18\x07 \x01(\x05\x12\x16\n\x0e\x61ngle_feedback\x18\x08 \x01(\x05\x12\x0e\n\x06torque\x18\t \x01(\x02\x12\x0b\n\x03vel\x18\n \x01(\x02\x12\x0f\n\x07\x61\x63\x63step\x18\x0b \x01(\x02\x12\x0b\n\x03soc\x18\x0c \x01(\x02\x12\x16\n\x0e\x62rake_feedback\x18\r \x01(\x02\x12\x14\n\x0c\x45PB_feedback\x18\x0e \x01(\x05\x12\x1e\n\x16\x45mergencyStop_feedback\x18\x0f \x01(\x05\x12\x1b\n\x13\x62rakelight_feedback\x18\x10 \x01(\x05\x12\x16\n\x0erange_feedback\x18\x11 \x01(\x02\x12\x1e\n\x16\x64rivectrltype_feedback\x18\x12 \x01(\x05\x12\x1e\n\x16\x62rakectrltype_feedback\x18\x13 \x01(\x05\x12\x1c\n\x14\x65psctrltype_feedback\x18\x14 \x01(\x05\x12\x1f\n\x17\x66rontleftwheel_feedback\x18\x15 \x01(\x02\x12 \n\x18\x66rontrightwheel_feedback\x18\x16 \x01(\x02\x12\x1e\n\x16rearleftwheel_feedback\x18\x17 \x01(\x02\x12\x1f\n\x17rearrightwheel_feedback\x18\x18 \x01(\x02\x12\x14\n\x0c\x65ngine_speed\x18\x19 \x01(\x02')
+)
+
+
+
+
+_CHASSIS = _descriptor.Descriptor(
+  name='chassis',
+  full_name='iv.chassis',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='time', full_name='iv.chassis.time', index=0,
+      number=1, type=3, cpp_type=2, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='EPSMode', full_name='iv.chassis.EPSMode', index=1,
+      number=2, type=5, cpp_type=1, label=1,
+      has_default_value=True, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='EPBFault', full_name='iv.chassis.EPBFault', index=2,
+      number=3, type=5, cpp_type=1, label=1,
+      has_default_value=True, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='DriveMode', full_name='iv.chassis.DriveMode', index=3,
+      number=4, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='Shift', full_name='iv.chassis.Shift', index=4,
+      number=5, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='AEBAvailable', full_name='iv.chassis.AEBAvailable', index=5,
+      number=6, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='CDDAvailable', full_name='iv.chassis.CDDAvailable', index=6,
+      number=7, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='angle_feedback', full_name='iv.chassis.angle_feedback', index=7,
+      number=8, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='torque', full_name='iv.chassis.torque', index=8,
+      number=9, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='vel', full_name='iv.chassis.vel', index=9,
+      number=10, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='accstep', full_name='iv.chassis.accstep', index=10,
+      number=11, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='soc', full_name='iv.chassis.soc', index=11,
+      number=12, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='brake_feedback', full_name='iv.chassis.brake_feedback', index=12,
+      number=13, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='EPB_feedback', full_name='iv.chassis.EPB_feedback', index=13,
+      number=14, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='EmergencyStop_feedback', full_name='iv.chassis.EmergencyStop_feedback', index=14,
+      number=15, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='brakelight_feedback', full_name='iv.chassis.brakelight_feedback', index=15,
+      number=16, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='range_feedback', full_name='iv.chassis.range_feedback', index=16,
+      number=17, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='drivectrltype_feedback', full_name='iv.chassis.drivectrltype_feedback', index=17,
+      number=18, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='brakectrltype_feedback', full_name='iv.chassis.brakectrltype_feedback', index=18,
+      number=19, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='epsctrltype_feedback', full_name='iv.chassis.epsctrltype_feedback', index=19,
+      number=20, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='frontleftwheel_feedback', full_name='iv.chassis.frontleftwheel_feedback', index=20,
+      number=21, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='frontrightwheel_feedback', full_name='iv.chassis.frontrightwheel_feedback', index=21,
+      number=22, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='rearleftwheel_feedback', full_name='iv.chassis.rearleftwheel_feedback', index=22,
+      number=23, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='rearrightwheel_feedback', full_name='iv.chassis.rearrightwheel_feedback', index=23,
+      number=24, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='engine_speed', full_name='iv.chassis.engine_speed', index=24,
+      number=25, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=22,
+  serialized_end=626,
+)
+
+DESCRIPTOR.message_types_by_name['chassis'] = _CHASSIS
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+chassis = _reflection.GeneratedProtocolMessageType('chassis', (_message.Message,), dict(
+  DESCRIPTOR = _CHASSIS,
+  __module__ = 'chassis_pb2'
+  # @@protoc_insertion_point(class_scope:iv.chassis)
+  ))
+_sym_db.RegisterMessage(chassis)
+
+
+# @@protoc_insertion_point(module_scope)

+ 15 - 0
src/python/cameradecision_signlight/proto/decitionspeedlimit.proto

@@ -0,0 +1,15 @@
+syntax = "proto2";
+
+package iv.brain;
+
+message decitionspeedlimit
+{
+    optional float speed = 1;                //车速
+    optional float wheelAngle = 2;           //横向转向角度
+    optional float wheelSpeed = 3;           //方向盘角速度
+    optional float brake = 4;                //刹车
+    optional float accelerator = 5;          //纵向加速度
+    optional float torque = 6;               //油门
+    optional bool  leftLamp = 7;             //左转向灯
+    optional bool  rightLamp = 8;            //右转向灯
+};

+ 118 - 0
src/python/cameradecision_signlight/proto/decitionspeedlimit_pb2.py

@@ -0,0 +1,118 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: decitionspeedlimit.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='decitionspeedlimit.proto',
+  package='iv.brain',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x18\x64\x65\x63itionspeedlimit.proto\x12\x08iv.brain\"\xa4\x01\n\x12\x64\x65\x63itionspeedlimit\x12\r\n\x05speed\x18\x01 \x01(\x02\x12\x12\n\nwheelAngle\x18\x02 \x01(\x02\x12\x12\n\nwheelSpeed\x18\x03 \x01(\x02\x12\r\n\x05\x62rake\x18\x04 \x01(\x02\x12\x13\n\x0b\x61\x63\x63\x65lerator\x18\x05 \x01(\x02\x12\x0e\n\x06torque\x18\x06 \x01(\x02\x12\x10\n\x08leftLamp\x18\x07 \x01(\x08\x12\x11\n\trightLamp\x18\x08 \x01(\x08')
+)
+
+
+
+
+_DECITIONSPEEDLIMIT = _descriptor.Descriptor(
+  name='decitionspeedlimit',
+  full_name='iv.brain.decitionspeedlimit',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='speed', full_name='iv.brain.decitionspeedlimit.speed', index=0,
+      number=1, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='wheelAngle', full_name='iv.brain.decitionspeedlimit.wheelAngle', index=1,
+      number=2, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='wheelSpeed', full_name='iv.brain.decitionspeedlimit.wheelSpeed', index=2,
+      number=3, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='brake', full_name='iv.brain.decitionspeedlimit.brake', index=3,
+      number=4, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='accelerator', full_name='iv.brain.decitionspeedlimit.accelerator', index=4,
+      number=5, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='torque', full_name='iv.brain.decitionspeedlimit.torque', index=5,
+      number=6, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='leftLamp', full_name='iv.brain.decitionspeedlimit.leftLamp', index=6,
+      number=7, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='rightLamp', full_name='iv.brain.decitionspeedlimit.rightLamp', index=7,
+      number=8, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=39,
+  serialized_end=203,
+)
+
+DESCRIPTOR.message_types_by_name['decitionspeedlimit'] = _DECITIONSPEEDLIMIT
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+decitionspeedlimit = _reflection.GeneratedProtocolMessageType('decitionspeedlimit', (_message.Message,), dict(
+  DESCRIPTOR = _DECITIONSPEEDLIMIT,
+  __module__ = 'decitionspeedlimit_pb2'
+  # @@protoc_insertion_point(class_scope:iv.brain.decitionspeedlimit)
+  ))
+_sym_db.RegisterMessage(decitionspeedlimit)
+
+
+# @@protoc_insertion_point(module_scope)

+ 16 - 0
src/python/cameradecision_signlight/proto/lightarray.proto

@@ -0,0 +1,16 @@
+syntax = "proto2";
+
+package iv.vision;
+message Center{
+  optional double x=1 [default = 0];  //x坐标
+  optional double y=2 [default = 0];  //y坐标
+};
+message Light{
+  optional int32 index = 1; //编号
+  optional int32 type = 2 [default = 0]; //类别:1-green; 2-red; 3-yellow
+  optional Center center = 3; //点
+};
+message Lightarray{
+  repeated Light light = 1;   
+  optional int64 timestamp =2; //时间戳
+};

+ 177 - 0
src/python/cameradecision_signlight/proto/lightarray_pb2.py

@@ -0,0 +1,177 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: lightarray.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='lightarray.proto',
+  package='iv.vision',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x10lightarray.proto\x12\tiv.vision\"$\n\x06\x43\x65nter\x12\x0c\n\x01x\x18\x01 \x01(\x01:\x01\x30\x12\x0c\n\x01y\x18\x02 \x01(\x01:\x01\x30\"J\n\x05Light\x12\r\n\x05index\x18\x01 \x01(\x05\x12\x0f\n\x04type\x18\x02 \x01(\x05:\x01\x30\x12!\n\x06\x63\x65nter\x18\x03 \x01(\x0b\x32\x11.iv.vision.Center\"@\n\nLightarray\x12\x1f\n\x05light\x18\x01 \x03(\x0b\x32\x10.iv.vision.Light\x12\x11\n\ttimestamp\x18\x02 \x01(\x03')
+)
+
+
+
+
+_CENTER = _descriptor.Descriptor(
+  name='Center',
+  full_name='iv.vision.Center',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.vision.Center.x', index=0,
+      number=1, type=1, cpp_type=5, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.vision.Center.y', index=1,
+      number=2, type=1, cpp_type=5, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=31,
+  serialized_end=67,
+)
+
+
+_LIGHT = _descriptor.Descriptor(
+  name='Light',
+  full_name='iv.vision.Light',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='index', full_name='iv.vision.Light.index', index=0,
+      number=1, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='type', full_name='iv.vision.Light.type', index=1,
+      number=2, type=5, cpp_type=1, label=1,
+      has_default_value=True, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='center', full_name='iv.vision.Light.center', index=2,
+      number=3, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=69,
+  serialized_end=143,
+)
+
+
+_LIGHTARRAY = _descriptor.Descriptor(
+  name='Lightarray',
+  full_name='iv.vision.Lightarray',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='light', full_name='iv.vision.Lightarray.light', index=0,
+      number=1, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='timestamp', full_name='iv.vision.Lightarray.timestamp', index=1,
+      number=2, type=3, cpp_type=2, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=145,
+  serialized_end=209,
+)
+
+_LIGHT.fields_by_name['center'].message_type = _CENTER
+_LIGHTARRAY.fields_by_name['light'].message_type = _LIGHT
+DESCRIPTOR.message_types_by_name['Center'] = _CENTER
+DESCRIPTOR.message_types_by_name['Light'] = _LIGHT
+DESCRIPTOR.message_types_by_name['Lightarray'] = _LIGHTARRAY
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+Center = _reflection.GeneratedProtocolMessageType('Center', (_message.Message,), dict(
+  DESCRIPTOR = _CENTER,
+  __module__ = 'lightarray_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.Center)
+  ))
+_sym_db.RegisterMessage(Center)
+
+Light = _reflection.GeneratedProtocolMessageType('Light', (_message.Message,), dict(
+  DESCRIPTOR = _LIGHT,
+  __module__ = 'lightarray_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.Light)
+  ))
+_sym_db.RegisterMessage(Light)
+
+Lightarray = _reflection.GeneratedProtocolMessageType('Lightarray', (_message.Message,), dict(
+  DESCRIPTOR = _LIGHTARRAY,
+  __module__ = 'lightarray_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.Lightarray)
+  ))
+_sym_db.RegisterMessage(Lightarray)
+
+
+# @@protoc_insertion_point(module_scope)

+ 51 - 0
src/python/cameradecision_signlight/proto/object.proto

@@ -0,0 +1,51 @@
+syntax = "proto2";
+
+package iv.lidar;
+
+message PointXYZI {
+  optional float x = 1 [default = nan];
+  optional float y = 2 [default = nan];
+  optional float z = 3 [default = nan];
+  optional float i = 4 [default = 0];
+};
+
+message PointXYZ {
+  optional float x = 1 [default = nan];
+  optional float y = 2 [default = nan];
+  optional float z = 3 [default = nan];
+};
+
+message Dimension {
+  optional float x = 1 [default = 0];
+  optional float y = 2 [default = 0];
+  optional float z = 3 [default = 0];
+};
+
+message VelXY {
+  optional float x =1 [default = 0];
+  optional float y =2 [default = 0];
+};
+
+message lidarobject
+{
+  optional PointXYZ min_point = 1;
+  optional PointXYZ max_point = 2;
+  optional PointXYZ centroid = 3;
+  optional Dimension dimensions = 4;
+  optional PointXYZ position = 5;
+  optional double angle =6;
+  optional double velocity_linear_x = 7;
+  optional double acceleration_linear_y = 8;
+  optional double timestamp = 9;
+  optional double tyaw = 10;
+  required int32 mnType = 11;
+  optional int32 id = 12;
+  optional int32 behavior_state = 13;
+  optional float score = 14;
+  optional bool velocity_reliable = 15;
+  optional bool pose_reliable = 16;
+  repeated float type_probs = 17;
+  repeated PointXYZI cloud = 18;
+  optional string type_name = 19;
+  optional VelXY vel_relative = 20; //相对速度
+};

+ 421 - 0
src/python/cameradecision_signlight/proto/object_pb2.py

@@ -0,0 +1,421 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: object.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='object.proto',
+  package='iv.lidar',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x0cobject.proto\x12\x08iv.lidar\"I\n\tPointXYZI\x12\x0e\n\x01x\x18\x01 \x01(\x02:\x03nan\x12\x0e\n\x01y\x18\x02 \x01(\x02:\x03nan\x12\x0e\n\x01z\x18\x03 \x01(\x02:\x03nan\x12\x0c\n\x01i\x18\x04 \x01(\x02:\x01\x30\":\n\x08PointXYZ\x12\x0e\n\x01x\x18\x01 \x01(\x02:\x03nan\x12\x0e\n\x01y\x18\x02 \x01(\x02:\x03nan\x12\x0e\n\x01z\x18\x03 \x01(\x02:\x03nan\"5\n\tDimension\x12\x0c\n\x01x\x18\x01 \x01(\x02:\x01\x30\x12\x0c\n\x01y\x18\x02 \x01(\x02:\x01\x30\x12\x0c\n\x01z\x18\x03 \x01(\x02:\x01\x30\"#\n\x05VelXY\x12\x0c\n\x01x\x18\x01 \x01(\x02:\x01\x30\x12\x0c\n\x01y\x18\x02 \x01(\x02:\x01\x30\"\xa1\x04\n\x0blidarobject\x12%\n\tmin_point\x18\x01 \x01(\x0b\x32\x12.iv.lidar.PointXYZ\x12%\n\tmax_point\x18\x02 \x01(\x0b\x32\x12.iv.lidar.PointXYZ\x12$\n\x08\x63\x65ntroid\x18\x03 \x01(\x0b\x32\x12.iv.lidar.PointXYZ\x12\'\n\ndimensions\x18\x04 \x01(\x0b\x32\x13.iv.lidar.Dimension\x12$\n\x08position\x18\x05 \x01(\x0b\x32\x12.iv.lidar.PointXYZ\x12\r\n\x05\x61ngle\x18\x06 \x01(\x01\x12\x19\n\x11velocity_linear_x\x18\x07 \x01(\x01\x12\x1d\n\x15\x61\x63\x63\x65leration_linear_y\x18\x08 \x01(\x01\x12\x11\n\ttimestamp\x18\t \x01(\x01\x12\x0c\n\x04tyaw\x18\n \x01(\x01\x12\x0e\n\x06mnType\x18\x0b \x02(\x05\x12\n\n\x02id\x18\x0c \x01(\x05\x12\x16\n\x0e\x62\x65havior_state\x18\r \x01(\x05\x12\r\n\x05score\x18\x0e \x01(\x02\x12\x19\n\x11velocity_reliable\x18\x0f \x01(\x08\x12\x15\n\rpose_reliable\x18\x10 \x01(\x08\x12\x12\n\ntype_probs\x18\x11 \x03(\x02\x12\"\n\x05\x63loud\x18\x12 \x03(\x0b\x32\x13.iv.lidar.PointXYZI\x12\x11\n\ttype_name\x18\x13 \x01(\t\x12%\n\x0cvel_relative\x18\x14 \x01(\x0b\x32\x0f.iv.lidar.VelXY')
+)
+
+
+
+
+_POINTXYZI = _descriptor.Descriptor(
+  name='PointXYZI',
+  full_name='iv.lidar.PointXYZI',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.lidar.PointXYZI.x', index=0,
+      number=1, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=(1e10000 * 0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.lidar.PointXYZI.y', index=1,
+      number=2, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=(1e10000 * 0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='z', full_name='iv.lidar.PointXYZI.z', index=2,
+      number=3, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=(1e10000 * 0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='i', full_name='iv.lidar.PointXYZI.i', index=3,
+      number=4, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=26,
+  serialized_end=99,
+)
+
+
+_POINTXYZ = _descriptor.Descriptor(
+  name='PointXYZ',
+  full_name='iv.lidar.PointXYZ',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.lidar.PointXYZ.x', index=0,
+      number=1, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=(1e10000 * 0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.lidar.PointXYZ.y', index=1,
+      number=2, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=(1e10000 * 0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='z', full_name='iv.lidar.PointXYZ.z', index=2,
+      number=3, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=(1e10000 * 0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=101,
+  serialized_end=159,
+)
+
+
+_DIMENSION = _descriptor.Descriptor(
+  name='Dimension',
+  full_name='iv.lidar.Dimension',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.lidar.Dimension.x', index=0,
+      number=1, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.lidar.Dimension.y', index=1,
+      number=2, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='z', full_name='iv.lidar.Dimension.z', index=2,
+      number=3, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=161,
+  serialized_end=214,
+)
+
+
+_VELXY = _descriptor.Descriptor(
+  name='VelXY',
+  full_name='iv.lidar.VelXY',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.lidar.VelXY.x', index=0,
+      number=1, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.lidar.VelXY.y', index=1,
+      number=2, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=216,
+  serialized_end=251,
+)
+
+
+_LIDAROBJECT = _descriptor.Descriptor(
+  name='lidarobject',
+  full_name='iv.lidar.lidarobject',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='min_point', full_name='iv.lidar.lidarobject.min_point', index=0,
+      number=1, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='max_point', full_name='iv.lidar.lidarobject.max_point', index=1,
+      number=2, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='centroid', full_name='iv.lidar.lidarobject.centroid', index=2,
+      number=3, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='dimensions', full_name='iv.lidar.lidarobject.dimensions', index=3,
+      number=4, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='position', full_name='iv.lidar.lidarobject.position', index=4,
+      number=5, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='angle', full_name='iv.lidar.lidarobject.angle', index=5,
+      number=6, type=1, cpp_type=5, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='velocity_linear_x', full_name='iv.lidar.lidarobject.velocity_linear_x', index=6,
+      number=7, type=1, cpp_type=5, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='acceleration_linear_y', full_name='iv.lidar.lidarobject.acceleration_linear_y', index=7,
+      number=8, type=1, cpp_type=5, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='timestamp', full_name='iv.lidar.lidarobject.timestamp', index=8,
+      number=9, type=1, cpp_type=5, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='tyaw', full_name='iv.lidar.lidarobject.tyaw', index=9,
+      number=10, type=1, cpp_type=5, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='mnType', full_name='iv.lidar.lidarobject.mnType', index=10,
+      number=11, type=5, cpp_type=1, label=2,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='id', full_name='iv.lidar.lidarobject.id', index=11,
+      number=12, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='behavior_state', full_name='iv.lidar.lidarobject.behavior_state', index=12,
+      number=13, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='score', full_name='iv.lidar.lidarobject.score', index=13,
+      number=14, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='velocity_reliable', full_name='iv.lidar.lidarobject.velocity_reliable', index=14,
+      number=15, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='pose_reliable', full_name='iv.lidar.lidarobject.pose_reliable', index=15,
+      number=16, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='type_probs', full_name='iv.lidar.lidarobject.type_probs', index=16,
+      number=17, type=2, cpp_type=6, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='cloud', full_name='iv.lidar.lidarobject.cloud', index=17,
+      number=18, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='type_name', full_name='iv.lidar.lidarobject.type_name', index=18,
+      number=19, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='vel_relative', full_name='iv.lidar.lidarobject.vel_relative', index=19,
+      number=20, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=254,
+  serialized_end=799,
+)
+
+_LIDAROBJECT.fields_by_name['min_point'].message_type = _POINTXYZ
+_LIDAROBJECT.fields_by_name['max_point'].message_type = _POINTXYZ
+_LIDAROBJECT.fields_by_name['centroid'].message_type = _POINTXYZ
+_LIDAROBJECT.fields_by_name['dimensions'].message_type = _DIMENSION
+_LIDAROBJECT.fields_by_name['position'].message_type = _POINTXYZ
+_LIDAROBJECT.fields_by_name['cloud'].message_type = _POINTXYZI
+_LIDAROBJECT.fields_by_name['vel_relative'].message_type = _VELXY
+DESCRIPTOR.message_types_by_name['PointXYZI'] = _POINTXYZI
+DESCRIPTOR.message_types_by_name['PointXYZ'] = _POINTXYZ
+DESCRIPTOR.message_types_by_name['Dimension'] = _DIMENSION
+DESCRIPTOR.message_types_by_name['VelXY'] = _VELXY
+DESCRIPTOR.message_types_by_name['lidarobject'] = _LIDAROBJECT
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+PointXYZI = _reflection.GeneratedProtocolMessageType('PointXYZI', (_message.Message,), dict(
+  DESCRIPTOR = _POINTXYZI,
+  __module__ = 'object_pb2'
+  # @@protoc_insertion_point(class_scope:iv.lidar.PointXYZI)
+  ))
+_sym_db.RegisterMessage(PointXYZI)
+
+PointXYZ = _reflection.GeneratedProtocolMessageType('PointXYZ', (_message.Message,), dict(
+  DESCRIPTOR = _POINTXYZ,
+  __module__ = 'object_pb2'
+  # @@protoc_insertion_point(class_scope:iv.lidar.PointXYZ)
+  ))
+_sym_db.RegisterMessage(PointXYZ)
+
+Dimension = _reflection.GeneratedProtocolMessageType('Dimension', (_message.Message,), dict(
+  DESCRIPTOR = _DIMENSION,
+  __module__ = 'object_pb2'
+  # @@protoc_insertion_point(class_scope:iv.lidar.Dimension)
+  ))
+_sym_db.RegisterMessage(Dimension)
+
+VelXY = _reflection.GeneratedProtocolMessageType('VelXY', (_message.Message,), dict(
+  DESCRIPTOR = _VELXY,
+  __module__ = 'object_pb2'
+  # @@protoc_insertion_point(class_scope:iv.lidar.VelXY)
+  ))
+_sym_db.RegisterMessage(VelXY)
+
+lidarobject = _reflection.GeneratedProtocolMessageType('lidarobject', (_message.Message,), dict(
+  DESCRIPTOR = _LIDAROBJECT,
+  __module__ = 'object_pb2'
+  # @@protoc_insertion_point(class_scope:iv.lidar.lidarobject)
+  ))
+_sym_db.RegisterMessage(lidarobject)
+
+
+# @@protoc_insertion_point(module_scope)

+ 11 - 0
src/python/cameradecision_signlight/proto/objectarray.proto

@@ -0,0 +1,11 @@
+syntax = "proto2";
+
+package iv.lidar;
+
+import "object.proto";
+
+message objectarray
+{
+  repeated lidarobject obj = 1;
+  optional double timestamp = 2;
+};

+ 79 - 0
src/python/cameradecision_signlight/proto/objectarray_pb2.py

@@ -0,0 +1,79 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: objectarray.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from . import object_pb2 as object__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='objectarray.proto',
+  package='iv.lidar',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x11objectarray.proto\x12\x08iv.lidar\x1a\x0cobject.proto\"D\n\x0bobjectarray\x12\"\n\x03obj\x18\x01 \x03(\x0b\x32\x15.iv.lidar.lidarobject\x12\x11\n\ttimestamp\x18\x02 \x01(\x01')
+  ,
+  dependencies=[object__pb2.DESCRIPTOR,])
+
+
+
+
+_OBJECTARRAY = _descriptor.Descriptor(
+  name='objectarray',
+  full_name='iv.lidar.objectarray',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='obj', full_name='iv.lidar.objectarray.obj', index=0,
+      number=1, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='timestamp', full_name='iv.lidar.objectarray.timestamp', index=1,
+      number=2, type=1, cpp_type=5, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=45,
+  serialized_end=113,
+)
+
+_OBJECTARRAY.fields_by_name['obj'].message_type = object__pb2._LIDAROBJECT
+DESCRIPTOR.message_types_by_name['objectarray'] = _OBJECTARRAY
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+objectarray = _reflection.GeneratedProtocolMessageType('objectarray', (_message.Message,), dict(
+  DESCRIPTOR = _OBJECTARRAY,
+  __module__ = 'objectarray_pb2'
+  # @@protoc_insertion_point(class_scope:iv.lidar.objectarray)
+  ))
+_sym_db.RegisterMessage(objectarray)
+
+
+# @@protoc_insertion_point(module_scope)

+ 24 - 0
src/python/cameradecision_signlight/readme.md

@@ -0,0 +1,24 @@
+sudo apt install python3-numpy
+
+sudo apt install python3-protobuf
+
+
+到src/common/modulecomm目录下新建一个build文件夹
+cd build
+cmake ..
+make
+将生成的modulecommpython.so文件拷贝到本文件夹
+
+
+
+如果需要修改_pb2.py,进入proto文件夹。
+执行:
+protoc *.proto -I=./ --python_out=./
+
+cameraobjectarray_pb2.py里修改cameraobject__pb2的导入方式,加from . 
+from . import cameraobject_pb2 as cameraobject__pb2
+
+objectarray_pb2.py里修改object__pb2的导入方式,加from . 
+from . import object_pb2 as object__pb2
+
+终端运行python3 setup.py build_ext --inplace 可以打包PyModuleCommModule模块,在该模块中加密。

+ 13 - 0
src/python/cameradecision_signlight/setup.py

@@ -0,0 +1,13 @@
+from setuptools import setup,Extension
+
+setup(
+    ext_modules=[
+        Extension(
+        name='PyModuleCommModule',
+        sources=['PyModuleCommModule.py']
+        )
+    ]
+)
+
+
+#python3 setup.py build_ext --inplace

+ 97 - 0
src/python/cameradecision_signlight_speedcontrol/PyModuleCommModule.py

@@ -0,0 +1,97 @@
+
+import threading  
+import time  
+
+import modulecommpython
+import numpy as np 
+import ctypes
+
+
+modulelock = threading.Lock()  
+nThread = 0
+
+class PyModuleComm:
+    def __init__(self,strname):  
+        # 初始化代码... 
+        checklib=ctypes.CDLL('./libchecklicence.so')
+        a=checklib._ZN12Checklicence12CheckLinceseEv()
+        if a != 1:
+            exit(0)
+            
+        print("name: ",strname)
+        self.strmemname = strname
+        self.mbRegister = False
+        global nThread
+        nThread = nThread+1
+        self.mnMode = 0
+        print("nThread = ",nThread)
+        self.obj = modulecommpython.get_ca_object()
+        pass  
+
+    def RegisterRecv(self,call):
+        if self.mbRegister:
+            print(" Have register, can't register other.")
+            return
+        print("Register: ",self.strmemname)
+        self.mpcall = call
+        self.mbRegister = True
+        self.mbRun = True
+        self.mpthread = threading.Thread(target=self.threadrecvdata, args=(self.strmemname,))  
+        self.mpthread.start()
+        print("complete create thread.")
+        self.mnMode = 1
+        self.obj.RegisterRecv(self.strmemname)
+
+    def RegiseterSend(self,nSize,nPacCount):
+        if self.mbRegister:
+            print(" Have register, can't register other.")
+            return
+        print("Register: ",self.strmemname)
+        self.mnsize = nSize
+        self.mnPacCount = nPacCount
+        self.mbRegister = True
+        self.mnMode = 2
+        self.obj.RegisterSend(self.strmemname,nSize,nPacCount)
+    
+    def SendData(self,arr,nsendsize):      
+    #    nrealsize = np.zeros(1, dtype=np.int32)  
+        nrtn = self.obj.SendData(arr,nsendsize)
+  
+    def threadrecvdata(self, arg):  
+        # 这个函数将被线程执行  
+ #       print(f"线程开始执行,参数是 {arg}")  
+        nBuffSize = int(1000)
+        arr = np.zeros(nBuffSize,dtype=np.int8)
+        recvtime = np.zeros(1,dtype=np.int64)
+        nrealsize = np.zeros(1,dtype=np.int32)
+        while 1:
+            nrtn = self.obj.RecvData(arr,nBuffSize,nrealsize,recvtime)
+            if nrtn > 0:
+                self.mpcall(arr,nrtn,recvtime)
+            else:
+                pass
+            if nrtn < 0:
+                nBuffSize = int(nrealsize[0] * 2)
+                arr = np.zeros(nBuffSize,dtype=np.int8)
+            else:
+                time.sleep(0.001)
+            
+        print("threadrecvdata complete.")
+
+    def stop_thread(self):
+        self.mbRun = False
+        self.mpthread.join()
+  
+    def start_thread(self, arg):  
+        # 创建线程对象,target参数指向要在线程中运行的函数  
+        self.mbRun = True
+        self.mpthread = threading.Thread(target=self.my_function, args=(arg,))  
+          
+        # 启动线程  
+        self.mpthread.start()  
+          
+        # 可以在这里添加其他代码,主线程会继续执行  
+        print("主线程继续执行...")  
+  
+        # 如果需要等待线程结束,可以调用 join() 方法  
+        # thread.join()  

+ 210 - 0
src/python/cameradecision_signlight_speedcontrol/cameradecision.py

@@ -0,0 +1,210 @@
+
+import proto.cameraobjectarray_pb2 as cameraobjectarray_pb2
+import proto.decitionspeedlimit_pb2 as decitionspeedlimit_pb2
+import proto.lightarray_pb2 as lightarray_pb2
+import proto.objectarray_pb2 as objectarray_pb2
+import proto.chassis_pb2 as chassis_pb2 
+
+import math
+from typing import List  
+
+from datetime import datetime, timedelta  
+import time
+
+from xdg.Config import setIconSize
+
+
+class Point2D:
+    def __init__(self, x, y,hdg):
+        self.mx = x
+        self.my = y
+        self.mhdg = hdg
+        while self.mhdg < 0:
+            self.mhdg = self.mhdg + 2.0* math.pi
+        while self.mhdg >= 2.0*math.pi:
+            self.mhdg = self.mhdg - 2.0* math.pi
+        
+
+    def __str__(self):  
+        return f"Point2D({self.mx}, {self.my})"  
+
+class CameraDecision:  
+    def __init__(self):  
+        self.mendacc = -0.7  # 抵达终点时的减速度为 -0.7 m/s²
+        self.mmaxwheel = 430  # 最大方向盘角度
+        self.mdefaultacc = 1.0  # 加速时的默认加速度
+        self.mspeed = 10.0  # 目标速度 10 km/h
+        
+        self.cspeed = self.mspeed
+        self.mstopdistoobs = 6.0  # 距离障碍物6米时停车
+        self.mstopdisacc = -1.0  # 障碍物检测时的减速度
+        self.mvehwidth = 2.3  # 车辆宽度
+
+        self.speed5_nodetect = 0
+        self.is_stop = False
+
+        pass
+
+    def CalcDecision(self, x_chassis, xobjarray_sign, xobjarray_light, xobjarray_lidar):
+        acc = 0.0  # 加速度,m/s² (>0 加速, <0 制动)
+        wheel = 0.0  # 方向盘转角 (>0 左转, <0 右转, 范围: -430 ~ 430)
+        speed = 0.0  # 车速
+        leftLamp = False  # 左转向灯
+        rightLamp = False  # 右转向灯
+
+        # 获取当前车辆速度
+        veh_speed = x_chassis.vel
+
+        print("veh speed: ",veh_speed)
+
+        # 控制加速度,使车速维持在目标速度 mspeed 附近
+
+        if not self.is_stop:
+            if veh_speed < self.cspeed:
+                acc = min(0.5, self.cspeed - veh_speed)  # 根据差值调整加速度,最大为0.5 m/s²
+            elif veh_speed > self.cspeed:
+                acc = max(-0.5, self.cspeed - veh_speed)  # 根据差值调整减速度,最小为-0.5 m/s²
+
+
+        ######################决策逻辑代码########################
+        if self.speed5_nodetect < 20:
+            self.speed5_nodetect += 1
+        # 基于标志物的决策
+        for pobj in xobjarray_sign.obj:
+            print("sign type: ",pobj.type)
+            if pobj.type == "Left":  # 左转标志
+                wheel = min(self.mmaxwheel, 30)  # 控制转角
+                leftLamp = True  # 打开右转向灯
+                
+            if pobj.type == "Right":  # 右转标志
+                wheel = max(-self.mmaxwheel, -30)  # 控制转角
+                rightLamp = True  # 打开左转向灯
+
+            if pobj.type == "Speed5":  # 限速5 km/h标志
+                self.cspeed = 5  # 将目标速度调整为 5 km/h
+                self.speed5_nodetect = 0
+                       
+        if self.speed5_nodetect > 10:
+            self.cspeed = self.mspeed 
+
+            
+        # 基于交通信号灯的决策
+        for light in xobjarray_light.light:
+            if light.type == 1:  # 绿灯,加速通过
+                self.is_stop = False
+                acc = 0.5  # 加速
+            elif light.type == 2:  # 红灯,停止
+                self.is_stop = True
+                acc = -1.0  # 大幅减速
+        ############################################################
+
+        # 创建并返回决策对象
+        xdecisiion = decitionspeedlimit_pb2.decitionspeedlimit()
+        xdecisiion.wheelAngle = wheel
+        xdecisiion.accelerator = acc
+        xdecisiion.brake = 0
+        xdecisiion.speed = speed
+        xdecisiion.leftLamp = leftLamp
+        xdecisiion.rightLamp = rightLamp
+
+
+        print("acc: ",acc)
+
+        # 制动决策
+        if acc < 0:
+            xdecisiion.brake = abs(acc)  # 将负加速度转换为制动值
+            xdecisiion.torque = 0  # 加速度为负时,无需扭矩输出
+        else:
+            xdecisiion.brake = 0  # 没有制动
+            fVehWeight = 1800  # 车辆重量,单位:kg
+            fRollForce = 50  # 滚动阻力
+            fRatio = 2.5  # 扭矩比例因子
+            fNeed = fRollForce + fVehWeight * acc  # 计算所需的动力
+            xdecisiion.torque = 100   # 计算输出扭矩
+            if acc == 0:
+                xdecisiion.torque = 0
+            
+        return xdecisiion
+
+
+
+    def is_point_in_rotated_rectangle(self,x, y, x1, y1, yaw, l, w):  
+        # 将长方形的左下角坐标转换到原点  
+        x_rel = x - x1  
+        y_rel = y - y1  
+  
+        # 计算旋转矩阵(逆时针旋转)  
+        # | cos(yaw)  -sin(yaw) |  
+        # | sin(yaw)   cos(yaw) |  
+        cos_yaw = math.cos(yaw)  
+        sin_yaw = math.sin(yaw)  
+      
+        # 应用旋转矩阵到相对坐标  
+        x_rotated = x_rel * cos_yaw + y_rel * sin_yaw  
+        y_rotated = -x_rel * sin_yaw + y_rel * cos_yaw  
+  
+        # 判断点是否在旋转后的长方形内  
+        # 长方形的边界在旋转后的坐标系中是 [-l/2, l/2] x [-w/2, w/2]  
+        if -l/2 <= x_rotated <= l/2 and -w/2 <= y_rotated <= w/2:  
+            return True  
+        else:  
+            return False  
+  
+
+    def GaussProj(self,lon,lat):
+        iPI = 0.0174532925199433
+        ZoneWide = 6
+        a = 6378245.0
+        f = 1.0 / 298.3
+        ProjNo = int(lon / ZoneWide)
+        longitude0 = ProjNo * ZoneWide + ZoneWide / 2
+        longitude0 = longitude0 * iPI
+        latitude0 = 0
+        longitude1 = lon * iPI #经度转换为弧度
+        latitude1 = lat * iPI #//纬度转换为弧度
+        e2 = 2 * f - f * f
+        ee = e2 * (1.0 - e2)
+        NN = a / math.sqrt(1.0 - e2 * math.sin(latitude1)*math.sin(latitude1))
+        T = math.tan(latitude1)*math.tan(latitude1)
+        C = ee * math.cos(latitude1)*math.cos(latitude1)
+        A = (longitude1 - longitude0)*math.cos(latitude1)
+        M = a * ((1 - e2 / 4 - 3 * e2*e2 / 64 - 5 * e2*e2*e2 / 256)*latitude1 - (3 * e2 / 8 + 3 * e2*e2 / 32 + 45 * e2*e2*e2 / 1024)*math.sin(2 * latitude1)+ (15 * e2*e2 / 256 + 45 * e2*e2*e2 / 1024)*math.sin(4 * latitude1) - (35 * e2*e2*e2 / 3072)*math.sin(6 * latitude1))
+        xval = NN * (A + (1 - T + C)*A*A*A / 6 + (5 - 18 * T + T * T + 72 * C - 58 * ee)*A*A*A*A*A / 120)
+        yval = M + NN * math.tan(latitude1)*(A*A / 2 + (5 - T + 9 * C + 4 * C*C)*A*A*A*A / 24 + (61 - 58 * T + T * T + 600 * C - 330 * ee)*A*A*A*A*A*A / 720)
+        X0 = 1000000 * (ProjNo + 1) + 500000
+        Y0 = 0
+        xval = xval + X0; yval = yval + Y0;
+        X = xval
+        Y = yval
+        return X,Y
+    
+    def GaussProjInvCal(self,X,Y):
+        iPI = 0.0174532925199433   #3.1415926535898/180.0;
+        a = 6378245.0
+        f = 1.0 / 298.3 # //54年北京坐标系参数
+                #////a=6378140.0; f=1/298.257; //80年西安坐标系参数
+        ZoneWide = 6  # ////6度带宽
+        ProjNo = int(X / 1000000)  # //查找带号
+        longitude0 = (ProjNo - 1) * ZoneWide + ZoneWide / 2
+        longitude0 = longitude0 * iPI  # //中央经线
+        X0 = ProjNo * 1000000 + 500000  
+        Y0 = 0
+        xval = X - X0; yval = Y - Y0 #//带内大地坐标
+        e2 = 2 * f - f * f 
+        e1 = (1.0 - math.sqrt(1 - e2)) / (1.0 + math.sqrt(1 - e2))
+        ee = e2 / (1 - e2)
+        M = yval
+        u = M / (a*(1 - e2 / 4 - 3 * e2*e2 / 64 - 5 * e2*e2*e2 / 256))
+        fai = u + (3 * e1 / 2 - 27 * e1*e1*e1 / 32)*math.sin(2 * u) + (21 * e1*e1 / 16 - 55 * e1*e1*e1*e1 / 32)*math.sin(4 * u)+ (151 * e1*e1*e1 / 96)*math.sin(6 * u) + (1097 * e1*e1*e1*e1 / 512)*math.sin(8 * u)
+        C = ee * math.cos(fai)*math.cos(fai)
+        T = math.tan(fai)*math.tan(fai)
+        NN = a / math.sqrt(1.0 - e2 * math.sin(fai)*math.sin(fai))
+        R = a * (1 - e2) / math.sqrt((1 - e2 * math.sin(fai)*math.sin(fai))*(1 - e2 * math.sin(fai)*math.sin(fai))*(1 - e2 * math.sin(fai)*math.sin(fai)))
+        D = xval / NN
+        #//计算经度(Longitude) 纬度(Latitude)
+        longitude1 = longitude0 + (D - (1 + 2 * T + C)*D*D*D / 6 + (5 - 2 * C + 28 * T - 3 * C*C + 8 * ee + 24 * T*T)*D*D*D*D*D / 120) / math.cos(fai)
+        latitude1 = fai - (NN*math.tan(fai) / R)*(D*D / 2 - (5 + 3 * T + 10 * C - 4 * C*C - 9 * ee)*D*D*D*D / 24 + (61 + 90 * T + 298 * C + 45 * T*T - 256 * ee - 3 * C*C)*D*D*D*D*D*D / 720)
+        #//转换为度 DD
+        longitude = longitude1 / iPI
+        latitude = latitude1 / iPI
+        return longitude,latitude

+ 158 - 0
src/python/cameradecision_signlight_speedcontrol/cameradecisionmain.py

@@ -0,0 +1,158 @@
+import modulecommpython
+import numpy as np  
+import time
+import sys 
+
+import proto.cameraobjectarray_pb2 as cameraobjectarray_pb2
+import proto.decitionspeedlimit_pb2 as decitionspeedlimit_pb2
+import proto.lightarray_pb2 as lightarray_pb2
+import proto.objectarray_pb2 as objectarray_pb2
+import proto.chassis_pb2 as chassis_pb2 
+
+
+from PyModuleCommModule import PyModuleComm
+from cameradecision import CameraDecision
+
+
+time_objectarray_sign = 0
+msg_cameraobjectarray_sign = cameraobjectarray_pb2.cameraobjectarray()
+
+time_objectarray_light = 0
+msg_cameraobjectarray_light = lightarray_pb2.Lightarray()
+
+time_objectarray_lidar = 0
+msg_lidarobjectarray_lidar = objectarray_pb2.objectarray()
+
+
+time_chassis = 0
+msg_chassis = chassis_pb2.chassis()
+
+gdecision = CameraDecision()
+
+def cameraobjectarray_callback(arr : np,nsize,time):
+    global msg_cameraobjectarray_sign
+    global time_objectarray_light
+    sub_arr = arr[0:nsize]
+    databytes = sub_arr.tobytes() #sub_arr.tostring()
+    msg = cameraobjectarray_pb2.cameraobjectarray()
+    msg.ParseFromString(databytes)
+    msg_cameraobjectarray_sign = msg
+    time_objectarray_light = time
+ #   length = len(msg_cameraobjectarray.obj)
+ #   print("obj size: ",length)
+    pass
+
+def Lightarray_callback(arr : np,nsize,time):
+    global msg_cameraobjectarray_light
+    global time_objectarray_light
+    sub_arr = arr[0:nsize]
+    databytes = sub_arr.tobytes() #sub_arr.tostring()
+    msg = lightarray_pb2.Lightarray()
+    msg.ParseFromString(databytes)
+    msg_cameraobjectarray_light = msg
+    time_objectarray_light = time
+ #   length = len(msg_cameraobjectarray_light.light)
+ #   print("obj size: ",length)
+    pass
+
+def Lidararray_callback(arr : np,nsize,time):
+    global msg_lidarobjectarray_lidar
+    global time_objectarray_lidar
+    sub_arr = arr[0:nsize]
+    databytes = sub_arr.tobytes() #sub_arr.tostring()
+    msg = objectarray_pb2.objectarray()
+    msg.ParseFromString(databytes)
+    msg_lidarobjectarray_lidar = msg
+    time_objectarray_lidar = time
+    # length = len(msg_lidarobjectarray_lidar.obj)
+    # print("obj size: ",length)
+    pass
+
+def chassisarray_callback(arr : np,nsize,time):
+    global msg_chassis
+    global time_chassis
+    sub_arr = arr[0:nsize]
+    databytes = sub_arr.tobytes() #sub_arr.tostring()
+    msg = chassis_pb2.chassis()
+    msg.ParseFromString(databytes)
+    msg_chassis = msg
+    time_chassis = time
+
+    # print("veh speed: ",msg_chassis.vel)
+
+    pass
+
+    
+def SendDefDecision(md : PyModuleComm):
+    pass
+
+def MakeDecision(md : PyModuleComm,  
+                 x_chassis: chassis_pb2.chassis,
+                 xobjarray_sign: cameraobjectarray_pb2.cameraobjectarray,
+                 xobjarray_light: lightarray_pb2.Lightarray,
+                 xobjarray_lidar:objectarray_pb2.objectarray):
+    
+    global gdecision
+
+    if (len(xobjarray_light.light) == 0) and (len(xobjarray_sign.obj) == 0) and (len(xobjarray_lidar.obj) == 0):
+        print(" no object")
+        #return
+#    print("map1 point lenth: ",length)
+    xdecision = gdecision.CalcDecision(x_chassis,xobjarray_sign,xobjarray_light,xobjarray_lidar)
+    serialized_str = xdecision.SerializeToString()  
+    serialized_array = np.frombuffer(serialized_str, dtype=np.uint8)  
+    length = len(serialized_array)
+    md.SendData(serialized_array,length)
+    pass
+
+
+def main():  
+
+    global msg_cameraobjectarray_sign
+    global msg_cameraobjectarray_light
+    global msg_lidarobjectarray_lidar
+    global msg_chassis
+
+    # 初始化一个变量  
+    count = 0
+    count = 3.5/1.5
+    count = int(count)
+    print("count = ",count)  
+
+
+    mobj_sign = PyModuleComm("signarray")
+    mobj_sign.RegisterRecv(cameraobjectarray_callback)
+
+    mobj_light = PyModuleComm("lightarray")
+    mobj_light.RegisterRecv(Lightarray_callback)
+
+
+    mobj_chassis = PyModuleComm("chassis")
+    mobj_chassis.RegisterRecv(chassisarray_callback)
+
+    # mobj_lidar = PyModuleComm("lidar_track")
+    # mobj_lidar.RegisterRecv(Lidararray_callback)
+    
+    md = PyModuleComm("decitonspeedlimit")
+    md.RegiseterSend(100000,1)
+    # 使用while循环,只要count小于10,就继续循环  
+    while count < 10:
+
+        MakeDecision(md,msg_chassis,
+                     msg_cameraobjectarray_sign,
+                     msg_cameraobjectarray_light,
+                     msg_lidarobjectarray_lidar)
+        #clean data
+        msg_chassis = chassis_pb2.chassis()
+        msg_cameraobjectarray_sign = cameraobjectarray_pb2.cameraobjectarray()
+        msg_cameraobjectarray_light = lightarray_pb2.Lightarray()
+        msg_lidarobjectarray_lidar = objectarray_pb2.objectarray()
+
+        time.sleep(0.05)
+
+  
+    print("循环结束!")  
+  
+# 调用main函数  
+if __name__ == "__main__":  
+    main()

+ 1 - 0
src/python/cameradecision_signlight_speedcontrol/license

@@ -0,0 +1 @@
+d737984cd907d53057feb8c8f6db3d9196923a8fd2a6f514977d94b97f72edc6

+ 1 - 0
src/python/cameradecision_signlight_speedcontrol/machineID

@@ -0,0 +1 @@
+91h8884366kk1698h903kl108km9904m

+ 0 - 0
src/python/cameradecision_signlight_speedcontrol/proto/__init__.py


+ 28 - 0
src/python/cameradecision_signlight_speedcontrol/proto/cameraobject.proto

@@ -0,0 +1,28 @@
+syntax = "proto2";
+
+package iv.vision;
+
+message cameraobject
+{
+  optional int32 id = 1;   
+  optional string type = 2;  
+  optional float con = 3;   
+  optional int32 objmovestate = 4;  
+  optional int32 objawaystate = 5;  
+  optional int32 objcutstate = 6;  
+  optional int32 trajectime = 7;   
+  optional int32 lineid = 8;        
+  optional float w = 9;            
+  optional float h = 10;           
+  optional float Azimuth = 11;     
+  optional float speedx = 12;       
+  optional float speedy = 13;      
+  optional float accelerationx = 14;  
+  optional float accelerationy = 15;  
+  optional float x = 16; 
+  optional float y = 17; 
+  optional float outpointx = 18;  
+  optional float outpointy = 19;   
+};
+
+

+ 195 - 0
src/python/cameradecision_signlight_speedcontrol/proto/cameraobject_pb2.py

@@ -0,0 +1,195 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: cameraobject.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='cameraobject.proto',
+  package='iv.vision',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x12\x63\x61meraobject.proto\x12\tiv.vision\"\xcb\x02\n\x0c\x63\x61meraobject\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x0b\n\x03\x63on\x18\x03 \x01(\x02\x12\x14\n\x0cobjmovestate\x18\x04 \x01(\x05\x12\x14\n\x0cobjawaystate\x18\x05 \x01(\x05\x12\x13\n\x0bobjcutstate\x18\x06 \x01(\x05\x12\x12\n\ntrajectime\x18\x07 \x01(\x05\x12\x0e\n\x06lineid\x18\x08 \x01(\x05\x12\t\n\x01w\x18\t \x01(\x02\x12\t\n\x01h\x18\n \x01(\x02\x12\x0f\n\x07\x41zimuth\x18\x0b \x01(\x02\x12\x0e\n\x06speedx\x18\x0c \x01(\x02\x12\x0e\n\x06speedy\x18\r \x01(\x02\x12\x15\n\raccelerationx\x18\x0e \x01(\x02\x12\x15\n\raccelerationy\x18\x0f \x01(\x02\x12\t\n\x01x\x18\x10 \x01(\x02\x12\t\n\x01y\x18\x11 \x01(\x02\x12\x11\n\toutpointx\x18\x12 \x01(\x02\x12\x11\n\toutpointy\x18\x13 \x01(\x02')
+)
+
+
+
+
+_CAMERAOBJECT = _descriptor.Descriptor(
+  name='cameraobject',
+  full_name='iv.vision.cameraobject',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='id', full_name='iv.vision.cameraobject.id', index=0,
+      number=1, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='type', full_name='iv.vision.cameraobject.type', index=1,
+      number=2, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='con', full_name='iv.vision.cameraobject.con', index=2,
+      number=3, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='objmovestate', full_name='iv.vision.cameraobject.objmovestate', index=3,
+      number=4, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='objawaystate', full_name='iv.vision.cameraobject.objawaystate', index=4,
+      number=5, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='objcutstate', full_name='iv.vision.cameraobject.objcutstate', index=5,
+      number=6, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='trajectime', full_name='iv.vision.cameraobject.trajectime', index=6,
+      number=7, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='lineid', full_name='iv.vision.cameraobject.lineid', index=7,
+      number=8, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='w', full_name='iv.vision.cameraobject.w', index=8,
+      number=9, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='h', full_name='iv.vision.cameraobject.h', index=9,
+      number=10, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='Azimuth', full_name='iv.vision.cameraobject.Azimuth', index=10,
+      number=11, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='speedx', full_name='iv.vision.cameraobject.speedx', index=11,
+      number=12, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='speedy', full_name='iv.vision.cameraobject.speedy', index=12,
+      number=13, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='accelerationx', full_name='iv.vision.cameraobject.accelerationx', index=13,
+      number=14, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='accelerationy', full_name='iv.vision.cameraobject.accelerationy', index=14,
+      number=15, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.vision.cameraobject.x', index=15,
+      number=16, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.vision.cameraobject.y', index=16,
+      number=17, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='outpointx', full_name='iv.vision.cameraobject.outpointx', index=17,
+      number=18, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='outpointy', full_name='iv.vision.cameraobject.outpointy', index=18,
+      number=19, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=34,
+  serialized_end=365,
+)
+
+DESCRIPTOR.message_types_by_name['cameraobject'] = _CAMERAOBJECT
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+cameraobject = _reflection.GeneratedProtocolMessageType('cameraobject', (_message.Message,), dict(
+  DESCRIPTOR = _CAMERAOBJECT,
+  __module__ = 'cameraobject_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.cameraobject)
+  ))
+_sym_db.RegisterMessage(cameraobject)
+
+
+# @@protoc_insertion_point(module_scope)

+ 12 - 0
src/python/cameradecision_signlight_speedcontrol/proto/cameraobjectarray.proto

@@ -0,0 +1,12 @@
+
+syntax = "proto2";
+
+package iv.vision;
+
+import "cameraobject.proto";
+
+message cameraobjectarray
+{
+  repeated cameraobject obj = 1;
+  optional int64 mstime = 2;
+};

+ 79 - 0
src/python/cameradecision_signlight_speedcontrol/proto/cameraobjectarray_pb2.py

@@ -0,0 +1,79 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: cameraobjectarray.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from . import cameraobject_pb2 as cameraobject__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='cameraobjectarray.proto',
+  package='iv.vision',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x17\x63\x61meraobjectarray.proto\x12\tiv.vision\x1a\x12\x63\x61meraobject.proto\"I\n\x11\x63\x61meraobjectarray\x12$\n\x03obj\x18\x01 \x03(\x0b\x32\x17.iv.vision.cameraobject\x12\x0e\n\x06mstime\x18\x02 \x01(\x03')
+  ,
+  dependencies=[cameraobject__pb2.DESCRIPTOR,])
+
+
+
+
+_CAMERAOBJECTARRAY = _descriptor.Descriptor(
+  name='cameraobjectarray',
+  full_name='iv.vision.cameraobjectarray',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='obj', full_name='iv.vision.cameraobjectarray.obj', index=0,
+      number=1, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='mstime', full_name='iv.vision.cameraobjectarray.mstime', index=1,
+      number=2, type=3, cpp_type=2, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=58,
+  serialized_end=131,
+)
+
+_CAMERAOBJECTARRAY.fields_by_name['obj'].message_type = cameraobject__pb2._CAMERAOBJECT
+DESCRIPTOR.message_types_by_name['cameraobjectarray'] = _CAMERAOBJECTARRAY
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+cameraobjectarray = _reflection.GeneratedProtocolMessageType('cameraobjectarray', (_message.Message,), dict(
+  DESCRIPTOR = _CAMERAOBJECTARRAY,
+  __module__ = 'cameraobjectarray_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.cameraobjectarray)
+  ))
+_sym_db.RegisterMessage(cameraobjectarray)
+
+
+# @@protoc_insertion_point(module_scope)

+ 33 - 0
src/python/cameradecision_signlight_speedcontrol/proto/chassis.proto

@@ -0,0 +1,33 @@
+syntax = "proto2";
+
+package iv;
+
+message chassis
+{
+  optional int64 time = 1; //ms
+  optional int32 EPSMode = 2  [default = 0]; //0 idle 1 Manual 2 Auto
+  optional int32 EPBFault = 3 [default = 0];  //0 No 1 Have Fault
+  optional int32 DriveMode = 4;      //0 Manual 1 Auto
+  optional int32 Shift = 5;  //0 N  1 D   2 R  3 P  hapo:1p2r3n4d
+  optional int32 AEBAvailable = 6;
+  optional int32 CDDAvailable = 7;
+  optional int32 angle_feedback = 8;
+  optional float torque = 9;
+  optional float vel = 10;   //km/h
+  optional float accstep = 11;
+  optional float soc = 12;
+  optional float brake_feedback = 13;
+  optional int32 EPB_feedback = 14;
+  optional int32 EmergencyStop_feedback = 15;
+  optional int32 brakelight_feedback = 16;
+  optional float range_feedback = 17;
+  optional int32 drivectrltype_feedback = 18;
+  optional int32 brakectrltype_feedback = 19;
+  optional int32 epsctrltype_feedback = 20;
+  optional float frontleftwheel_feedback = 21;
+  optional float frontrightwheel_feedback = 22;
+  optional float rearleftwheel_feedback = 23;
+  optional float rearrightwheel_feedback = 24;
+  optional float engine_speed = 25;
+  
+};

+ 237 - 0
src/python/cameradecision_signlight_speedcontrol/proto/chassis_pb2.py

@@ -0,0 +1,237 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: chassis.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='chassis.proto',
+  package='iv',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\rchassis.proto\x12\x02iv\"\xdc\x04\n\x07\x63hassis\x12\x0c\n\x04time\x18\x01 \x01(\x03\x12\x12\n\x07\x45PSMode\x18\x02 \x01(\x05:\x01\x30\x12\x13\n\x08\x45PBFault\x18\x03 \x01(\x05:\x01\x30\x12\x11\n\tDriveMode\x18\x04 \x01(\x05\x12\r\n\x05Shift\x18\x05 \x01(\x05\x12\x14\n\x0c\x41\x45\x42\x41vailable\x18\x06 \x01(\x05\x12\x14\n\x0c\x43\x44\x44\x41vailable\x18\x07 \x01(\x05\x12\x16\n\x0e\x61ngle_feedback\x18\x08 \x01(\x05\x12\x0e\n\x06torque\x18\t \x01(\x02\x12\x0b\n\x03vel\x18\n \x01(\x02\x12\x0f\n\x07\x61\x63\x63step\x18\x0b \x01(\x02\x12\x0b\n\x03soc\x18\x0c \x01(\x02\x12\x16\n\x0e\x62rake_feedback\x18\r \x01(\x02\x12\x14\n\x0c\x45PB_feedback\x18\x0e \x01(\x05\x12\x1e\n\x16\x45mergencyStop_feedback\x18\x0f \x01(\x05\x12\x1b\n\x13\x62rakelight_feedback\x18\x10 \x01(\x05\x12\x16\n\x0erange_feedback\x18\x11 \x01(\x02\x12\x1e\n\x16\x64rivectrltype_feedback\x18\x12 \x01(\x05\x12\x1e\n\x16\x62rakectrltype_feedback\x18\x13 \x01(\x05\x12\x1c\n\x14\x65psctrltype_feedback\x18\x14 \x01(\x05\x12\x1f\n\x17\x66rontleftwheel_feedback\x18\x15 \x01(\x02\x12 \n\x18\x66rontrightwheel_feedback\x18\x16 \x01(\x02\x12\x1e\n\x16rearleftwheel_feedback\x18\x17 \x01(\x02\x12\x1f\n\x17rearrightwheel_feedback\x18\x18 \x01(\x02\x12\x14\n\x0c\x65ngine_speed\x18\x19 \x01(\x02')
+)
+
+
+
+
+_CHASSIS = _descriptor.Descriptor(
+  name='chassis',
+  full_name='iv.chassis',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='time', full_name='iv.chassis.time', index=0,
+      number=1, type=3, cpp_type=2, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='EPSMode', full_name='iv.chassis.EPSMode', index=1,
+      number=2, type=5, cpp_type=1, label=1,
+      has_default_value=True, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='EPBFault', full_name='iv.chassis.EPBFault', index=2,
+      number=3, type=5, cpp_type=1, label=1,
+      has_default_value=True, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='DriveMode', full_name='iv.chassis.DriveMode', index=3,
+      number=4, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='Shift', full_name='iv.chassis.Shift', index=4,
+      number=5, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='AEBAvailable', full_name='iv.chassis.AEBAvailable', index=5,
+      number=6, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='CDDAvailable', full_name='iv.chassis.CDDAvailable', index=6,
+      number=7, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='angle_feedback', full_name='iv.chassis.angle_feedback', index=7,
+      number=8, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='torque', full_name='iv.chassis.torque', index=8,
+      number=9, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='vel', full_name='iv.chassis.vel', index=9,
+      number=10, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='accstep', full_name='iv.chassis.accstep', index=10,
+      number=11, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='soc', full_name='iv.chassis.soc', index=11,
+      number=12, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='brake_feedback', full_name='iv.chassis.brake_feedback', index=12,
+      number=13, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='EPB_feedback', full_name='iv.chassis.EPB_feedback', index=13,
+      number=14, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='EmergencyStop_feedback', full_name='iv.chassis.EmergencyStop_feedback', index=14,
+      number=15, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='brakelight_feedback', full_name='iv.chassis.brakelight_feedback', index=15,
+      number=16, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='range_feedback', full_name='iv.chassis.range_feedback', index=16,
+      number=17, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='drivectrltype_feedback', full_name='iv.chassis.drivectrltype_feedback', index=17,
+      number=18, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='brakectrltype_feedback', full_name='iv.chassis.brakectrltype_feedback', index=18,
+      number=19, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='epsctrltype_feedback', full_name='iv.chassis.epsctrltype_feedback', index=19,
+      number=20, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='frontleftwheel_feedback', full_name='iv.chassis.frontleftwheel_feedback', index=20,
+      number=21, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='frontrightwheel_feedback', full_name='iv.chassis.frontrightwheel_feedback', index=21,
+      number=22, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='rearleftwheel_feedback', full_name='iv.chassis.rearleftwheel_feedback', index=22,
+      number=23, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='rearrightwheel_feedback', full_name='iv.chassis.rearrightwheel_feedback', index=23,
+      number=24, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='engine_speed', full_name='iv.chassis.engine_speed', index=24,
+      number=25, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=22,
+  serialized_end=626,
+)
+
+DESCRIPTOR.message_types_by_name['chassis'] = _CHASSIS
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+chassis = _reflection.GeneratedProtocolMessageType('chassis', (_message.Message,), dict(
+  DESCRIPTOR = _CHASSIS,
+  __module__ = 'chassis_pb2'
+  # @@protoc_insertion_point(class_scope:iv.chassis)
+  ))
+_sym_db.RegisterMessage(chassis)
+
+
+# @@protoc_insertion_point(module_scope)

+ 15 - 0
src/python/cameradecision_signlight_speedcontrol/proto/decitionspeedlimit.proto

@@ -0,0 +1,15 @@
+syntax = "proto2";
+
+package iv.brain;
+
+message decitionspeedlimit
+{
+    optional float speed = 1;                //车速
+    optional float wheelAngle = 2;           //横向转向角度
+    optional float wheelSpeed = 3;           //方向盘角速度
+    optional float brake = 4;                //刹车
+    optional float accelerator = 5;          //纵向加速度
+    optional float torque = 6;               //油门
+    optional bool  leftLamp = 7;             //左转向灯
+    optional bool  rightLamp = 8;            //右转向灯
+};

+ 118 - 0
src/python/cameradecision_signlight_speedcontrol/proto/decitionspeedlimit_pb2.py

@@ -0,0 +1,118 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: decitionspeedlimit.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='decitionspeedlimit.proto',
+  package='iv.brain',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x18\x64\x65\x63itionspeedlimit.proto\x12\x08iv.brain\"\xa4\x01\n\x12\x64\x65\x63itionspeedlimit\x12\r\n\x05speed\x18\x01 \x01(\x02\x12\x12\n\nwheelAngle\x18\x02 \x01(\x02\x12\x12\n\nwheelSpeed\x18\x03 \x01(\x02\x12\r\n\x05\x62rake\x18\x04 \x01(\x02\x12\x13\n\x0b\x61\x63\x63\x65lerator\x18\x05 \x01(\x02\x12\x0e\n\x06torque\x18\x06 \x01(\x02\x12\x10\n\x08leftLamp\x18\x07 \x01(\x08\x12\x11\n\trightLamp\x18\x08 \x01(\x08')
+)
+
+
+
+
+_DECITIONSPEEDLIMIT = _descriptor.Descriptor(
+  name='decitionspeedlimit',
+  full_name='iv.brain.decitionspeedlimit',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='speed', full_name='iv.brain.decitionspeedlimit.speed', index=0,
+      number=1, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='wheelAngle', full_name='iv.brain.decitionspeedlimit.wheelAngle', index=1,
+      number=2, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='wheelSpeed', full_name='iv.brain.decitionspeedlimit.wheelSpeed', index=2,
+      number=3, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='brake', full_name='iv.brain.decitionspeedlimit.brake', index=3,
+      number=4, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='accelerator', full_name='iv.brain.decitionspeedlimit.accelerator', index=4,
+      number=5, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='torque', full_name='iv.brain.decitionspeedlimit.torque', index=5,
+      number=6, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='leftLamp', full_name='iv.brain.decitionspeedlimit.leftLamp', index=6,
+      number=7, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='rightLamp', full_name='iv.brain.decitionspeedlimit.rightLamp', index=7,
+      number=8, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=39,
+  serialized_end=203,
+)
+
+DESCRIPTOR.message_types_by_name['decitionspeedlimit'] = _DECITIONSPEEDLIMIT
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+decitionspeedlimit = _reflection.GeneratedProtocolMessageType('decitionspeedlimit', (_message.Message,), dict(
+  DESCRIPTOR = _DECITIONSPEEDLIMIT,
+  __module__ = 'decitionspeedlimit_pb2'
+  # @@protoc_insertion_point(class_scope:iv.brain.decitionspeedlimit)
+  ))
+_sym_db.RegisterMessage(decitionspeedlimit)
+
+
+# @@protoc_insertion_point(module_scope)

+ 16 - 0
src/python/cameradecision_signlight_speedcontrol/proto/lightarray.proto

@@ -0,0 +1,16 @@
+syntax = "proto2";
+
+package iv.vision;
+message Center{
+  optional double x=1 [default = 0];  //x坐标
+  optional double y=2 [default = 0];  //y坐标
+};
+message Light{
+  optional int32 index = 1; //编号
+  optional int32 type = 2 [default = 0]; //类别:1-green; 2-red; 3-yellow
+  optional Center center = 3; //点
+};
+message Lightarray{
+  repeated Light light = 1;   
+  optional int64 timestamp =2; //时间戳
+};

+ 177 - 0
src/python/cameradecision_signlight_speedcontrol/proto/lightarray_pb2.py

@@ -0,0 +1,177 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: lightarray.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='lightarray.proto',
+  package='iv.vision',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x10lightarray.proto\x12\tiv.vision\"$\n\x06\x43\x65nter\x12\x0c\n\x01x\x18\x01 \x01(\x01:\x01\x30\x12\x0c\n\x01y\x18\x02 \x01(\x01:\x01\x30\"J\n\x05Light\x12\r\n\x05index\x18\x01 \x01(\x05\x12\x0f\n\x04type\x18\x02 \x01(\x05:\x01\x30\x12!\n\x06\x63\x65nter\x18\x03 \x01(\x0b\x32\x11.iv.vision.Center\"@\n\nLightarray\x12\x1f\n\x05light\x18\x01 \x03(\x0b\x32\x10.iv.vision.Light\x12\x11\n\ttimestamp\x18\x02 \x01(\x03')
+)
+
+
+
+
+_CENTER = _descriptor.Descriptor(
+  name='Center',
+  full_name='iv.vision.Center',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.vision.Center.x', index=0,
+      number=1, type=1, cpp_type=5, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.vision.Center.y', index=1,
+      number=2, type=1, cpp_type=5, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=31,
+  serialized_end=67,
+)
+
+
+_LIGHT = _descriptor.Descriptor(
+  name='Light',
+  full_name='iv.vision.Light',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='index', full_name='iv.vision.Light.index', index=0,
+      number=1, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='type', full_name='iv.vision.Light.type', index=1,
+      number=2, type=5, cpp_type=1, label=1,
+      has_default_value=True, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='center', full_name='iv.vision.Light.center', index=2,
+      number=3, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=69,
+  serialized_end=143,
+)
+
+
+_LIGHTARRAY = _descriptor.Descriptor(
+  name='Lightarray',
+  full_name='iv.vision.Lightarray',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='light', full_name='iv.vision.Lightarray.light', index=0,
+      number=1, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='timestamp', full_name='iv.vision.Lightarray.timestamp', index=1,
+      number=2, type=3, cpp_type=2, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=145,
+  serialized_end=209,
+)
+
+_LIGHT.fields_by_name['center'].message_type = _CENTER
+_LIGHTARRAY.fields_by_name['light'].message_type = _LIGHT
+DESCRIPTOR.message_types_by_name['Center'] = _CENTER
+DESCRIPTOR.message_types_by_name['Light'] = _LIGHT
+DESCRIPTOR.message_types_by_name['Lightarray'] = _LIGHTARRAY
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+Center = _reflection.GeneratedProtocolMessageType('Center', (_message.Message,), dict(
+  DESCRIPTOR = _CENTER,
+  __module__ = 'lightarray_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.Center)
+  ))
+_sym_db.RegisterMessage(Center)
+
+Light = _reflection.GeneratedProtocolMessageType('Light', (_message.Message,), dict(
+  DESCRIPTOR = _LIGHT,
+  __module__ = 'lightarray_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.Light)
+  ))
+_sym_db.RegisterMessage(Light)
+
+Lightarray = _reflection.GeneratedProtocolMessageType('Lightarray', (_message.Message,), dict(
+  DESCRIPTOR = _LIGHTARRAY,
+  __module__ = 'lightarray_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.Lightarray)
+  ))
+_sym_db.RegisterMessage(Lightarray)
+
+
+# @@protoc_insertion_point(module_scope)

+ 51 - 0
src/python/cameradecision_signlight_speedcontrol/proto/object.proto

@@ -0,0 +1,51 @@
+syntax = "proto2";
+
+package iv.lidar;
+
+message PointXYZI {
+  optional float x = 1 [default = nan];
+  optional float y = 2 [default = nan];
+  optional float z = 3 [default = nan];
+  optional float i = 4 [default = 0];
+};
+
+message PointXYZ {
+  optional float x = 1 [default = nan];
+  optional float y = 2 [default = nan];
+  optional float z = 3 [default = nan];
+};
+
+message Dimension {
+  optional float x = 1 [default = 0];
+  optional float y = 2 [default = 0];
+  optional float z = 3 [default = 0];
+};
+
+message VelXY {
+  optional float x =1 [default = 0];
+  optional float y =2 [default = 0];
+};
+
+message lidarobject
+{
+  optional PointXYZ min_point = 1;
+  optional PointXYZ max_point = 2;
+  optional PointXYZ centroid = 3;
+  optional Dimension dimensions = 4;
+  optional PointXYZ position = 5;
+  optional double angle =6;
+  optional double velocity_linear_x = 7;
+  optional double acceleration_linear_y = 8;
+  optional double timestamp = 9;
+  optional double tyaw = 10;
+  required int32 mnType = 11;
+  optional int32 id = 12;
+  optional int32 behavior_state = 13;
+  optional float score = 14;
+  optional bool velocity_reliable = 15;
+  optional bool pose_reliable = 16;
+  repeated float type_probs = 17;
+  repeated PointXYZI cloud = 18;
+  optional string type_name = 19;
+  optional VelXY vel_relative = 20; //相对速度
+};

+ 421 - 0
src/python/cameradecision_signlight_speedcontrol/proto/object_pb2.py

@@ -0,0 +1,421 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: object.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='object.proto',
+  package='iv.lidar',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x0cobject.proto\x12\x08iv.lidar\"I\n\tPointXYZI\x12\x0e\n\x01x\x18\x01 \x01(\x02:\x03nan\x12\x0e\n\x01y\x18\x02 \x01(\x02:\x03nan\x12\x0e\n\x01z\x18\x03 \x01(\x02:\x03nan\x12\x0c\n\x01i\x18\x04 \x01(\x02:\x01\x30\":\n\x08PointXYZ\x12\x0e\n\x01x\x18\x01 \x01(\x02:\x03nan\x12\x0e\n\x01y\x18\x02 \x01(\x02:\x03nan\x12\x0e\n\x01z\x18\x03 \x01(\x02:\x03nan\"5\n\tDimension\x12\x0c\n\x01x\x18\x01 \x01(\x02:\x01\x30\x12\x0c\n\x01y\x18\x02 \x01(\x02:\x01\x30\x12\x0c\n\x01z\x18\x03 \x01(\x02:\x01\x30\"#\n\x05VelXY\x12\x0c\n\x01x\x18\x01 \x01(\x02:\x01\x30\x12\x0c\n\x01y\x18\x02 \x01(\x02:\x01\x30\"\xa1\x04\n\x0blidarobject\x12%\n\tmin_point\x18\x01 \x01(\x0b\x32\x12.iv.lidar.PointXYZ\x12%\n\tmax_point\x18\x02 \x01(\x0b\x32\x12.iv.lidar.PointXYZ\x12$\n\x08\x63\x65ntroid\x18\x03 \x01(\x0b\x32\x12.iv.lidar.PointXYZ\x12\'\n\ndimensions\x18\x04 \x01(\x0b\x32\x13.iv.lidar.Dimension\x12$\n\x08position\x18\x05 \x01(\x0b\x32\x12.iv.lidar.PointXYZ\x12\r\n\x05\x61ngle\x18\x06 \x01(\x01\x12\x19\n\x11velocity_linear_x\x18\x07 \x01(\x01\x12\x1d\n\x15\x61\x63\x63\x65leration_linear_y\x18\x08 \x01(\x01\x12\x11\n\ttimestamp\x18\t \x01(\x01\x12\x0c\n\x04tyaw\x18\n \x01(\x01\x12\x0e\n\x06mnType\x18\x0b \x02(\x05\x12\n\n\x02id\x18\x0c \x01(\x05\x12\x16\n\x0e\x62\x65havior_state\x18\r \x01(\x05\x12\r\n\x05score\x18\x0e \x01(\x02\x12\x19\n\x11velocity_reliable\x18\x0f \x01(\x08\x12\x15\n\rpose_reliable\x18\x10 \x01(\x08\x12\x12\n\ntype_probs\x18\x11 \x03(\x02\x12\"\n\x05\x63loud\x18\x12 \x03(\x0b\x32\x13.iv.lidar.PointXYZI\x12\x11\n\ttype_name\x18\x13 \x01(\t\x12%\n\x0cvel_relative\x18\x14 \x01(\x0b\x32\x0f.iv.lidar.VelXY')
+)
+
+
+
+
+_POINTXYZI = _descriptor.Descriptor(
+  name='PointXYZI',
+  full_name='iv.lidar.PointXYZI',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.lidar.PointXYZI.x', index=0,
+      number=1, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=(1e10000 * 0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.lidar.PointXYZI.y', index=1,
+      number=2, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=(1e10000 * 0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='z', full_name='iv.lidar.PointXYZI.z', index=2,
+      number=3, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=(1e10000 * 0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='i', full_name='iv.lidar.PointXYZI.i', index=3,
+      number=4, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=26,
+  serialized_end=99,
+)
+
+
+_POINTXYZ = _descriptor.Descriptor(
+  name='PointXYZ',
+  full_name='iv.lidar.PointXYZ',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.lidar.PointXYZ.x', index=0,
+      number=1, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=(1e10000 * 0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.lidar.PointXYZ.y', index=1,
+      number=2, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=(1e10000 * 0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='z', full_name='iv.lidar.PointXYZ.z', index=2,
+      number=3, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=(1e10000 * 0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=101,
+  serialized_end=159,
+)
+
+
+_DIMENSION = _descriptor.Descriptor(
+  name='Dimension',
+  full_name='iv.lidar.Dimension',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.lidar.Dimension.x', index=0,
+      number=1, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.lidar.Dimension.y', index=1,
+      number=2, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='z', full_name='iv.lidar.Dimension.z', index=2,
+      number=3, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=161,
+  serialized_end=214,
+)
+
+
+_VELXY = _descriptor.Descriptor(
+  name='VelXY',
+  full_name='iv.lidar.VelXY',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.lidar.VelXY.x', index=0,
+      number=1, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.lidar.VelXY.y', index=1,
+      number=2, type=2, cpp_type=6, label=1,
+      has_default_value=True, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=216,
+  serialized_end=251,
+)
+
+
+_LIDAROBJECT = _descriptor.Descriptor(
+  name='lidarobject',
+  full_name='iv.lidar.lidarobject',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='min_point', full_name='iv.lidar.lidarobject.min_point', index=0,
+      number=1, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='max_point', full_name='iv.lidar.lidarobject.max_point', index=1,
+      number=2, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='centroid', full_name='iv.lidar.lidarobject.centroid', index=2,
+      number=3, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='dimensions', full_name='iv.lidar.lidarobject.dimensions', index=3,
+      number=4, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='position', full_name='iv.lidar.lidarobject.position', index=4,
+      number=5, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='angle', full_name='iv.lidar.lidarobject.angle', index=5,
+      number=6, type=1, cpp_type=5, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='velocity_linear_x', full_name='iv.lidar.lidarobject.velocity_linear_x', index=6,
+      number=7, type=1, cpp_type=5, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='acceleration_linear_y', full_name='iv.lidar.lidarobject.acceleration_linear_y', index=7,
+      number=8, type=1, cpp_type=5, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='timestamp', full_name='iv.lidar.lidarobject.timestamp', index=8,
+      number=9, type=1, cpp_type=5, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='tyaw', full_name='iv.lidar.lidarobject.tyaw', index=9,
+      number=10, type=1, cpp_type=5, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='mnType', full_name='iv.lidar.lidarobject.mnType', index=10,
+      number=11, type=5, cpp_type=1, label=2,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='id', full_name='iv.lidar.lidarobject.id', index=11,
+      number=12, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='behavior_state', full_name='iv.lidar.lidarobject.behavior_state', index=12,
+      number=13, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='score', full_name='iv.lidar.lidarobject.score', index=13,
+      number=14, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='velocity_reliable', full_name='iv.lidar.lidarobject.velocity_reliable', index=14,
+      number=15, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='pose_reliable', full_name='iv.lidar.lidarobject.pose_reliable', index=15,
+      number=16, type=8, cpp_type=7, label=1,
+      has_default_value=False, default_value=False,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='type_probs', full_name='iv.lidar.lidarobject.type_probs', index=16,
+      number=17, type=2, cpp_type=6, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='cloud', full_name='iv.lidar.lidarobject.cloud', index=17,
+      number=18, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='type_name', full_name='iv.lidar.lidarobject.type_name', index=18,
+      number=19, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='vel_relative', full_name='iv.lidar.lidarobject.vel_relative', index=19,
+      number=20, type=11, cpp_type=10, label=1,
+      has_default_value=False, default_value=None,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=254,
+  serialized_end=799,
+)
+
+_LIDAROBJECT.fields_by_name['min_point'].message_type = _POINTXYZ
+_LIDAROBJECT.fields_by_name['max_point'].message_type = _POINTXYZ
+_LIDAROBJECT.fields_by_name['centroid'].message_type = _POINTXYZ
+_LIDAROBJECT.fields_by_name['dimensions'].message_type = _DIMENSION
+_LIDAROBJECT.fields_by_name['position'].message_type = _POINTXYZ
+_LIDAROBJECT.fields_by_name['cloud'].message_type = _POINTXYZI
+_LIDAROBJECT.fields_by_name['vel_relative'].message_type = _VELXY
+DESCRIPTOR.message_types_by_name['PointXYZI'] = _POINTXYZI
+DESCRIPTOR.message_types_by_name['PointXYZ'] = _POINTXYZ
+DESCRIPTOR.message_types_by_name['Dimension'] = _DIMENSION
+DESCRIPTOR.message_types_by_name['VelXY'] = _VELXY
+DESCRIPTOR.message_types_by_name['lidarobject'] = _LIDAROBJECT
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+PointXYZI = _reflection.GeneratedProtocolMessageType('PointXYZI', (_message.Message,), dict(
+  DESCRIPTOR = _POINTXYZI,
+  __module__ = 'object_pb2'
+  # @@protoc_insertion_point(class_scope:iv.lidar.PointXYZI)
+  ))
+_sym_db.RegisterMessage(PointXYZI)
+
+PointXYZ = _reflection.GeneratedProtocolMessageType('PointXYZ', (_message.Message,), dict(
+  DESCRIPTOR = _POINTXYZ,
+  __module__ = 'object_pb2'
+  # @@protoc_insertion_point(class_scope:iv.lidar.PointXYZ)
+  ))
+_sym_db.RegisterMessage(PointXYZ)
+
+Dimension = _reflection.GeneratedProtocolMessageType('Dimension', (_message.Message,), dict(
+  DESCRIPTOR = _DIMENSION,
+  __module__ = 'object_pb2'
+  # @@protoc_insertion_point(class_scope:iv.lidar.Dimension)
+  ))
+_sym_db.RegisterMessage(Dimension)
+
+VelXY = _reflection.GeneratedProtocolMessageType('VelXY', (_message.Message,), dict(
+  DESCRIPTOR = _VELXY,
+  __module__ = 'object_pb2'
+  # @@protoc_insertion_point(class_scope:iv.lidar.VelXY)
+  ))
+_sym_db.RegisterMessage(VelXY)
+
+lidarobject = _reflection.GeneratedProtocolMessageType('lidarobject', (_message.Message,), dict(
+  DESCRIPTOR = _LIDAROBJECT,
+  __module__ = 'object_pb2'
+  # @@protoc_insertion_point(class_scope:iv.lidar.lidarobject)
+  ))
+_sym_db.RegisterMessage(lidarobject)
+
+
+# @@protoc_insertion_point(module_scope)

+ 11 - 0
src/python/cameradecision_signlight_speedcontrol/proto/objectarray.proto

@@ -0,0 +1,11 @@
+syntax = "proto2";
+
+package iv.lidar;
+
+import "object.proto";
+
+message objectarray
+{
+  repeated lidarobject obj = 1;
+  optional double timestamp = 2;
+};

+ 79 - 0
src/python/cameradecision_signlight_speedcontrol/proto/objectarray_pb2.py

@@ -0,0 +1,79 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: objectarray.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from . import object_pb2 as object__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='objectarray.proto',
+  package='iv.lidar',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x11objectarray.proto\x12\x08iv.lidar\x1a\x0cobject.proto\"D\n\x0bobjectarray\x12\"\n\x03obj\x18\x01 \x03(\x0b\x32\x15.iv.lidar.lidarobject\x12\x11\n\ttimestamp\x18\x02 \x01(\x01')
+  ,
+  dependencies=[object__pb2.DESCRIPTOR,])
+
+
+
+
+_OBJECTARRAY = _descriptor.Descriptor(
+  name='objectarray',
+  full_name='iv.lidar.objectarray',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='obj', full_name='iv.lidar.objectarray.obj', index=0,
+      number=1, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='timestamp', full_name='iv.lidar.objectarray.timestamp', index=1,
+      number=2, type=1, cpp_type=5, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=45,
+  serialized_end=113,
+)
+
+_OBJECTARRAY.fields_by_name['obj'].message_type = object__pb2._LIDAROBJECT
+DESCRIPTOR.message_types_by_name['objectarray'] = _OBJECTARRAY
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+objectarray = _reflection.GeneratedProtocolMessageType('objectarray', (_message.Message,), dict(
+  DESCRIPTOR = _OBJECTARRAY,
+  __module__ = 'objectarray_pb2'
+  # @@protoc_insertion_point(class_scope:iv.lidar.objectarray)
+  ))
+_sym_db.RegisterMessage(objectarray)
+
+
+# @@protoc_insertion_point(module_scope)

+ 24 - 0
src/python/cameradecision_signlight_speedcontrol/readme.md

@@ -0,0 +1,24 @@
+sudo apt install python3-numpy
+
+sudo apt install python3-protobuf
+
+
+到src/common/modulecomm目录下新建一个build文件夹
+cd build
+cmake ..
+make
+将生成的modulecommpython.so文件拷贝到本文件夹
+
+
+
+如果需要修改_pb2.py,进入proto文件夹。
+执行:
+protoc *.proto -I=./ --python_out=./
+
+cameraobjectarray_pb2.py里修改cameraobject__pb2的导入方式,加from . 
+from . import cameraobject_pb2 as cameraobject__pb2
+
+objectarray_pb2.py里修改object__pb2的导入方式,加from . 
+from . import object_pb2 as object__pb2
+
+终端运行python3 setup.py build_ext --inplace 可以打包PyModuleCommModule模块,在该模块中加密。

+ 13 - 0
src/python/cameradecision_signlight_speedcontrol/setup.py

@@ -0,0 +1,13 @@
+from setuptools import setup,Extension
+
+setup(
+    ext_modules=[
+        Extension(
+        name='PyModuleCommModule',
+        sources=['PyModuleCommModule.py']
+        )
+    ]
+)
+
+
+#python3 setup.py build_ext --inplace

+ 97 - 0
src/python/vehiclecountdemo/PyModuleCommModule.py

@@ -0,0 +1,97 @@
+
+import threading  
+import time  
+
+import modulecommpython
+import numpy as np 
+import ctypes
+
+
+modulelock = threading.Lock()  
+nThread = 0
+
+class PyModuleComm:
+    def __init__(self,strname):  
+        # 初始化代码... 
+        checklib=ctypes.CDLL('./libchecklicence.so')
+        a=checklib._ZN12Checklicence12CheckLinceseEv()
+        if a != 1:
+            exit(0)
+            
+        print("name: ",strname)
+        self.strmemname = strname
+        self.mbRegister = False
+        global nThread
+        nThread = nThread+1
+        self.mnMode = 0
+        print("nThread = ",nThread)
+        self.obj = modulecommpython.get_ca_object()
+        pass  
+
+    def RegisterRecv(self,call):
+        if self.mbRegister:
+            print(" Have register, can't register other.")
+            return
+        print("Register: ",self.strmemname)
+        self.mpcall = call
+        self.mbRegister = True
+        self.mbRun = True
+        self.mpthread = threading.Thread(target=self.threadrecvdata, args=(self.strmemname,))  
+        self.mpthread.start()
+        print("complete create thread.")
+        self.mnMode = 1
+        self.obj.RegisterRecv(self.strmemname)
+
+    def RegiseterSend(self,nSize,nPacCount):
+        if self.mbRegister:
+            print(" Have register, can't register other.")
+            return
+        print("Register: ",self.strmemname)
+        self.mnsize = nSize
+        self.mnPacCount = nPacCount
+        self.mbRegister = True
+        self.mnMode = 2
+        self.obj.RegisterSend(self.strmemname,nSize,nPacCount)
+    
+    def SendData(self,arr,nsendsize):      
+    #    nrealsize = np.zeros(1, dtype=np.int32)  
+        nrtn = self.obj.SendData(arr,nsendsize)
+  
+    def threadrecvdata(self, arg):  
+        # 这个函数将被线程执行  
+ #       print(f"线程开始执行,参数是 {arg}")  
+        nBuffSize = int(1000)
+        arr = np.zeros(nBuffSize,dtype=np.int8)
+        recvtime = np.zeros(1,dtype=np.int64)
+        nrealsize = np.zeros(1,dtype=np.int32)
+        while 1:
+            nrtn = self.obj.RecvData(arr,nBuffSize,nrealsize,recvtime)
+            if nrtn > 0:
+                self.mpcall(arr,nrtn,recvtime)
+            else:
+                pass
+            if nrtn < 0:
+                nBuffSize = int(nrealsize[0] * 2)
+                arr = np.zeros(nBuffSize,dtype=np.int8)
+            else:
+                time.sleep(0.001)
+            
+        print("threadrecvdata complete.")
+
+    def stop_thread(self):
+        self.mbRun = False
+        self.mpthread.join()
+  
+    def start_thread(self, arg):  
+        # 创建线程对象,target参数指向要在线程中运行的函数  
+        self.mbRun = True
+        self.mpthread = threading.Thread(target=self.my_function, args=(arg,))  
+          
+        # 启动线程  
+        self.mpthread.start()  
+          
+        # 可以在这里添加其他代码,主线程会继续执行  
+        print("主线程继续执行...")  
+  
+        # 如果需要等待线程结束,可以调用 join() 方法  
+        # thread.join()  

+ 80 - 0
src/python/vehiclecountdemo/coco.names

@@ -0,0 +1,80 @@
+person
+bicycle
+car
+motorcycle
+airplane
+bus
+train
+truck
+boat
+traffic light
+fire hydrant
+stop sign
+parking meter
+bench
+bird
+cat
+dog
+horse
+sheep
+cow
+elephant
+bear
+zebra
+giraffe
+backpack
+umbrella
+handbag
+tie
+suitcase
+frisbee
+skis
+snowboard
+sports ball
+kite
+baseball bat
+baseball glove
+skateboard
+surfboard
+tennis racket
+bottle
+wine glass
+cup
+fork
+knife
+spoon
+bowl
+banana
+apple
+sandwich
+orange
+broccoli
+carrot
+hot dog
+pizza
+donut
+cake
+chair
+couch
+potted plant
+bed
+dining table
+toilet
+TV
+laptop
+mouse
+remote
+keyboard
+cell phone
+microwave
+oven
+toaster
+sink
+refrigerator
+book
+clock
+vase
+scissors
+teddy bear
+hair drier
+toothbrush

+ 1 - 0
src/python/vehiclecountdemo/license

@@ -0,0 +1 @@
+d737984cd907d53057feb8c8f6db3d9196923a8fd2a6f514977d94b97f72edc6

+ 1 - 0
src/python/vehiclecountdemo/machineID

@@ -0,0 +1 @@
+91h8884366kk1698h903kl108km9904m

+ 0 - 0
src/python/vehiclecountdemo/proto/__init__.py


+ 28 - 0
src/python/vehiclecountdemo/proto/cameraobject.proto

@@ -0,0 +1,28 @@
+syntax = "proto2";
+
+package iv.vision;
+
+message cameraobject
+{
+  optional int32 id = 1;   
+  optional string type = 2;  
+  optional float con = 3;   
+  optional int32 objmovestate = 4;  
+  optional int32 objawaystate = 5;  
+  optional int32 objcutstate = 6;  
+  optional int32 trajectime = 7;   
+  optional int32 lineid = 8;        
+  optional float w = 9;            
+  optional float h = 10;           
+  optional float Azimuth = 11;     
+  optional float speedx = 12;       
+  optional float speedy = 13;      
+  optional float accelerationx = 14;  
+  optional float accelerationy = 15;  
+  optional float x = 16; 
+  optional float y = 17; 
+  optional float outpointx = 18;  
+  optional float outpointy = 19;   
+};
+
+

+ 195 - 0
src/python/vehiclecountdemo/proto/cameraobject_pb2.py

@@ -0,0 +1,195 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: cameraobject.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='cameraobject.proto',
+  package='iv.vision',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x12\x63\x61meraobject.proto\x12\tiv.vision\"\xcb\x02\n\x0c\x63\x61meraobject\x12\n\n\x02id\x18\x01 \x01(\x05\x12\x0c\n\x04type\x18\x02 \x01(\t\x12\x0b\n\x03\x63on\x18\x03 \x01(\x02\x12\x14\n\x0cobjmovestate\x18\x04 \x01(\x05\x12\x14\n\x0cobjawaystate\x18\x05 \x01(\x05\x12\x13\n\x0bobjcutstate\x18\x06 \x01(\x05\x12\x12\n\ntrajectime\x18\x07 \x01(\x05\x12\x0e\n\x06lineid\x18\x08 \x01(\x05\x12\t\n\x01w\x18\t \x01(\x02\x12\t\n\x01h\x18\n \x01(\x02\x12\x0f\n\x07\x41zimuth\x18\x0b \x01(\x02\x12\x0e\n\x06speedx\x18\x0c \x01(\x02\x12\x0e\n\x06speedy\x18\r \x01(\x02\x12\x15\n\raccelerationx\x18\x0e \x01(\x02\x12\x15\n\raccelerationy\x18\x0f \x01(\x02\x12\t\n\x01x\x18\x10 \x01(\x02\x12\t\n\x01y\x18\x11 \x01(\x02\x12\x11\n\toutpointx\x18\x12 \x01(\x02\x12\x11\n\toutpointy\x18\x13 \x01(\x02')
+)
+
+
+
+
+_CAMERAOBJECT = _descriptor.Descriptor(
+  name='cameraobject',
+  full_name='iv.vision.cameraobject',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='id', full_name='iv.vision.cameraobject.id', index=0,
+      number=1, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='type', full_name='iv.vision.cameraobject.type', index=1,
+      number=2, type=9, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b("").decode('utf-8'),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='con', full_name='iv.vision.cameraobject.con', index=2,
+      number=3, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='objmovestate', full_name='iv.vision.cameraobject.objmovestate', index=3,
+      number=4, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='objawaystate', full_name='iv.vision.cameraobject.objawaystate', index=4,
+      number=5, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='objcutstate', full_name='iv.vision.cameraobject.objcutstate', index=5,
+      number=6, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='trajectime', full_name='iv.vision.cameraobject.trajectime', index=6,
+      number=7, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='lineid', full_name='iv.vision.cameraobject.lineid', index=7,
+      number=8, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='w', full_name='iv.vision.cameraobject.w', index=8,
+      number=9, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='h', full_name='iv.vision.cameraobject.h', index=9,
+      number=10, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='Azimuth', full_name='iv.vision.cameraobject.Azimuth', index=10,
+      number=11, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='speedx', full_name='iv.vision.cameraobject.speedx', index=11,
+      number=12, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='speedy', full_name='iv.vision.cameraobject.speedy', index=12,
+      number=13, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='accelerationx', full_name='iv.vision.cameraobject.accelerationx', index=13,
+      number=14, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='accelerationy', full_name='iv.vision.cameraobject.accelerationy', index=14,
+      number=15, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='x', full_name='iv.vision.cameraobject.x', index=15,
+      number=16, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='y', full_name='iv.vision.cameraobject.y', index=16,
+      number=17, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='outpointx', full_name='iv.vision.cameraobject.outpointx', index=17,
+      number=18, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='outpointy', full_name='iv.vision.cameraobject.outpointy', index=18,
+      number=19, type=2, cpp_type=6, label=1,
+      has_default_value=False, default_value=float(0),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=34,
+  serialized_end=365,
+)
+
+DESCRIPTOR.message_types_by_name['cameraobject'] = _CAMERAOBJECT
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+cameraobject = _reflection.GeneratedProtocolMessageType('cameraobject', (_message.Message,), dict(
+  DESCRIPTOR = _CAMERAOBJECT,
+  __module__ = 'cameraobject_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.cameraobject)
+  ))
+_sym_db.RegisterMessage(cameraobject)
+
+
+# @@protoc_insertion_point(module_scope)

+ 12 - 0
src/python/vehiclecountdemo/proto/cameraobjectarray.proto

@@ -0,0 +1,12 @@
+
+syntax = "proto2";
+
+package iv.vision;
+
+import "cameraobject.proto";
+
+message cameraobjectarray
+{
+  repeated cameraobject obj = 1;
+  optional int64 mstime = 2;
+};

+ 79 - 0
src/python/vehiclecountdemo/proto/cameraobjectarray_pb2.py

@@ -0,0 +1,79 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: cameraobjectarray.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+from . import cameraobject_pb2 as cameraobject__pb2
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='cameraobjectarray.proto',
+  package='iv.vision',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x17\x63\x61meraobjectarray.proto\x12\tiv.vision\x1a\x12\x63\x61meraobject.proto\"I\n\x11\x63\x61meraobjectarray\x12$\n\x03obj\x18\x01 \x03(\x0b\x32\x17.iv.vision.cameraobject\x12\x0e\n\x06mstime\x18\x02 \x01(\x03')
+  ,
+  dependencies=[cameraobject__pb2.DESCRIPTOR,])
+
+
+
+
+_CAMERAOBJECTARRAY = _descriptor.Descriptor(
+  name='cameraobjectarray',
+  full_name='iv.vision.cameraobjectarray',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='obj', full_name='iv.vision.cameraobjectarray.obj', index=0,
+      number=1, type=11, cpp_type=10, label=3,
+      has_default_value=False, default_value=[],
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='mstime', full_name='iv.vision.cameraobjectarray.mstime', index=1,
+      number=2, type=3, cpp_type=2, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=58,
+  serialized_end=131,
+)
+
+_CAMERAOBJECTARRAY.fields_by_name['obj'].message_type = cameraobject__pb2._CAMERAOBJECT
+DESCRIPTOR.message_types_by_name['cameraobjectarray'] = _CAMERAOBJECTARRAY
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+cameraobjectarray = _reflection.GeneratedProtocolMessageType('cameraobjectarray', (_message.Message,), dict(
+  DESCRIPTOR = _CAMERAOBJECTARRAY,
+  __module__ = 'cameraobjectarray_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.cameraobjectarray)
+  ))
+_sym_db.RegisterMessage(cameraobjectarray)
+
+
+# @@protoc_insertion_point(module_scope)

+ 16 - 0
src/python/vehiclecountdemo/proto/rawpic.proto

@@ -0,0 +1,16 @@
+syntax = "proto2";
+
+package iv.vision;
+
+
+message rawpic
+{
+  optional int64 time = 1; // number of milliseconds since 1970-01-01T00:00:00 Universal Coordinated Time
+  optional int32 index = 2;
+  optional int32 type = 3; //类型, 1 mat 2 jpg
+  optional int32 width = 4;
+  optional int32 height = 5;
+  optional int32 elemsize = 6;
+  optional int32 mattype = 7;
+  optional bytes picdata = 8;
+};

+ 118 - 0
src/python/vehiclecountdemo/proto/rawpic_pb2.py

@@ -0,0 +1,118 @@
+# Generated by the protocol buffer compiler.  DO NOT EDIT!
+# source: rawpic.proto
+
+import sys
+_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
+from google.protobuf import descriptor as _descriptor
+from google.protobuf import message as _message
+from google.protobuf import reflection as _reflection
+from google.protobuf import symbol_database as _symbol_database
+# @@protoc_insertion_point(imports)
+
+_sym_db = _symbol_database.Default()
+
+
+
+
+DESCRIPTOR = _descriptor.FileDescriptor(
+  name='rawpic.proto',
+  package='iv.vision',
+  syntax='proto2',
+  serialized_options=None,
+  serialized_pb=_b('\n\x0crawpic.proto\x12\tiv.vision\"\x86\x01\n\x06rawpic\x12\x0c\n\x04time\x18\x01 \x01(\x03\x12\r\n\x05index\x18\x02 \x01(\x05\x12\x0c\n\x04type\x18\x03 \x01(\x05\x12\r\n\x05width\x18\x04 \x01(\x05\x12\x0e\n\x06height\x18\x05 \x01(\x05\x12\x10\n\x08\x65lemsize\x18\x06 \x01(\x05\x12\x0f\n\x07mattype\x18\x07 \x01(\x05\x12\x0f\n\x07picdata\x18\x08 \x01(\x0c')
+)
+
+
+
+
+_RAWPIC = _descriptor.Descriptor(
+  name='rawpic',
+  full_name='iv.vision.rawpic',
+  filename=None,
+  file=DESCRIPTOR,
+  containing_type=None,
+  fields=[
+    _descriptor.FieldDescriptor(
+      name='time', full_name='iv.vision.rawpic.time', index=0,
+      number=1, type=3, cpp_type=2, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='index', full_name='iv.vision.rawpic.index', index=1,
+      number=2, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='type', full_name='iv.vision.rawpic.type', index=2,
+      number=3, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='width', full_name='iv.vision.rawpic.width', index=3,
+      number=4, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='height', full_name='iv.vision.rawpic.height', index=4,
+      number=5, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='elemsize', full_name='iv.vision.rawpic.elemsize', index=5,
+      number=6, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='mattype', full_name='iv.vision.rawpic.mattype', index=6,
+      number=7, type=5, cpp_type=1, label=1,
+      has_default_value=False, default_value=0,
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+    _descriptor.FieldDescriptor(
+      name='picdata', full_name='iv.vision.rawpic.picdata', index=7,
+      number=8, type=12, cpp_type=9, label=1,
+      has_default_value=False, default_value=_b(""),
+      message_type=None, enum_type=None, containing_type=None,
+      is_extension=False, extension_scope=None,
+      serialized_options=None, file=DESCRIPTOR),
+  ],
+  extensions=[
+  ],
+  nested_types=[],
+  enum_types=[
+  ],
+  serialized_options=None,
+  is_extendable=False,
+  syntax='proto2',
+  extension_ranges=[],
+  oneofs=[
+  ],
+  serialized_start=28,
+  serialized_end=162,
+)
+
+DESCRIPTOR.message_types_by_name['rawpic'] = _RAWPIC
+_sym_db.RegisterFileDescriptor(DESCRIPTOR)
+
+rawpic = _reflection.GeneratedProtocolMessageType('rawpic', (_message.Message,), dict(
+  DESCRIPTOR = _RAWPIC,
+  __module__ = 'rawpic_pb2'
+  # @@protoc_insertion_point(class_scope:iv.vision.rawpic)
+  ))
+_sym_db.RegisterMessage(rawpic)
+
+
+# @@protoc_insertion_point(module_scope)

+ 21 - 0
src/python/vehiclecountdemo/readme.md

@@ -0,0 +1,21 @@
+sudo apt install python3-numpy
+
+sudo apt install python3-protobuf
+
+
+到src/common/modulecomm目录下新建一个build文件夹
+cd build
+cmake ..
+make
+将生成的modulecommpython.so文件拷贝到本文件夹
+
+
+
+如果需要修改_pb2.py,进入proto文件夹。
+执行:
+protoc *.proto -I=./ --python_out=./
+
+cameraobjectarray_pb2.py里修改cameraobject__pb2的导入方式,加from . 
+from . import cameraobject_pb2 as cameraobject__pb2
+
+终端运行python3 setup.py build_ext --inplace 可以打包PyModuleCommModule模块,在该模块中加密。

+ 13 - 0
src/python/vehiclecountdemo/setup.py

@@ -0,0 +1,13 @@
+from setuptools import setup,Extension
+
+setup(
+    ext_modules=[
+        Extension(
+        name='PyModuleCommModule',
+        sources=['PyModuleCommModule.py']
+        )
+    ]
+)
+
+
+#python3 setup.py build_ext --inplace

+ 131 - 0
src/python/vehiclecountdemo/vehiclecount.py

@@ -0,0 +1,131 @@
+import numpy as np  
+import time
+import sys 
+import cv2
+
+import proto.cameraobjectarray_pb2 as cameraobjectarray_pb2
+
+
+class VehicleCount:
+    def __init__(self, line_start,line_end,max_track_length,unupdated_timeout,
+                 calculate_range_flag=True,
+                 identification_range=30):  
+        self.prev_time = time.time()  #帧计数器
+        # 定义识别线线的起点和终点坐标
+        self.line_start = line_start  # 起点
+        self.line_end = line_end  # 终点
+        self.counter = 0  # 计数器
+        self.counter_id = 0  # 分配唯一 ID 的计数器
+        self.buffer_tracks = {}  # 保存位置和时间的元组
+        self.crossed_boxes = {}  # 用于存储每个框的交叉状态的字典
+        self.calculate_range_flag = calculate_range_flag   #
+        self.identification_range = identification_range  # 连续框判断误差(像素)
+        self.max_track_length = max_track_length  # 最大轨迹长度
+        self.unupdated_timeout = unupdated_timeout  # 未更新的轨迹存在时间(秒)
+        self.last_updated = {}  # 初始化 last_updated 字典
+
+    def calculate_identification_range(self, y, frame_height, min_range=5, max_range=70):
+        """
+        根据 y 坐标动态计算识别范围。
+        y: 车辆中心的 y 坐标
+        frame_height: 视频帧的高度
+        min_range: 最小识别范围
+        max_range: 最大识别范围
+        """
+        return int(min_range + (max_range - min_range) * (y / frame_height))
+    
+    def estimate_cross_and_count(self,box_id):
+        if len(self.buffer_tracks[box_id]) > 1 and not self.crossed_boxes[box_id]:
+            if (self.buffer_tracks[box_id][-2][0][1] - self.line_start[1]) * (
+                    self.buffer_tracks[box_id][-1][0][1] - self.line_start[1]) <= 0:
+                self.crossed_boxes[box_id] = True  # 更新交叉状态为 True
+                self.counter += 1       
+
+    def remove_old_tracks(self):
+        for id, track in list(self.buffer_tracks.items()):
+            if len(track) > self.max_track_length:  # 如果轨迹过长
+                track.pop(0)  # 移除最旧的位置
+                #if time.time() - track[-1][1] > track_timeout:  #
+                    #del buffer_tracks[id]  # 删除整个轨迹
+
+        for id in list(self.buffer_tracks.keys()):
+            if time.time() - self.last_updated[id] > self.unupdated_timeout:  #
+                del self.buffer_tracks[id]  # 删除整个轨迹
+                del self.last_updated[id]  # 删除对应的时间  
+
+    def count(self,xobjarray : cameraobjectarray_pb2.cameraobjectarray,pic_mat : np):
+        start_time = time.time()  # 记录处理开始时间
+        frame_height = pic_mat.shape[0]  # 获取帧的高度
+        curr_time = time.time()
+        FPS = 1 / (curr_time - self.prev_time)
+        self.prev_time = curr_time
+        FPS_str = 'FPS: %s' % round(FPS, 2)
+        # 绘制边界框和 FPS
+        #cv2.putText(pic_mat, FPS_str, (5, 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (34, 139, 34), 2)   
+        for pobj in xobjarray.obj:
+
+            center = np.array([(pobj.x + 0.5*pobj.w), (pobj.y + 0.5*pobj.h)], dtype=int)
+            cv2.circle(pic_mat, tuple(center), radius=5, color=(0, 255, 255), thickness=-1)
+            cv2.line(pic_mat, tuple(self.line_start), tuple(self.line_end), color=(255, 0, 255), thickness=6)
+
+            # 动态计算识别范围
+            identification_range = self.calculate_identification_range(center[1], frame_height) if self.calculate_range_flag else self.identification_range
+
+            # 检查框 ID 是否已存在于缓冲区中
+            box_id = None
+            for id, past_positions in self.buffer_tracks.items():
+                if len(past_positions) > 0 and np.linalg.norm(
+                        past_positions[-1][0] - center) < identification_range:
+                    box_id = id
+                    break
+
+            if box_id is None:
+                # 分配一个新的 ID为盒子
+                box_id = self.counter_id
+                self.counter_id += 1
+                self.buffer_tracks[box_id] = []
+                self.crossed_boxes[box_id] = False  # 将交叉状态初始化为 False
+
+            self.buffer_tracks[box_id].append((center, time.time()))  # 添加位置和当前时间
+            self.last_updated[box_id] = time.time()  # 更新时间
+
+            # 绘制检测框的ID
+            cv2.putText(pic_mat, f'ID: {box_id}', (center[0], center[1] - 30), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 0), 2)
+
+            # 检查框是否越界
+            self.estimate_cross_and_count(box_id)
+
+            # 如果框被标记为已越线,则绘制文本
+            if self.crossed_boxes[box_id]:
+                cv2.putText(pic_mat, 'crossed', (center[0], center[1] - 20), cv2.FONT_HERSHEY_SIMPLEX, 1,
+                            (0, 255, 0), 2)
+                
+        # delete old tracker
+        self.remove_old_tracks()
+
+        #draw track
+        for track in self.buffer_tracks.values():
+            positions = [pos_time[0] for pos_time in track]  # 提取位置列表
+            if len(positions) > 1:
+                for i in range(1, len(positions)):
+                    start_pos = positions[i - 1]
+                    end_pos = positions[i]
+                    cv2.line(pic_mat, tuple(start_pos), tuple(end_pos), (0, 255, 255), 4)  # 轨迹线条
+
+        counter_str = 'Counter: %s' % self.counter
+        cv2.putText(pic_mat, counter_str, (5, 60), cv2.FONT_HERSHEY_SIMPLEX, 1, (34, 139, 34), 2)  # 将计数器放在框架上
+                
+
+                
+                
+                    
+
+
+    
+    
+
+    
+
+
+
+    

+ 92 - 0
src/python/vehiclecountdemo/vehiclecountmain.py

@@ -0,0 +1,92 @@
+from PyModuleCommModule import PyModuleComm
+import modulecommpython
+import numpy as np  
+import time
+import sys 
+import cv2
+from queue import Queue
+
+import proto.cameraobjectarray_pb2 as cameraobjectarray_pb2
+import proto.rawpic_pb2 as rawpic_pb2
+
+from vehiclecount import VehicleCount
+
+time_objectarray = 0
+msg_cameraobjectarray = cameraobjectarray_pb2.cameraobjectarray()
+
+msg_rawpic = rawpic_pb2.rawpic()
+time_rawpic = 0
+pic_mat = None
+pic_queue = Queue(3)
+
+def cameraobjectarray_callback(arr : np,nsize,time):
+    global msg_cameraobjectarray
+    global time_objectarray
+    sub_arr = arr[0:nsize]
+    databytes = sub_arr.tobytes() #sub_arr.tostring()
+    msg = cameraobjectarray_pb2.cameraobjectarray()
+    msg.ParseFromString(databytes)
+    msg_cameraobjectarray = msg
+    time_objectarray = time
+    length = len(msg_cameraobjectarray.obj)
+    #print("obj size: ",length)
+    pass
+
+
+def rawpic_callback(arr : np,nsize,time):
+    global msg_rawpic
+    global time_rawpic
+    global pic_mat
+    sub_arr = arr[0:nsize]
+    databytes = sub_arr.tobytes() #sub_arr.tostring()
+    msg = rawpic_pb2.rawpic()
+    msg.ParseFromString(databytes)
+    msg_rawpic = msg
+    time_rawpic = time
+    mat = np.zeros((msg_rawpic.height,msg_rawpic.width,3),dtype=np.uint8)
+    buff = np.frombuffer(msg_rawpic.picdata,dtype=np.uint8)
+    mat = cv2.imdecode(buff,cv2.IMREAD_COLOR)
+    # pic_mat = mat
+    pic_queue.put(mat)
+    pass
+
+
+if __name__ == "__main__":  
+    # 初始化一个变量  
+    count = 0
+    count = 3.5/1.5
+    count = int(count)
+    print("count = ",count)  
+
+    mobj = PyModuleComm("vision_objectarray")
+    mobj.RegisterRecv(cameraobjectarray_callback)
+
+    mpic = PyModuleComm("vision_objectimage")
+    mpic.RegisterRecv(rawpic_callback)
+
+
+    # 定义识别线线的起点和终点坐标
+    line_start = np.array([150, 480])  # 起点
+    line_end = np.array([900, 480])  # 终点
+    max_track_length = 30  # 最大轨迹长度
+    unupdated_timeout = 0.1  # 未更新的轨迹存在时间(秒)
+    identification_range = 30  # 连续框判断误差(像素)
+    calculate_range_flag = True
+
+    counter = VehicleCount(line_start,line_end,max_track_length,unupdated_timeout,
+                           calculate_range_flag,identification_range)
+    
+    # 使用while循环,只要count小于10,就继续循环  
+    cv2.namedWindow("pic",cv2.WINDOW_NORMAL)
+    while count < 10:
+        #MakeDecision(md,msg_cameraobjectarray)
+        # if pic_mat is not None:
+        if not pic_queue.empty():
+            pic_mat = pic_queue.get()
+            counter.count(msg_cameraobjectarray,pic_mat)
+            cv2.imshow("pic",pic_mat)
+            if cv2.waitKey(1) & 0xFF == ord("q"):
+                break
+    cv2.destroyAllWindows()
+    print("循环结束!")  
+