Skip to content

Commit

Permalink
start removing obsolete py files
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Van Zandycke committed Oct 20, 2015
1 parent 70e0dd8 commit 5e2895b
Show file tree
Hide file tree
Showing 26 changed files with 92 additions and 1,193 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Open-Source Ship

Setup
--------
All the required modules are in bootstap.sh
I'm using a raspberry model B and B+

Libraries
Expand All @@ -19,7 +18,7 @@ Hardware
- Bmp180 (Barometric pressure sensor)
- PI Camera (normal version)
- Ultimate GPS Breakout v3 (GPS)
- Standard Size - High Torque - Metal Gear Servo
- Standard Size - High Torque - Metal Gear Servo
- Mtroniks Viper Marine 20
- Aluminum Double Rudder
- 2.5:1 gearbox motor, 4.5-15V 540 motor
Expand Down
1 change: 0 additions & 1 deletion cli/__init__.py

This file was deleted.

76 changes: 0 additions & 76 deletions cli/command.py

This file was deleted.

37 changes: 34 additions & 3 deletions command.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ var Command = function (kernel) {
this.startComponents();
} else if (data == 'stop') {
this.stopComponents();
} else if (data == 'steering') {
this.steering();
} else if (data == 'throttle') {
this.throttle();
} else if (data == 'update') {
this.update();
} else if (data == 'config') {
Expand All @@ -30,7 +34,6 @@ var Command = function (kernel) {
} else if ( data == '\u0003' || data == 'quit' || data == 'exit') {
this.exit();
} else {
console.warn('Error: Command not found');
this.complete();
}

Expand Down Expand Up @@ -96,6 +99,36 @@ var Command = function (kernel) {
this.complete();
};

this.throttle = function (level) {
this.ask("Throttle level -100 to 100: ",function (data){
if (this.kernel.components.driver) {
this.kernel.components.driver.setThrottle(data);
} else {
console.log("driver is not initialized yet");
}

this.complete();
}.bind(this));
};

this.steering = function (angle) {
this.ask("Steering angle -100 to 100: ",function (data){
if (this.kernel.components.driver) {
this.kernel.components.driver.setSteering(data);
} else {
console.log("driver is not initialized yet");
}

this.complete();
}.bind(this));
};

this.halt = function () {
this.components.driver.halt();

this.complete();
};

this.exit = function () {
console.log('exiting program');
process.exit();
Expand All @@ -107,8 +140,6 @@ var Command = function (kernel) {
data = data.toString().trim();
callback(data);
});

this.complete();
};

}
Expand Down
211 changes: 0 additions & 211 deletions config.py

This file was deleted.

22 changes: 22 additions & 0 deletions drivedummy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Constructor
var DriveDummy = function (kernel) {
this.kernel = kernel;

this.setThrottle = function(level) {
console.log("Set throttle to " + level);
this.kernel.data.throttle = level;
}

this.setSteering= function(angle) {
console.log("Set steering angle to " + angle);
this.kernel.data.steering = angle;
}

this.halt = function () {
console.log("Halting drive controller");
this.kernel.data.steering = 0;
this.kernel.data.throttle = 0;
}
}

module.exports = DriveDummy;
Loading

0 comments on commit 5e2895b

Please sign in to comment.