Skip to content

Commit

Permalink
Merge branch 'develop' into feature/SerialCommunication
Browse files Browse the repository at this point in the history
  • Loading branch information
TekuConcept committed Apr 19, 2017
2 parents 6514cbf + 5613324 commit 84feb04
Show file tree
Hide file tree
Showing 83 changed files with 2,971 additions and 349 deletions.
225 changes: 210 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,221 @@
###Git Ignore Filetypes###
Release/
Debug/
Build/
Drivers/
Catch/
googletest/
TestFootage


# JetBrains
.idea/

#compiled source#
#################

# Created by https://www.gitignore.io/api/macos,windows,linux,jetbrains,cmake,c++,node

### C++ ###
# Prerequisites
*.d
*.cbp

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

Release/
Debug/
Build/
# Fortran module files
*.mod
*.smod

#cmake-generated files#
.cmake
# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

### CMake ###
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake-build-*
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake

### JetBrains ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

### JetBrains Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# NPM
# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
*.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Node ###
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Submodules
Drivers/
googletest/
# Typescript v1 declaration files
typings/

TestFootage
# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env


### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.gitignore.io/api/macos,windows,linux,jetbrains,cmake,c++,node
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "googletest"]
path = Libraries/googletest
url = https://github.com/google/googletest.git
[submodule "Libraries/Catch"]
path = Libraries/Catch
url = https://github.com/philsquared/Catch.git
3 changes: 0 additions & 3 deletions ArduinoController/ArduinoController.ino
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <ArduinoJson.h>

#include "ThrustController.h"
#include "EscController.h"
#include "LedController.h"
Expand All @@ -8,7 +6,6 @@
#include "KillSwitchController.h"
#include "VoltageController.h"
#include "StartController.h"
#include "PinJSON.h"

const uint32_t CONTROLLER_CNT = 13u;
class IController* controllers[CONTROLLER_CNT];
Expand Down
20 changes: 3 additions & 17 deletions ArduinoController/EscController.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,15 @@ class EscController : public IController {
GpioPin::ESC_S5_PIN,
GpioPin::ESC_S6_PIN
};

public:
EscController() {
for(uint32_t i = 0; i < GPIO_CNT; i++) {
pinMode(GPIO_PINS[i], OUTPUT);
digitalWrite(GPIO_PINS[i], HIGH);
}
}

void setupPins_() {
for(int i = 0; i < pinCount; i++) {
pinMode(pins_[i], OUTPUT);
digitalWrite(pins_[i], HIGH);
}
}

public:

EscController(JsonObject& pins) {
pinCount = pins["gpio"].size();
assignPins_(pins["gpio"]);
setupPins_();
}


void execute() {
uint8_t toggle = SerialTools::readByte();
for(uint32_t i = 0; i < GPIO_CNT; i++) {
Expand All @@ -50,4 +36,4 @@ class EscController : public IController {
}
};

#undef GPIO_CNT
#undef GPIO_CNT
33 changes: 0 additions & 33 deletions ArduinoController/PinJSON.h

This file was deleted.

37 changes: 21 additions & 16 deletions BoneCentral/Brain/CppInterface/ThrustController.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,50 @@ module.exports = (function(){
this._cmdOut = cmdOut;
}

ThrustController.prototype.goDirection = function(forward, strafe, dive) {
ThrustController.prototype.goDirection = function(move, secondDive, dive) {
var cmdString =
"goDirection " + forward + " " + strafe + " " + " " + dive + "\n";
"goDirection " + move + " " + secondDive + " " + " " + dive + "\n";
this._cmdOut.write(cmdString);
};

ThrustController.prototype.faceDirection = function(yaw, dive){
ThrustController.prototype.rotate = function(yaw, pitch, roll){
var cmdString =
"faceDirection " + yaw + " " + dive + "\n";
"rotate " + yaw + " " + pitch + " " + roll + "\n";
this._cmdOut.write(cmdString);
};

ThrustController.prototype.setDiveOffset = function(front, back) {
var cmdString = "setDiveOffset " + front + " " + back + "\n";
ThrustController.prototype.move = function (throttle) {
var cmdString = "move " + throttle + "\n";
this._cmdOut.write(cmdString);
};

ThrustController.prototype.setForwardTrim = function(left, right) {
var cmdString = "setForwardTrim " + left + " " + right + "\n";
ThrustController.prototype.secondaryDive = function (throttle) {
var cmdString = "secondaryDive " + throttle + "\n";
this._cmdOut.write(cmdString);
};

ThrustController.prototype.setStrafeTrim = function(left, right) {
var cmdString = "setStrafeTrim " + left + " " + right + "\n";
ThrustController.prototype.dive = function (throttle) {
var cmdString = "primaryDive " + throttle + "\n";
this._cmdOut.write(cmdString);
};

ThrustController.prototype.setDiveTrim = function(front, back) {
var cmdString = "setDiveTrim " + front + " " + back + "\n";
ThrustController.prototype.yaw = function (throttle) {
var cmdString = "yaw " + throttle + "\n";
this._cmdOut.write(cmdString);
};

ThrustController.prototype.thrustForward = function (left, right) {
var cmdString = "thrustForward " + left + " " + right + "\n";
ThrustController.prototype.pitch = function (throttle) {
var cmdString = "pitch " + throttle + "\n";
this._cmdOut.write(cmdString);
};

ThrustController.prototype.dive = function (forward, rear) {
var cmdString = "dive " + forward + " " + rear + "\n";
ThrustController.prototype.roll = function (throttle) {
var cmdString = "roll " + throttle + "\n";
this._cmdOut.write(cmdString);
};

ThrustController.prototype.kill = function () {
var cmdString = "killThrust\n";
this._cmdOut.write(cmdString);
};

Expand Down
Loading

0 comments on commit 84feb04

Please sign in to comment.