Skip to content

Centralized Smart Dashboard developed for the rover of Wisconsin Robotics team.

Notifications You must be signed in to change notification settings

WisconsinRobotics/centralized_smart_dashboard

 
 

Repository files navigation

Centralized Smart Dashboard

Centralized Smart Dashboard developed for the rover of Wisconsin Robotics team.

Iteration number 2 for COMPSCI 506: Software Engineer.

Code cutoff date: Friday, November 13, 2020.

Use master branch for testing and reviews of the newest version.

Prerequisites

Docker

Notice that currently is only set to work for a unix-based OS. This is fine in our case, since our client's rover runs in a Unix-based OS

Setup

The image only needs to be built once, per each new change we make in the container. However, you need to run the image each time.

  1. Build docker image:
    docker build -t flask-image:latest ./dockerfiles
    

    Notice that you might need Admin access

  2. Run image at port 5000:
    docker run -it -p 5000:5000 -v <path_to_source>:/root flask-image
    

    Use a different port if 5000 is busy for you. Replace <path_to_source> to your path to the source of the project. Do not include the < > symbols.

Ros Setup

Inside your docker container:

  1. source /opt/ros/noetic/setup.bash
    
    cd model
    
    catkin_make
    

    If this command does not work, run rosdep update and try again.

  2. source devel/setup.bash
    
  3. To start the model server, we need to run roscore you can run it in the background using:
    roscore &
    
  • To run the required mock Rover data, we created a python module named mock_ros_nodes.py. To run it in the background run:
    python3 model/src/centralized_dashboard/src/mock_ros_nodes.py & 
    

    Run app

    To manually run the app, run python3 app.py inside your docker container. Then, in your preferred browser, navigate to localhost:5000.

    Reporting bugs

    We will track bugs, using Github's Issues. You can create a new issue in this link: https://github.com/piedras77/centralized_smart_dashboard/issues We have added two sample Issues with real, known bugs that we have found in our system.

    Running the backend tests

    For the flask tests go to the unitTest folder and run:

    pytest --cov=routes
    

    Now, to test the code that connects our application with the rover. First, we need to run our mock rover:

    python3 model/src/centralized_dashboard/src/mock_ros_nodes.py &
    

    Then, we can find the rover tests inside the tests/ folder, and run them as in:

    touch testipfile.txt
    
    pytest --cov=rover
    

    For our final iteration, we have achieved an 88% code coverage.

  • Running the frontend tests

    From inside the project folder, install angular on your local drive using the following command

    npm install angular
    
    

    Then, install the angular mocks with this command

    npm install angular-mocks
    
    

    For frontend automated tests, we are using Karma as a platform. Use the following command to install Karma.

    npm install karma --save-dev
    
    

    Install the dependendencies for Karma. The chrome launcher dependencies is as our client will be using Chrome as a default browser.

    npm install karma-jasmine karma-chrome-launcher --save-dev
    
    

    Use the following command for ease of running through command line. This allows you to not have to define the path every time you run a test. Instead, you can just use "karma"

    npm install -g karma-cli
    
    

    Install the code coverage dependency for Karma. A file with the code coverage of the tests will be generated each time the tests are run.

    npm install karma-coverage --save-dev
    
    

    Now that you've installed the necessary programs and dependencies, you don't need to do this again.

    Use the following command to run the automated front end tests.

    npm test
    

    For our final iteration, we achieved a 79% code coverage. We considered this an acceptable value due to the dynamic nature of the GUI as well as a majority of the HTML front-end tests are visual acceptance tests, i.e. map testing, range sliders and zoom in AINavigation and Maintenance.

    About

    Centralized Smart Dashboard developed for the rover of Wisconsin Robotics team.

    Resources

    Stars

    Watchers

    Forks

    Packages

    No packages published

    Languages

    • JavaScript 67.1%
    • Python 14.4%
    • HTML 10.2%
    • CSS 4.9%
    • CMake 3.0%
    • Dockerfile 0.3%
    • Shell 0.1%