openpilot/tools/webcam
Adeeb d9bf9f0a40
Enable more flake8 checks (#1602)
* enable some more flake8 checks

* some more quick ones

* bump opendbc

* e401

* e711 e712

* e115 e116

* e222

* e301

* remove that

* e129

* e701 e702

* e125 e131

* e227

* e306

* e262

* W503

* e713

* e704

* e731

* bump opendbc

* fix some e722
2020-05-30 20:14:58 -07:00
..
README.md update OpenCL Driver 16.1 > 18.1 (#1524) 2020-05-21 12:03:30 -07:00
accept_terms.py Enable more flake8 checks (#1602) 2020-05-30 20:14:58 -07:00
front_mount_helper.py Running pre-commit in CI (#1590) 2020-05-28 15:40:48 -07:00
warp_vis.py Running pre-commit in CI (#1590) 2020-05-28 15:40:48 -07:00

README.md

Run openpilot with webcam on PC/laptop

What's needed:

  • Ubuntu 16.04
  • Python 3.7.3
  • GPU (recommended)
  • Two USB webcams, at least 720p and 78 degrees FOV (e.g. Logitech C920/C615)
  • Car harness w/ black panda (or the outdated grey panda/giraffe combo) to connect to your car
  • Panda paw (or USB-A to USB-A cable) to connect panda to your computer
  • Tape, Charger, ...
    That's it!

Clone openpilot and install the requirements

cd ~  
git clone https://github.com/commaai/openpilot.git  
  • Follow this readme to install the requirements
  • Add line "export PYTHONPATH=$HOME/openpilot" to your ~/.bashrc
  • You also need to install tensorflow 2.2 and nvidia drivers: nvidia-xxx/cuda10.0/cudnn7.6.5
  • Install OpenCL Driver
  • (Note: the code assumes cl platforms order to be 0.GPU/1.CPU when running clinfo; if reverse, change the -1 to -2 in selfdrive/modeld/modeld.cc#L130; helping us refactor this mess is encouraged)
  • Install OpenCV4 (ignore the Python part)

Build openpilot for webcam

cd ~/openpilot  
  • check out selfdrive/camerad/cameras/camera_webcam.cc line72&146 before building if any camera is upside down
scons use_webcam=1  
touch prebuilt  

Connect the hardwares

  • Connect the road facing camera first, then the driver facing camera
  • (default indexes are 1 and 2; can be modified in selfdrive/camerad/cameras/camera_webcam.cc)
  • Connect your computer to panda

GO

cd ~/openpilot/tools/webcam  
./accept_terms.py # accept the user terms so that thermald can detect the car started  
cd ~/openpilot/selfdrive  
PASSIVE=0 NOSENSOR=1 WEBCAM=1 ./manager.py  
  • Start the car, then the UI should show the road webcam's view
  • Adjust and secure the webcams (you can run tools/webcam/front_mount_helper.py to help mount the driver camera)
  • Finish calibration and engage!