Skip to content

DIT113-V22/group-01

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crushers #1 Arduino Build Status Android Build Status

Crusher's Car Crash Course

A group of 6 like-minded people ready to tackle any challenge!
For more info on how we tackle the challenge, have a look at our wiki!

🖼 Project Idea Presentation

We are proud to present our app Crusher's Crash Course to you:
https://www.youtube.com/watch?v=sFfU1-JhVWo

Table of Contents

  1. Introduction
  2. Installation Manual
  3. How to use our mobile app
  4. Learn more about our app

Introduction

What we are going to make

Crushers is dedicated to prepare you to crush the test, the theoretical drivers license test that is. We are going to do so by providing an app which quizes you on the traffic laws, signs, and scenarios. Our app will provide you with explanations, visual illustrations, and a hands on manual driving mode to give you the full experience and prepare you like you have never before been prepared for a test.

Why we will make it

The simple reason why we assigned ourselves with this mission is the fail rate for the drivers license exam, theory and driving. Keeping calm and focused in a busy and noisy environment as the road, especially within cities, can be difficult and leads to accidents yearly. Some accidents, however, could be mitigated through better knowledge of driving theory. To date most apps focus on the theoretical exam, but our goal is to combine the theory with visual illustrations showing why a certain traffic law/sign is necessary and a manual driving mode in a virtual city to also train you for the driving test.

What problem it solves

Fail rate of drivers license exams in Sweden (2021)

59% fail the theory test and 52% fail the driving test

source: https://korkortonline.se/en/facts/statistics/

How we are going to make it

To accomplish our goal, we will create a remotely accessible api for the car, provide our end users with an android app, and lastly create a city environment for the emulator for the manual driving and scenario demonstrations. The main focus for the project will lie on the app, and depending on the time available at the end we have some cool ideas for the emulators city environment.

What kind of technology we are going to use

Component Technologies
Car controller Arduino, C++, smartcar shield
Car - App communication MQTT
App Android, Java
City environment SMCE, Blender, etc.

Installation Manual

Pre-requisites

  • Operating System Requirements (Laptop / Desktop)

    • Windows: 10 or newer
    • MAC: OS Big Sur or newer
    • Linux: Ubuntu 18.04 or newer
  • Operating System Requirements (Smartphone)

    • Android: pie (9.0) or newer
  • Hardware Requirements

    We strongly recommend a computer fewer than 5 years old

    • Processor: Minimum 1 GHz; Recommended 2GHz or more
    • Ethernet connection: (LAN) OR a wireless adapter (Wi-Fi)
    • Hard Drive: Minimum 32 GB; Recommended 64 GB or more
    • Memory (RAM): Minimum 1 GB; Recommended 4 GB or above
    • Sound card w/speakers

Installation Procedure

  1. We require an MQTT broker in order to be able to drive via app. There are a variety of MQTT brokers to choose from, however we choose Mosquitto for our needs.

    • What exactly is an MQTT broker?
      It is a software running on a computer. it could be any computer, from raspberry pi to a pc to a server. Broker is available as either open-source or proprietary with extra features added on. Broker acts like a post-office, where instead a device sending a message to or getting a message from another device directly. They send to post- office (broker) and then it is forwarded to everyone that needs that message.

    • Why do we need a broker?
      We will need a broker to connect the app to the SMCE so we can practice driving.

    • How may a Mosquitto broker be set up?
      Here's a clear explanation for how to download Mosquitto. Choose your operating system and follow the instructions:Download Mosquitto

  2. We need to download SMCE (the car environment), which will allow you to practice and improve your skills.

  3. Find our project in the current release

