amansinha / testpilot

A minimally invasive fork of Comma AI's OpenPilot 0.5 designed for synchronous simulation environments
MIT License
15 stars 6 forks source link

Use a USB webcam to feed video instead of Carla #2

Closed kaishijeng closed 4 years ago

kaishijeng commented 4 years ago

Just curious whether testpilot can be used with a usb webcam video feed instead of Carla simulator. Main purpose is to test lane detection and trajectory prediction of openpilot.

Thanks,

travelbureau commented 4 years ago

Sure see the step function here: https://github.com/Trustworthy-AI/testpilot/blob/master/testpilot/testpilot.py replace the carla image with the image from your webcam. You may first want to make sure OpenPilots calibration etc is initialized, see the startup behavior in demo.py

travelbureau commented 4 years ago

Make sure that you don't alter the resolution and that you use the encoding (to bmp) that we suggest. If you change those things you will need to dig into code on the openpilot side. All this should be solvable with appropriate crop and scale. Keep in mind that if you camera params differ significantly from ours that transformation of detections in image space back to R^3 may be inaccurate.