mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-12 21:02:13 +08:00
Fix UI Respring
This commit is contained in:
@@ -10,6 +10,7 @@ cdef class CLContext:
|
||||
|
||||
cdef class VisionBuf:
|
||||
cdef cppVisionBuf * buf
|
||||
cdef object _owner
|
||||
|
||||
@staticmethod
|
||||
cdef create(cppVisionBuf*)
|
||||
cdef create(cppVisionBuf*, object)
|
||||
|
||||
@@ -30,11 +30,15 @@ cpdef enum VisionStreamType:
|
||||
|
||||
cdef class VisionBuf:
|
||||
@staticmethod
|
||||
cdef create(cppVisionBuf * cbuf):
|
||||
cdef create(cppVisionBuf * cbuf, object owner):
|
||||
buf = VisionBuf()
|
||||
buf.buf = cbuf
|
||||
buf._owner = owner
|
||||
return buf
|
||||
|
||||
def __dealloc__(self):
|
||||
self._owner = None
|
||||
|
||||
@property
|
||||
def data(self):
|
||||
return np.asarray(<cnp.uint8_t[:self.buf.len]> self.buf.addr)
|
||||
@@ -155,7 +159,7 @@ cdef class VisionIpcClient:
|
||||
buf = self.client.recv(&self.extra, timeout_ms)
|
||||
if not buf:
|
||||
return None
|
||||
return VisionBuf.create(buf)
|
||||
return VisionBuf.create(buf, self)
|
||||
|
||||
def connect(self, bool blocking):
|
||||
return self.client.connect(blocking)
|
||||
|
||||
Reference in New Issue
Block a user