carla-simulator / carla

Open-source simulator for autonomous driving research.
http://carla.org
MIT License
11.43k stars 3.71k forks source link

Actor IDs not replicated in replay of a recorded simulation episode #7182

Open ajdroid opened 9 months ago

ajdroid commented 9 months ago

CARLA version: 0.9.13 Platform/OS: Both Linux and Windows Problem you have experienced:
When you record a simulation and then collect instance segmentation sensor outputs during replay, actor IDs are not replicated in subsequent replays.

What you expected to happen: The actor IDs should be the same across replays of the same recording!

Steps to reproduce:

  1. Record a Carla episode from the simulator with multiple actors.
  2. Replay the recorded sim episode from step 1 and record instance segmentation images.
  3. Replay the recorded sim episode from step 1 and record instance segmentation images (again).
  4. The output instance segmentations are not the same in step 2 and 3 because the actor IDs in the replay are not the same!

Other information (documentation you consulted, workarounds you tried): A similar question has been asked before and it has accompanying image examples: https://github.com/carla-simulator/carla/discussions/6504 We are using DReyeVR but this same issue is present in the underlying CARLA.

duong2000x10 commented 7 months ago

I experienced the same issue. I believe the problem comes from recreating actors with desired IDs. The replayer uses the IDs recorded during recording, while the instance segmentation uses the original IDs of actors when created. Since I only needed to match the two IDs, I was able to solve this by saving the ID when the actor was first created and finding the corresponding ID after it changed to the desired ID.