Closed dbersan closed 3 years ago
It's a long time since I've worked on this, and the set_synchronous_mode.py file is from the original carla repo. On hindsight, I should've separated it better.
In any case, this seems an issue with threading, no? the other scripts I wrote here are all single-threaded, so you might have a more meaningful response if you open an issue in the official carla repo.
If you want a super-hacky and non-ideal solution, you can always wrap a "try" around the sync_mode.tick() and just discard/ignore the data if it does not come by
It's a long time since I've worked on this, and the set_synchronous_mode.py file is from the original carla repo. On hindsight, I should've separated it better.
In any case, this seems an issue with threading, no? the other scripts I wrote here are all single-threaded, so you might have a more meaningful response if you open an issue in the official carla repo.
If you want a super-hacky and non-ideal solution, you can always wrap a "try" around the sync_mode.tick() and just discard/ignore the data if it does not come by
Yes, I used a try/catch to return the last data point. But the issue just didn't happen again, for some reason. Here is my code anyway:
def _retrieve_data(self, sensor_queue, timeout):
while True:
data = None
try:
data = sensor_queue.get(timeout=timeout)
if data.frame == self.frame:
return data
except:
print(f"Data.frame: {data.frame}; self.frame: {self.frame}. Queue empty? {'yes' if sensor_queue.empty() else 'no'}")
return data
Hello!I also encountered this problem, have you solved it? @dhiegomaga
I am running this in a
.bash
file, recording multiple sequences by callingpython carla-dataset-runner/main.py ...
many times, separated bysleep
commands.A sporadic error I am getting, usually on the second run (but not always), is on this line:
It seems all sensor data are tested by the data that satisfies
data.frame == self.frame
is never found and thensensor_queue.get(timeout=timeout)
times out.