carla-simulator / leaderboard

CARLA Autonomous Driving leaderboard
MIT License
164 stars 77 forks source link

Make sensor interface more robust #177

Closed cmpute closed 4 months ago

cmpute commented 5 months ago

Two improvements are added:

  1. When the Carla server is in a remote location, the sensor frames sometimes come later than tick result. This PR adds a history buffer that allows getting older data.
  2. Change queue.get() to queue.get_nowait() to prevent it blocking other threads.

This change is Reviewable

glopezdiest commented 5 months ago

Hey, when you refer to

This PR adds a history buffer that allows getting older data.

do you mean that you get data from older frames? Because that is precisely what the queue is there to prevent

cmpute commented 5 months ago

It can get data from older frames, but it's still ensured to get data with matched frame id. During my test, sometimes the get_data() method tries to get data older in the queue, while the previous data was already popped. Not sure why though.

glopezdiest commented 5 months ago

During my test, sometimes the get_data() method tries to get data older in the queue, while the previous data was already popped.

I haven't seen this issue, do you have any reliable way to reproduce it?

In any case, the solution wouldn't be to get data from an older frames, because it goes against the objective of the queue, which is to ensure that the agents always receive the sensors data for that frame.

cmpute commented 5 months ago

It's hard to reproduce this, it only happens with Carla and client running on two specific computers during my tests.

glopezdiest commented 4 months ago

Okay, we'll keep that in mind, but I'm closing this PR as mentioned before, it goes against the idea of the sensor barrier.