Code Monkey home page Code Monkey logo

driverless-cockpit's Introduction

Driverless Cockpit

Web-based real-time data-visualizations for a self-driving racing car.

This webapp was used by UAS Munich's motorsport team munichmotorsport during the 2018 season of Formula Student to monitor, debug and refine their driverless car.

The app visualizes position, rotation, steering angle, acceleration, speed and many other internal parameters of the car both in real-time and retrospectively. It also displays track boundaries recognized by the car's camera-based recognition system.

View demo app here.

Stack

  • NodeJS
  • Express
  • MongoDB
  • VueJS
  • Vuex
  • Bootstrap
  • KonvaJS
  • Apache Echarts

Architecture

The app consists of a NodeJS backend and a VueJS web application.

The backend accepts TCP Messages from the car. Each message represents one discrete snapshot of the vehicle's internal state. TCP Messages are converted to JSON, optionally stored in MongoDB, and provided to the client via an HTTP API.

The Vue app fetches its data either periodically to represent real-time state, or chunked to display a recorded sequence of data. The car's location, orientation and surroundings are visualized on a 2D canvas using KonvaJS. Changes to single parameters over time are drawn as line charts with Apache Echarts.

Usage

This monorepo contains the client application and a simplified version of the backend for public use. Instead of connecting to a real vehicle, this demo backend reads mocked messages from a local CSV.

Prerequisites:

  • NodeJS 20.12 installed on your machine

Install

Clone this repo. In your terminal, navigate to the repo's root folder and run

npm install

Local development

The following command starts both the backend and a webpack-dev-server with the client app:

npm run dev

Webpack will auto-open the app in the browser and output the URL in your terminal. Usually, the URL is http://localhost:8080.

Backend-only

To start just the backend, execute

npm run api:start

Client-only

To start just the dev-server without the backend, run

npm run frontend:dev

Build the app for production:

npm run frontend:build

Both commands respect the environment variable API_ROOT to overwrite the default API URL. Use this e.g. to develop against the deployed backend at https://driverless-cockpit-demobackend.onrender.com/. The default API_ROOT is http://localhost:3000/.

Example:

# use deployed public API
API_ROOT=https://driverless-cockpit-demobackend.onrender.com/ npm run frontend:dev

driverless-cockpit's People

Contributors

mgschoen avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.