Skip to content

Commit

Permalink
CARLA: fix setting camera EOF (commaai#24034)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
jackhong12 and adeebshihadeh authored Mar 25, 2022
1 parent 8af20af commit db93275
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/sim/bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def cam_callback(self, image):
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)
Expand Down

0 comments on commit db93275

Please sign in to comment.