openpilot
openpilot copied to clipboard
tools/sim: Implement `MetaDrive` simulator
trafficstars
Description
Add MetaDrive simulator.
Runs at 30 FPS on 1928 X 1208 inputs on an iGPU (Ryzen 6850H - Laptop).
- Faster (30 FPS), just the openpilot screen: https://www.youtube.com/watch?v=paVD-laxbcY
- Slower (14 FPS), with the render screen: https://www.youtube.com/watch?v=amLu5dloVaI
We disable render screen.
Misc notes:
- Refactored
bridge.pyinto cleanSimulatorBridgeabstraction that shares common logic betweenCarlaBridgeandMetaDriveBridge - Monkey patches
MetaDrivemethods for improved performance - We have to force
WideCameraOnlyfor better performance. I particular, we have to run inExperimentalMode.
Verification Adding an integration test similar to carla simulator's
First part of: https://github.com/commaai/openpilot/issues/27284
Next steps:
- Implement streaming img/obs through Docker? (if openpilot UI already spawns from inside Docker, we don't need to)
- More e2e tests (https://github.com/commaai/openpilot/issues/26215)