From 479e8e8b7229682e0e2c84d09d2744f64c9d7b19 Mon Sep 17 00:00:00 2001 From: brotter Date: Fri, 29 Nov 2024 14:33:31 +0100 Subject: [PATCH 1/4] add documentation how to configure vehicle images --- .../How to configure vehicle images.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 doc/Configuration/How to configure vehicle images.md diff --git a/doc/Configuration/How to configure vehicle images.md b/doc/Configuration/How to configure vehicle images.md new file mode 100644 index 00000000..dbae5905 --- /dev/null +++ b/doc/Configuration/How to configure vehicle images.md @@ -0,0 +1,51 @@ +# How to configure vehicle images + +> [!IMPORTANT] +> When using your own Anki cars (that are not pre-configured / no matching images exist), you must configure the images to be used in the ui's. + +You can add and use your own vehicle images for displaying vehicles on the car map as well as in the driver ui. + +## Add and configure images for your own real anki cars +The assignment of images to the Anki vehicles is done via the MAC address of the vehicles. +This can be determined through the StaffUi. +There, found or connected vehicles are displayed. + +To display a matching image of the vehicle in the DriverUi, a corresponding image in .webp format must exist in the directory [src\UserInterface\static\images\Real_Vehicles](../../src\UserInterface\static\images\Real_Vehicles). +The name of the image must match the MAC address (without colons ":"). + +> [!NOTE] +> Example: +> MAC address of a vehicle: CE:27:5C:6C:64:6C -> corresponding image: CE275C6C646C.webp + +For the standard Anki vehicles (red and blue), appropriate images are provided, which can be copied and renamed. +Instructions on how to convert .png or .jpeg images to .webp images can be found here. +To ensure that the correct images are used on the virtual track as well, the images to be used must be stored in the configuration. +How this works is explained in the following section. + +## Add and configure images for your virtual race +The images to be used on the virtual track can be configured via the [config_file.json](../../src/config_file.json). +In the virtual_cars_pics section, the images are assigned to the vehicles. +The images must exist in the directory [src\UserInterface\static\images\Virtual_Vehicles](../../src\UserInterface\static\images\Virtual_Vehicles). +It is recommended to use top-down views of the vehicles. +For real vehicles, the assignment is done via the MAC address of the vehicle. + +> [!NOTE] +> Example: +> "CE:27:5C:6C:64:6C": "CE275C6C646C.svg" + +For virtual vehicles, the assignment is done via the ID for the vehicle (Virtual Vehicle x, with x as an integer >0). + +> [!NOTE] +> Example: +> "Virtual Vehicle 1": "VirtualVehicle1.svg" + +In both cases, the name of the image file can be arbitrary, and the format is not specified. +However, the image must have a transparent background. +For the standard Anki cars (red and blue), images are also provided here, which can be used as follows: + +> [!NOTE] +> Example: +> "D1:FF:AF:51:CB:30": "blue.svg", +> "Virtual Vehicle 1": "red.svg" + +Any number of real and virtual vehicles can be configured. From e79227c996f42d5db79ee439ade58b2df70b3fbe Mon Sep 17 00:00:00 2001 From: brotter Date: Fri, 29 Nov 2024 14:35:56 +0100 Subject: [PATCH 2/4] Replace IAV-Distortion with IAV Distortion in description, comments and log messages --- doc/Configuration/README.md | 2 +- doc/UtilityScripts/README.md | 20 +++++++++---------- installer.sh | 4 ++-- readme.md | 18 ++++++++--------- .../CyberSecurityManager.py | 2 +- src/DataModel/Vehicle.py | 2 +- .../ConfigurationHandler.py | 2 +- .../EnvironmentManager.py | 2 +- src/UserInterface/DriverUI.py | 2 +- src/UserInterface/StaffUI.py | 4 ++-- src/VehicleManagement/AnkiController.py | 2 +- src/VehicleManagement/FleetController.py | 2 +- src/VehicleManagement/VehicleController.py | 2 +- .../BehaviourController.py | 2 +- src/install.sh | 12 +++++------ src/main.py | 4 ++-- src/quit.sh | 2 +- src/restart_IAV-Distortion.sh | 6 +++--- src/setup.py | 2 +- src/update.sh | 2 +- .../VehicleManagement_SystemTest.py | 2 +- .../VehicleManagement/AnkiController_Test.py | 2 +- .../VehicleManagement/FleetController_Test.py | 2 +- 23 files changed, 50 insertions(+), 50 deletions(-) diff --git a/doc/Configuration/README.md b/doc/Configuration/README.md index 93a58d3e..b88e79eb 100644 --- a/doc/Configuration/README.md +++ b/doc/Configuration/README.md @@ -1,6 +1,6 @@ # Configuration File There are a bunch of parameters that can be configured in the [config_file.json](../../src/config_file.json). -The config_file.json is a json file that includes all configurable parameters for IAV-Distortion. +The config_file.json is a json file that includes all configurable parameters for IAV Distortion. The json is structured according to different main topics which include the corresponding parameters. These parameters will be described in the following. diff --git a/doc/UtilityScripts/README.md b/doc/UtilityScripts/README.md index fcaa04bf..0fbdf766 100644 --- a/doc/UtilityScripts/README.md +++ b/doc/UtilityScripts/README.md @@ -16,12 +16,12 @@ To be able to run all of the following scripts properly the following programs n >This script requires an active internet connection and *git* installed on the system. This script serves as a sort of installer. -It can be downloaded and run on the target system to obtain IAV-Distortion from GitHub and install it subsequently. +It can be downloaded and run on the target system to obtain IAV Distortion from GitHub and install it subsequently. The script performs the following tasks: -1. Checks if a folder named "IAV-Distortion" already exists and asks if it should be used for installation. (**WARNING:** All data within this folder will be overwritten!) +1. Checks if a folder named "IAV Distortion" already exists and asks if it should be used for installation. (**WARNING:** All data within this folder will be overwritten!) If no such folder exists or if the existing one should not be used for installation, it asks for the desired installation path. If multiple such folders exist, an additional warning is issued. -2. Queries which branch from the IAV-Distortion repository should be used. +2. Queries which branch from the IAV Distortion repository should be used. 3. Clones the desired branch from the repository. 4. Makes utility scripts in /src directory executable. 5. Optionally: Executes the installation script (refer to install.sh). @@ -30,20 +30,20 @@ If multiple such folders exist, an additional warning is issued. >[!IMPORTANT] >This script requires an active internet connection. -This script undergoes the process to establishing all necessary preconditions and requirements to properly run IAV-Distortion. +This script undergoes the process to establishing all necessary preconditions and requirements to properly run IAV Distortion. The script accomplishes the following tasks: 1. Configures the password for the StaffUI. 2. Execute *get_dependencies.sh* to install pipenv and download external resources -3. Creates a Desktop Item, from which IAV-Distortion can be initiated. +3. Creates a Desktop Item, from which IAV Distortion can be initiated. 4. Makes the remaining utility scripts in the /src directory executable. -5. Checks for configured autostarts of other installations of IAV-Distortion and gives a warning if some were found. +5. Checks for configured autostarts of other installations of IAV Distortion and gives a warning if some were found. 6. Optionally configures the program's auto-start feature (using a cron job). ### update.sh >[!IMPORTANT] >This script requires an active internet connection. -This script will update IAV-Distortion by discard all local changes and pulling the latest verion of the installed branche. Add files like images of cars won't be affected. +This script will update IAV Distortion by discard all local changes and pulling the latest verion of the installed branche. Add files like images of cars won't be affected. Afterwards *get_dependencies.sh* is executed to update external resources. ### get_dependencies.sh @@ -53,7 +53,7 @@ Afterwards *get_dependencies.sh* is executed to update external resources. This script installs the virtual pipenv environment and will download further further required external resources (such as JavaScript libraries). ### run_IAV-Distortion.sh -This script will run IAV-Distortion in it's virtual pipenv environment. +This script will run IAV Distortion in it's virtual pipenv environment. ### quit.sh This script will identify running processes of main.py and terminate them. @@ -65,7 +65,7 @@ This script will identify running processes of main.py and terminate them. This script will immediately restart the host system. ### restart_IAV-Distortion.sh -Restart IAV-Distortion by first terminating the running instances using *quit.sh* afterwards restart IAV-Distortion using *run_IAV-Distrotion.sh*. +Restart IAV Distortion by first terminating the running instances using *quit.sh* afterwards restart IAV Distortion using *run_IAV-Distrotion.sh*. ### shutdown_system.sh -Terminate all running instances of IAV-Distortion and shutdown the host system. +Terminate all running instances of IAV Distortion and shutdown the host system. diff --git a/installer.sh b/installer.sh index 3f4ed8fb..76db5e58 100644 --- a/installer.sh +++ b/installer.sh @@ -66,13 +66,13 @@ then # dir=$(dirname "$dir") echo "$repo_name will be cloned to: $dir" else - echo -e "\033[0;33m Please make sure that you have no duplicates of IAV-Distortion running in parallel.\033[0m" + echo -e "\033[0;33m Please make sure that you have no duplicates of IAV Distortion running in parallel.\033[0m" request_directory fi elif [[ $copy_exists -gt 1 ]] then - echo -e "\033[0;33mMultiple directories named IAV_Distortion have been found. Please make sure that you have no duplicates of IAV-Distortion running in parallel.\033[0m" + echo -e "\033[0;33mMultiple directories named IAV_Distortion have been found. Please make sure that you have no duplicates of IAV Distortion running in parallel.\033[0m" for copy in $existing_copies do echo $copy diff --git a/readme.md b/readme.md index ae65231a..aa9ddd93 100644 --- a/readme.md +++ b/readme.md @@ -1,15 +1,15 @@ -# IAV-Distortion +# IAV Distortion ## About the project -The IAV-Distortion project is an interactive and educational showcase designed to demonstrate the need of automotive cybersecurity in a playful, engaging manner. +The IAV Distortion project is an interactive and educational showcase designed to demonstrate the need of automotive cybersecurity in a playful, engaging manner. This project leverages the fun experience of the Anki Overdrive race track, but with an added twist - your car can be hacked. Our primary objective is to highlight the potential impacts of hacking attacks on vehicles, an increasingly relevant issue as technology becomes more integrated into the automotive industry. -The IAV-Distortion project is an ideal exhibit for trade fairs or other similar events, attracting attendees with its unique blend of technology and entertainment. +The IAV Distortion project is an ideal exhibit for trade fairs or other similar events, attracting attendees with its unique blend of technology and entertainment. It thereby acts as a crowd-puller due to its exciting premise and the opportunity it offers for audience interaction. Through this initiative, we aspire to make the sometimes daunting world of cybersecurity accessible to a wider audience, fostering understanding and engagement. -IAV-Distortion concept illustration +IAV Distortion concept illustration ## Getting Started ### Prerequisites @@ -64,7 +64,7 @@ The list shows which player controls which vehicle. If one of the fields is none Aside from that the different hacking scenarios can be activated for the cars assigned to a player. Therefore chose the scenario for the car you want to apply the effect to, as soon as scenario is preselected the 'Set Scenario' button becomes active and can be used to apply the effect to the vehicle. -IAV-Distortion staff ui +IAV Distortion staff ui Additional to the controls for the game itself, some system configurations and functions can be accessed by switching to the 'Configuration' tab. Here the system can be updated to the latest version available in the repository (of the installed branch) or functions like restarting IAV Distortion, the whole system (Raspberry Pi) or shutting down the system can be accessed. @@ -75,7 +75,7 @@ Additionally, it is now also possible to start an initialization drive with a re > - These functions (Update, Restart IAV Distortion, Restart System and Shutdown System) are only available on Unix like systems. > - Running an update requires internet connection. -IAV-Distortion staff ui - configuration - system control +IAV Distortion staff ui - configuration - system control ### Driver UI The driver ui can be accessed via [<system_iP>:5000/driver](). @@ -85,7 +85,7 @@ The slider on the left controls the speed. With the buttons on the right the lanes can be changed or a u-turn can be performed. Player controlling a virtual car will get a top down view of the controlled vehicle (as displayed on the [virtual track](#Virtual-Racetrack)). -IAV-Distortion driver ui +IAV Distortion driver ui > [!NOTE] > To performe a lane change or a u-turn the slider as to be released. @@ -104,7 +104,7 @@ The virtual and real cars are shown on a virtual racetrack. The virtual racetrack can be accessed via [<system_iP>:5000/car_map](). The virtual track must be defined before the start of the game. Currently, this is done through an initialization drive on the real track with a real vehicle. -IAV-Distortion virtual racetrack +IAV Distortion virtual racetrack