openpilot/tools/webcam/README.md

48 lines
1.9 KiB
Markdown
Raw Normal View History

2020-03-26 20:19:47 -06:00
Run openpilot with webcam on PC/laptop
=====================
2020-06-03 13:54:49 -06:00
What's needed:
2020-10-29 17:51:09 -06:00
- Ubuntu 20.04
- Python 3.8.2
2020-06-03 13:54:49 -06:00
- GPU (recommended)
- Two USB webcams, at least 720p and 78 degrees FOV (e.g. Logitech C920/C615)
2020-11-03 20:56:25 -07:00
- [Car harness](https://comma.ai/shop/products/comma-car-harness) with black panda to connect to your car
2020-06-03 13:54:49 -06:00
- [Panda paw](https://comma.ai/shop/products/panda-paw) (or USB-A to USB-A cable) to connect panda to your computer
- Tape, Charger, ...
That's it!
2020-03-26 20:19:47 -06:00
2020-06-03 13:54:49 -06:00
## Clone openpilot and install the requirements
2020-03-26 20:19:47 -06:00
```
2020-06-03 13:54:49 -06:00
cd ~
git clone https://github.com/commaai/openpilot.git
2020-03-26 20:19:47 -06:00
```
2020-06-03 13:54:49 -06:00
- Follow [this readme](https://github.com/commaai/openpilot/tree/master/tools) to install the requirements
- Add line "export PYTHONPATH=$HOME/openpilot" to your ~/.bashrc
2020-06-06 22:21:25 -06:00
- Install tensorflow 2.2 and nvidia drivers: nvidia-xxx/cuda10.0/cudnn7.6.5
2020-06-03 13:54:49 -06:00
- Install [OpenCL Driver](http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/15532/l_opencl_p_18.1.0.015.tgz)
- Install [OpenCV4](https://www.pyimagesearch.com/2018/08/15/how-to-install-opencv-4-on-ubuntu/) (ignore the Python part)
2020-03-27 13:42:05 -06:00
2020-06-03 13:54:49 -06:00
## Build openpilot for webcam
2020-03-26 20:19:47 -06:00
```
2020-06-03 13:54:49 -06:00
cd ~/openpilot
2020-03-26 20:19:47 -06:00
```
2020-06-06 22:21:25 -06:00
- check out selfdrive/camerad/cameras/camera_webcam.cc lines 72 and 146 before building if any camera is upside down
2020-03-26 20:19:47 -06:00
```
USE_WEBCAM=1 scons -j$(nproc)
2020-03-26 20:19:47 -06:00
```
2020-03-27 13:42:05 -06:00
2020-06-06 22:21:25 -06:00
## Connect the hardware
2020-06-03 13:54:49 -06:00
- 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
2020-03-27 13:42:05 -06:00
2020-06-03 13:54:49 -06:00
## GO
2020-03-26 20:19:47 -06:00
```
2020-06-03 13:54:49 -06:00
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
2020-03-26 20:19:47 -06:00
```
2020-06-03 13:54:49 -06:00
- 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!