CARLA: fix setting camera EOF (#24034)

* Fix Openpilot in Carla isn't accelerating

The scalars of the timestamp are different in real-world and simulation,
which will cause an infinite loop in selfdrive/modeld/modeld.cc.

* Set eof based on the frame ID

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* remove global

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
pull/24009/merge
Jack Huang 2022-03-26 04:45:08 +08:00 committed by GitHub
parent 8af20af66d
commit db93275d87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -94,7 +94,7 @@ class Camerad:
yuv_cl = cl_array.empty_like(rgb_cl)
self.krnl(self.queue, (np.int32(self.Wdiv4), np.int32(self.Hdiv4)), None, rgb_cl.data, yuv_cl.data).wait()
yuv = np.resize(yuv_cl.get(), np.int32(rgb.size / 2))
eof = self.frame_id * 0.05
eof = int(self.frame_id * 0.05 * 1e9)
# TODO: remove RGB send once the last RGB vipc subscriber is removed
self.vipc_server.send(VisionStreamType.VISION_STREAM_RGB_ROAD, img.tobytes(), self.frame_id, eof, eof)