This code repository is part of Olin College of Engineering's 2023-2024 Santos-Volpe SCOPE project.
The purpose of this code is to calculate the blind zone area of a vehicle, given a dataset of nearest visible points (NVPs) for that vehicle.
- Save NVP data in a csv file. The data should be in cartesian coordinates, formatted into two columns labeled
x (ft)
andy (ft)
. - Add the csv file into the
Data
folder located in the root level of this repository. - See the following section for loading the data.
Add code to or modify the following files and functions to get a visualization of your NVPs and a value for the blind zone area.
-
In
data_processing.py
, modify the functionload_data
.-
In this function, there are code blocks with structure similar to the following. These are used to load and format NVP data from a csv file and compare them. Modify this function as needed to load the correct datasets. An example template is shown below; replace any all-caps variables with your own.
# load NVPs DATA_raw = pd.read_csv(DATA_FILEPATH) # extract data from correct columns DATA_nvps = DATA_raw[["x (ft)", "y (ft)"]].to_numpy() # append columns with polar coordinates DATA_nvps = np.concatenate((DATA_nvps, cart_to_polar(DATA_nvps)), axis=1) # sort by angle - largest to smallest DATA_nvps = DATA_nvps[DATA_nvps[:, 3].argsort()[::-1]]
Note: More complex data filtering can be done; see pandas documentation or other code blocks in this function for more examples.
-
At the end of this function, modify the variable
datasets
to include only the datasets of interest.
-
-
In
compare_nvp_area.py
modify the functionmain
.-
Modify the variable
labels
so that the number and order of the labels match the number and order of the datasets returned fromload_data
. -
If there is a ground truth dataset included in the list of datasets, make sure that its label contains the string
"Ground Truth"
to ensure that it is recognized as a ground truth dataset.
-
-
Depending on your Python version, run one of the following commands in the terminal at the root level of this repository to run the code.
python3 compare_nvp_area.py
python compare_nvp_area.py