End-to-end object detection using Raspberry Pi 4B / 3B+
Install
Usage
File Details
Bill Of Materials
Troubleshooting
- Clone this repository
git clone https://github.com/RootLeo00/robot-wheelly-object-detection.git
- Download requirements
cd robot-wheelly-object-detection
chmod +x setup.sh
./setup.sh
- Start pigpiod daemon
sudo pigpiod
- Start detection
python detect.py
├── test
│ └── testservo.py - a test to understand if servo is working
│ └── testsonar.py - a test to understand if sonar is working
│ └── testwheels.py - a test to understand if motors, wheels and h-bridge are working
|
|
├── detect.py - file with main that runs the program
├── efficientdet_lite0.tflite - pretrained model using EfficientDet0 neural network
├── efficientdet_lite0_edgetpu.tflite - pretrained model using EfficientDet0 neural network to use with EdgeTPU
├── requirements.txt - file with the names of the python modules to download
├── servo.py - class with Servo functions
├── setup.sh - file to run to download tflite models and requirements
├── sonar.py - class with Sonar functions
├── utils.py - utilities, such as function visualize
├── wheels.py - class with functions to control motors and wheels
- Raspberry PI 4B
- 2 Trolley Chassis
- 4 Micro DC Motor (Geared) - 90 RPM (6-12V)
- 4 wheels
- L298N Dual H-Bridge Motor Controller
- Ultrasonic Sensor - HC-SR04 (Sonar)
- Jumper wires MM / FM / FF
- USB-C wire
- Cooling Fan
- Power Bank 5200mAh
- 4 batteries AA (1.5 V)
- Raspberry Pi Camera Module 1.3
- Micro Servo 9G
- Camera not found
- Make sure that you have enabled camera interface on Raspberry Pi, through command:
sudo raspi-config
- Make sure your system is detecting camera. Try running:
You should get back
vcgencmd get_camera
supported=1 detected=1
, indicating that the camera is detected and supported by the operating system. If you getdetected=0
, then the camera is not being seen by the operating system. You can try to force OS to auto detect camera by modyfing boot configuration:Write somewhere on file:sudo vim /boot/config.txt
Restart systemcamera_auto_detect=1
reboot
- detect.py use deafult video device on
/dev/video0
, if you want to change to another (e.g./dev/video1
), you have to launch the program passing the--cameraId
argument. Example:
python detect.py --cameraId=1
-
Raspberry is slow on detect the object
This is totally normal. If you want to have a faster and more accurate detection, you can use EdgeTPU (e.g. Coral Accelerator) or another type of board
-
Wheels, sonar or servo don't work
Try to run their specific tests. You can find the tests in
/test
folder.