Simulator: only send camera frames at rate that they are generated (#30802)

only send frames at rate that they are generated
old-commit-hash: 8017c25f0b2960db13df22295c077fbbd6aa6a07
This commit is contained in:
Justin Newberry
2023-12-19 10:45:07 -08:00
committed by GitHub
parent babf868ddd
commit a3eafc8cd5
4 changed files with 14 additions and 10 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import math
import threading
import multiprocessing
import numpy as np
from abc import ABC, abstractmethod
@@ -65,7 +65,7 @@ class World(ABC):
def __init__(self, dual_camera):
self.dual_camera = dual_camera
self.image_lock = threading.Lock()
self.image_lock = multiprocessing.Semaphore(value=0)
self.road_image = np.zeros((H, W, 3), dtype=np.uint8)
self.wide_road_image = np.zeros((H, W, 3), dtype=np.uint8)