Download pool/shard008/JavaScript/0050261_S_Maneuver.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 934 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard008/JavaScript/0050261_S_Maneuver.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard008/JavaScript/0050261_S_Maneuver.js
-
curl -L -o 0050261_S_Maneuver.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard008/JavaScript/0050261_S_Maneuver.js
934 Bytes
| // setup variables, functions, and libraries | |
| var libpath = './Peripherals/build/Release'; | |
| var VixenAUV = require(libpath + '/VixenAUV'); | |
| var $ = require('jquery-deferred'); | |
| var SECONDS = 1000; | |
| function timeout(ms) { | |
| var res = $.Deferred(); | |
| setTimeout(res.resolve, ms); | |
| return res.promise(); | |
| } | |
| // Connect to the Arduino | |
| var factory = new VixenAUV.ArduinoFactory(); | |
| var grid = factory.getPowerGrid(); | |
| var engine = factory.getEngine(); | |
| // Wait for the signal... | |
| var wait = $.Deferred(); | |
| function callback(msg) { | |
| console.log(msg); | |
| wait.resolve(); | |
| } | |
| grid.waitForStartSignal(callback); | |
| // ...and BEGIN! | |
| wait | |
| .then(function() { | |
| engine.move(0.50); | |
| }) | |
| .then(timeout(1*SECONDS)) | |
| .then(function() { | |
| engine.yaw(0.50); | |
| }) | |
| .then(timeout(5*SECONDS)) | |
| .then(function() { | |
| engine.yaw(0.00); | |
| }) | |
| .then(timeout(1*SECONDS)) | |
| .then(function() { | |
| engine.yaw(-0.50); | |
| }) | |
| .then(timeout(5*SECONDS)) | |
| .done(function() { | |
| engine.kill(); | |
| }); |