- Team Members
- Overview
- Software
- Hardware
- Wiring Diagram
- Assembled Robot
- Final Project Demo
- Results
- Program Structure
- File Descriptions
- How to Run the Program
- Clayton Hoxworth (MAE) [email protected]
- Daniel Cruz (MAE) [email protected]
- Jonathan Cohen (MAE) [email protected]
- Lucca Frey (MAE) [email protected]
We want to create a self parallel-parking robot that:
- Follows a centerline road path (using a specific color).
- With one input, can park in 3 different desired parking spots.
- Continues traveling back and forth along the centerline until this input is given.
The robot also performs U-turns at the ends of the centerline to remain on the path.
- OpenCV: Used to recognize lines while driving and detect specific colored parking spots.
- Custom Motion Control: Predefined motions for entering and exiting parking spots.
- VESC: Used to control RPM (speed) and servo values for precise movements.
We trained parking maneuver motions to both enter and exit the parking spot. RPM and Servo values were tracked and normalized to ensure consistency.
The robot project includes:
- Traxxas 1/10 scale chassis, servo, and tires
- Jetson Nano as our SBC
- OAK-D Lite camera (Fixed-Focus)
- VESC motor controller (which also controlled our steering servo)
- MATEKSYS Servo PDB
- Quectel GNSS/SPG module and board
- LD06 LiDar
- DC-DC Converter
- Anti-Spark Switch with power switch
- XeRun 3660 G2 sensored motor
- Logitech G F710 Wireless Gamepad
- 4S Lipo Battery
Hardware Table
All custom hardware/mounting designs were made on CAD using Fusion360
The robot was able to:
- Successfully travel back and forth along the centerline.
- Perform U-turns at the ends of the line.
- Correctly identify each parking spot using color detection and perform parking maneuvers.
- The robot did not consistently fully enter the parking spots.
- The U-turn radius was slightly larger than desired.
The program is modular and consists of:
- Main Script:
parallel_park.py
– the primary entry point that runs the robot program.
- Line Following:
perform_line_following.py
– controls line following and integrates parking logic.
- Color Detection:
color_detection.py
– detects colored markers in specific regions of the camera frame.
- Maneuver Scripts:
- Found in the motions/ directory (e.g., parking, U-turns).
- Utilities:
- Scripts for steering calculations, cropping frames, logging, and other helper functions.
parallel_park.py
The entry point for the program. It:- Initializes the camera input.
- Starts the line-following process.
- Integrates color detection to trigger parking or maneuver actions.
-
perform_line_following.py
- Handles the line-following logic by processing the camera feed and controlling robot steering.
- Detects colors using
color_detection.py
to determine when to pause or perform parking maneuvers. - Executes motion scripts (e.g., U-turns, parking) when triggered.
-
color_detection.py
- Detects colors in specific regions (top, middle, and bottom rows) of the camera frame.
- Key functions:
detect_color_in_boxes
: Checks for color in specific grid regions.is_color_present_in_row
: Determines if a color exists in a specific row.
-
calculate_steering_offset.py
- Computes the steering offset based on the position of the detected line relative to the center of the frame.
-
get_line_position.py
- Extracts the horizontal position of the detected line for steering adjustments.
-
filter_yellow_line.py
- Filters yellow lines from the camera feed using HSV thresholds.
-
crop_frame.py
- Crops the camera input to focus on relevant regions for line detection.
-
detect_endpoint.py
- Detects endpoints in the line and triggers U-turn execution.
The motions/ directory contains scripts for specific robot behaviors:
U_Turn.py
: Executes a U-turn when an endpoint is detected.Left_Parking.py
andRight_Parking.py
: Handles left and right parking maneuvers.Left_Exit.py
andRight_Exit.py
: Manages exiting maneuvers after parking.
-
control_vals.py
Stores control constants for:- Steering offsets
- RPM values
- Thresholds for detection logic.
-
logger_config.py
Configures logging for debugging and program execution tracking. -
initialize_vesc.py
Initializes and configures the VESC motor controller.
-
test_color_detection.py
A testing script to validate color detection logic. It displays debug windows for:- Regions where color is detected.
- Adjustments to grid positions.
-
adjust_centerline.py
,adjust_spot_bars.py
, andadjust_yellow_line_crop.py
Scripts to fine-tune:- Line detection accuracy.
- Grid positioning for color detection.
-
filter_adj_test.py
andfilter_yellow_test.py
Scripts to test and adjust HSV thresholds for line and color detection.
-
Logs:
line_following.log
: Logs details during line-following execution.main.log
: General execution log.test_color_detection.log
: Logs for testing color detection logic.
-
Recordings:
The recordings/ directory stores outputs such as snapshots or test video recordings.
- Ensure all dependencies are installed:
pip3 install depthai opencv-python numpy
- Run the program
python3 parallel_park.py