GithubHelp home page GithubHelp logo

cglusky / dapper-gcs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arctic-fire-development/dapper-gcs

0.0 1.0 0.0 16.43 MB

node.js + HTML5 Ground Control Station for unmanned vehicles.

License: Other

JavaScript 74.29% HTML 13.20% CSS 11.27% Shell 1.24%

dapper-gcs's Introduction

Stories in Ready

Dapper - Unmanned Ground Control Station

node.js + HTML5 UAV ground station software emphasizing data collection and mission operations.

Installation (for development)

Prerequisites

You need git, node, npm (distributed with node, usually), bower and grunt. On OSX, install Node.js from an installer, then the rest with brew and npm:

brew install git
sudo npm install -g grunt-cli
sudo npm install -g bower
sudo npm install -g forever
sudo npm install -g nodemon

Running

After installing prerequisites, clone this project and install dependencies, then build runtime files with grunt:

git clone [email protected]:arctic-fire-development/dapper-gcs.git
cd dapper-gcs/
npm install
bower install
mkdir logs
mkdir tmp
cp config.json.example config.json
grunt

Configuration

Work in progress, you need to specify the connection type in the config.json file at the root of the project (copy/paste the config.json.example file as a template), and update the relevant fields (host, port, serial device, etc).

Running the project

A new build of source files is fired off anytime any files that are used by the client are modified -- it takes a few moments, so when you save the file, it may be a few seconds before your changes are visible in the restarted node process.

grunt

Project architecture and structure

outdated fixme

Below is an overview of app/directory structure.

tree -L 3 -I "node_modules|bower|*.svg|*.less|*."
├── app <<< Client Side
│   ├── Models <<< Client Side Backbone Models
│   ├── Templates <<< Client Side Backbone Templates
│   ├── Views <<< Client Side Backbone Views
│   ├── app.js
│   ├── assets <<< Bower things are installed here.
│   │   └── leaflet-touch-extend.js
│   ├── config.js <<< for RequireJS, very important; partly auto-managed
│   ├── main.js
│   ├── router.js
│   └── routines  <<< Different Mission Types
│       ├── components
│       ├── freeFlight
│       └── paths
├── assets <<< Server Side
│   ├── fonts
│   ├── images
│   ├── js <<< Server Side libraries
│   └── less
├── bower.json
├── build <<< Grunt aut-generated... do not touch
├── config.json.example
├── dapper-gcs.service <<< systemd service file
├── dapper-mapproxy.service <<< systemd service file
├── docs <<< Anything you think is good documention!
├── etc <<< Garbage pail for stuff that should be in version control
├── hardware <<< info for setting up the hardware
│   ├── BeagleBone-Black <<< not under development anymore
│   ├── README.md <<< Instructions for setting up the Intel Edison
│   ├── afpd.service
│   ├── misc <<< development notes
│   ├── pcduino <<< not under development anymore
│   └── testgps
│       └── testgps.js
├── logs <<< where log files get put when developing
├── overview.md
├── package.json
├── public <<< Express "public" web root, never add things here
├── routes <<< Express routes, not used much
├── run-mapproxy.sh <<< script for launching mapproxy
├── run-sitl.sh <<< script for launching SITL
├── server.js <<< Server Side main program
├── test
├── tmp
└── views <<< Express views

Development recipes

Adding content or widgets

(sketch) TODO make a boilerplate for these

  • create the template
  • create the view
  • find the appropriate router and add your view renderer there

Adding a new JS dependency via Bower

(sketch)

  • bower install --save new_package
  • hook up the JS
    • if you use the code via RequireJS, it should be auto-added in app/config.js
    • check there to see what the exported name is
  • hook up LESS/CSS
    • if LESS, then add it via an @import directive in the assets/less/assets.less directory.
    • if CSS, then make sure it's part of the mincss task in the Gruntfile configuration.
  • copy in static assets
  • in the copy task in the Gruntfile, add appropriate entries to copy over static assets.

Working with ArduPilot hardware & SITL

(OSX) You'll need to install the FTDI Arduino MegaPilot driver before the OS X will recognize the ArduPilot.

if connecting via the usb, be sure to set the baudrate in config.json:

{
  ...
  "baudrate" : 115200
  ...
}

Using SITL on a remote host

Assuming you're able to get the SITL guide on this page running, here's how to connect this ground station to that SITL/JBSim instance pair. For this setup, we won't have MAVProxy in the loop. On the machine running the simulation, you need to ensure that you can access some TCP port (by default, ArduPilot will use 5760) from wherever the ground station is running.

  1. Start the ArduPlane simulator: /tmp/ArduPlane.build/ArduPlane.elf &
  2. Start JSBSim: python ./ardupilot/Tools/autotest/jsbsim/runsim.py --home=-35.362938,149.165085,584,270 &
  3. Change the config.json file for your ground station to be tcp, and to connect to the correct IP/port on the machine running the ArduPlane/ArduCopter and JSBSim.
  4. Start the ground station: grunt
  5. Open a web page to localhost:3000

Installing offline tile cache system

  1. sudo pip install pyproj PyYAML
  2. sudo pip install MapProxy
  3. To launch the cache:
cd /path/to/repo
mapproxy-util serve-develop -b 0.0.0.0:8080 etc/bing.yaml

Testing

Configuration on Jenkins

The config.json.example file is used to configure Jenkins' runtime environment. It's copied to config.json, so that file needs to be updated as appropriate if new config options are added. For testing, the important configuration at this time is the location of the virtual serial ports.

Running tests

Some additional prerequsites may be required:

npm install -g grunt-cli

There's two different collections of test suites: ones that run on the server, and ones that run on the GUI/interface layer. Mocha is used for the server-side tests, Jasmine for the GUI layer.

To run server-side (mocha) tests in the development environment:

mocha test

To run Mocha tests for xunit output (for CI/Jenkins):

mocha --reporter xunit test/mocha

To run client-side Jasmine tests, open a web browser and open the test/jasmine/index.html HTML page.

Running SITL for development

First, run the vagrant install of the APM development environment.

There's two types of SITL we can attach to. One is where the GCS is slaved to a read-only UDP stream running on the guest VM in MAVProxy; the other is attaching the GCS directly to the APM SITL. The first case is useful for GUI-only testing, the second for command/control of the autopilot from the GCS.

UDP Slave SITL mode

In GCS config.json, set connection: 'udp'.

vagrant ssh # note the IP address of the host
cd ardupilot/ArduPlane/
../Tools/autotest/sim_vehicle.sh --console --map --aircraft test --out 10.0.2.2:14550 # use IP address of host here

Inside the launched MAVProxy console in the guest VM:

wp load ../Tools/autotest/ArduPlane-Missions/CMAC-toff-loop.txt
auto

License Information

This code is released under the GNU General Public License v3.0.

dapper-gcs's People

Contributors

brucecrevensten avatar jonmsawyer avatar pfrr avatar rayjanwilson avatar waffle-iron 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.