Installation Procedure (for developers)

  1. As a developer, you must first download and install SMCE, a MQTT broker, as described here
  2. Download and Install JDK 11
    • 2.1. Go to link. Click on JDK Download for Java based on your operating system download JDK 11 latest version.
    • 2.2. Once the Java JDK 11 download is complete, run the exe for install JDK. Click Next.
    • 2.3. Select the PATH to install Java in Windows. You can leave it Default. Click next.
    • 2.4. Once you install Java in windows, click Close.
    • Installation for JDK here is for Windows. If you are using a different operating system, go here for Mac and here for Ubuntu.
  3. Set environment variables
    • 3.1. Right Click on the My Computer and Select the properties
    • 3.2. Click on advanced system settings
    • 3.3. Click on Environment Variables to set Java runtime environment
    • 3.4. Click on new Button of User variables
    • 3.5. Type PATH in the Variable name.
    • 3.6. Copy the path of bin folder which is installed in JDK folder.
    • 3.7. Paste Path of bin folder in Variable value. Click on OK Button.
    • 3.8. You can set CLASSPATH in a similar way.
    • 3.9. Click on OK button
  4. Download and Install Android Studio
    • 4.1. To download the Android Studio, visit the official Android Studio website in your web browser.
    • 4.2. When you have finished downloading Android Studio, double click on the downloaded "Android Studio-ide.exe" file.
    • 4.3. "Android Studio Setup" will appear on the screen and click "Next" to proceed.
    • 4.4. Select the components that you want to install and click on the "Next" button.
    • 4.5. Now, browse the location where you want to install the Android Studio and click "Next" to proceed.
    • 4.6. Choose a start menu folder for the "Android Studio" shortcut and click the "Install" button to proceed.
    • 4.7. After the successful completion of the installation, click on the "Next" button.
    • 4.8.Click on the "Finish" button to proceed.
    • 4.9. The welcome screen for Android Studio will now appear on the screen.
    • Installation for Android Studio here is for Windows. If you are using a different operating system, go Android Studio official website for both Mac and Ubuntu.
  5. Clone the repo: git clone https://github.com/DIT113-V22/group-01.git
  6. Open our project in Android Studio
  7. Start working!

How to use our mobile app

Before using our mobile app, you need to run mosquitto in order to establish connection between car and our app. Question arises, HOW?

How to run Mosquitto

These methods apply to Windows, MacOS, and Ubuntu

  • To start the broker, open a command prompt (Terminal)
  • In the command prompt, navigate to the Mosquitto root folder.
  • tart the Mosquitto service by running the command: net start mosquitto.
  • Acknowledge the message: The Mosquitto Broker service was started successfully.

How to run the environment (SMCE)

  • Open the "SMCE" shortcut.
  • The start screen for SMCE will now appear on the screen
  • Select the Start Fresh button and then the + sign on the next screen.
  • Click on Add new.
  • Select the Arduino folder's location and open it (file with the .ino extension).
  • Click on Compile, on top left and wait. When the build succeeds, you will be told; if you want to keep an eye on things, open the Log window next to the compile button. It's also where you will find compilation errors if something goes wrong.
  • Then press Start. You will notice that a car has appeared and that the attachment list has been filled. You should notice text being printed out if you open the Serial window on the bottom left.
  • Enjoy driving!

How to change the environment

Here's a .zip file that gives you the option to adjust the SMCE environment. Add the .zip file to the mod folder in the SMCE user directory.

you can find the user directory in these places:

  • Windows: %APPDATA%\Godot\app_userdata\SMCE
  • macOS: ~/Library/Application Support/Godot/SMCE
  • Linux: ~/.local/share/godot/SMCE
  1. Click the top left hamburger menu

env1

  1. Use the world dropdown to select Lindholmen

env2

  1. Welcome on campus

env3

If you have any questions, you can look up the instructions for altering the environment in SMCE.

How to run the mobile app

Now that you have installed our app, check out the user manual to learn how to use it

Learn more about our app

Software Architecture

An overview of our project's structure can be found here We designated to UML diagram and EER diagram, which show our program's and database's structure in greater detail, respectively.

Deployment Diagram: This diagram depicts how the components communicate with one another at a high level of abstraction.

deployment

Hardware Architecture

In this section we will talk about SMCE environment. We use a variety of features for various applications, which we shall discuss in further full detail.

  • Sensors
    Ultra Sonic: The car comes equipped with a number of useful sensors by default. Pins 6 and 7 are connected to an ultrasonic sensor (SR04) on the front of the car with a long range in the default setup. This sensor is used to identify obstacles. The car will come to a halt if an obstacle is within 60 cm.

    Infrared: This sensor is used to measure distances on the sides of the car between 12 and 78 cm. Their range is limited, but they are more precise and quick. In general, there are four infrared sensors on the car, front, back, left, and right.

    Odometer: Two directional odometers, one on each side, that track the distance traveled by the vehicle. In contrast to their directionless cousins, these sensors normally reveal three signal lines. The direction of movement can be deduced based on the status of this third signal.

    Gyroscope: gyroscope that can give you the car's direction in degrees [0, 360]. Clockwise movement increases the degree count, while counter-clockwise movement decreases it.

    Camera: The car has a camera that may be used to transmit what it sees. It reads a frame from the camera every 65 milliseconds and copies it into a frameBuffer. This is then sent out to the Android app via the MQTT protocol.

  • The current configuration for the smartcar has these attachments:

    • 4x infrared sensors
    • 2x odometer sensors
    • 1x gyroscope sensors
    • 1x ultrasonic sensors
    • 1x camera
    • 2x brushed motors
  • Car shield library structure (for developers):
    The purpose of this page is to provide instructions on how to use the library's API, including explanations and examples for each exposed method.