Road sign pose estimation for autonomous vehicles.
- Cmake
- Python 3.12+ (You probably will be able to get away with an older version of Python, but I've been developing on 3.12. pip is also required.)
- Git
- CP210x USB to UART Bridge VCP Drivers
- PyTorch (Ultralytics will automatically install PyTorch but installing manually is recommended)
- Ultralytics (Ultralytics will automatically be installed by setup scripts)
git clone --recursive https://github.com/NathanQ2/HybridStereoAutonomousVehicleSystem.git
A virtual environment is generally recommended to prevent package version conflicts with other projects.
Note: on Linux, you may need to install the python venv package. (Debian Ex: sudo apt install python3.10-venv
)
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install python[VERSION]-venv
python3 -m venv venv
The CP210x USB to UART Bridge VCP Drivers are required to communicate with the LiDAR over USB.
cd HybridStereoAutonomousVehicleSystem
cd vendor/RP_LiDAR_Interface_Cpp
mkdir build
cd build
cmake ..
cmake --build .
cd ../../../
python3 -m pip install -r requirements.txt
At the moment, training configuration parameters can be edited in the train.py file. I trained with epochs=1000, device=[0], batch=-0.90
and got alright results.
python3 src/test/train.py
7 - Run the main.py File!
python3 src/main/main.py [lidar com port Ex: com3]
python3 src/main/main.py [lidar com port Ex: /dev/ttyUSB0]
python3 src/main/main.py [lidar com port Ex: /dev/ttySLAB_USBtoUART]
I chose to use two generic usb webcams in a stereo configuration with a baseline of ~190.5 millimeters. This allows us to do basic depth estimation using the difference between the two images. Camera calibration constants can be found in the rightCameraProperties.json and the leftCameraProperties.json files respectively. The other json files were generated by calibdb.net. I've also chosen to use a SLAMTEC RP LiDAR A1 rotating LiDAR for more accurate depth perception when available.
Sign detection is done using a pre-trained YOLOv8 model for each camera.