Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove g photo #69

Merged
merged 18 commits into from
Jun 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
463 changes: 208 additions & 255 deletions cam.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion camData.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[
{
"name": "Nikon D5300",
"shutterSpeedOptions": ["0.0002","0.0003","0.0004","0.0005","0.0006","0.0008","0.0010","0.0012","0.0015","0.0020","0.0025","0.0031","0.0040","0.0050","0.0062","0.0080","0.0100","0.0125","0.0166","0.0200","0.0250","0.0333","0.0400","0.0500","0.0666","0.0769","0.1000","0.1250","0.1666","0.2000","0.2500","0.3333","0.4000","0.5000","0.6250","0.7692","1.0000","1.3000","1.6000","2.0000","2.5000","3.0000","4.0000","5.0000","6.0000","8.0000","10.0000","13.0000","15.0000","20.0000","25.0000","30.0000"],
"shutterSpeedOptions": ["0.0002s","0.0003s","0.0004s","0.0005s","0.0006s","0.0008s","0.0010s","0.0012s","0.0015s","0.0020s","0.0025s","0.0031s","0.0040s","0.0050s","0.0062s","0.0080s","0.0100s","0.0125s","0.0166s","0.0200s","0.0250s","0.0333s","0.0400s","0.0500s","0.0666s","0.0769s","0.1000s","0.1250s","0.1666s","0.2000s","0.2500s","0.3333s","0.4000s","0.5000s","0.6250s","0.7692s","1.0000s","1.3000s","1.6000s","2.0000s","2.5000s","3.0000s","4.0000s","5.0000s","6.0000s","8.0000s","10.0000s","13.0000s","15.0000s","20.0000s","25.0000s","30.0000s"],
"isoOptions": [100,125,160,200,250,320,400,500,640,800,1000,1250,1600,2000,2500,3200,4000,5000,6400,8000,10000,12800,16000,20000,25600]
},
{
Expand Down
26 changes: 26 additions & 0 deletions helpers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function getTime(dateOnly) {
var today = new Date();
var SS = today.getSeconds();
var MM = today.getMinutes();
var HH = today.getHours();
var dd = today.getDate();
var mm = today.getMonth() + 1; //As January is 0.
var yyyy = today.getFullYear();

if (dd < 10) dd = '0' + dd;
if (mm < 10) mm = '0' + mm;
if (HH < 10) HH = '0' + HH;
if (MM < 10) MM = '0' + MM;
if (SS < 10) SS = '0' + SS;
if(dateOnly) return (yyyy + '-' + mm + '-' + dd);
return (yyyy + '-' + mm + '-' + dd + '--' + HH + '-' + MM + '-' + SS);
}

function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

module.exports = {
getTime,
sleep
}
8 changes: 0 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
"concurrently": "^5.0.0",
"express": "^4.17.1",
"firmata": "^2.0.0",
"gphoto2": "^0.3.0",
"imagemagick": "^0.1.3",
"segfault-handler": "^1.3.0",
"socket.io": "^2.2.0",
Expand Down
7 changes: 2 additions & 5 deletions panorama.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var camera = require('./cam.js');
var motor = require('./arduinoDriver');
var { sleep } = require('./helpers');

var running = null;
var pause = false;
Expand Down Expand Up @@ -135,7 +136,7 @@ async function makePanoStep(index) {
}
} else if (panoCamControl && !panoHdr) {
await sleep(500);
await camera.takePicture();
await camera.takePictureAndDownload();
await sleep(500);
}

Expand All @@ -153,10 +154,6 @@ async function makePanoStep(index) {
});
}

function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

function generatePanoPoints(panoConfig) {
var yStepsPerRotation = 37080;
var zStepsPerRotation = 37080;
Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ io.on('connection', function (socket) {
if (process.env.NODE_ENV != 'development') {
socket.on('time', function (data) {
const months = ['JAN', 'FEB', 'MAR', 'APR', 'MAI', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEZ'];
var setTimeCommand = 'date -s "' + data.day + " " + months[data.month] + " " + data.year + " " + data.hour + ":" + data.minutes + ":" + data.seconds + '"';
var setTimeCommand = 'sudo date -s "' + data.day + " " + months[data.month] + " " + data.year + " " + data.hour + ":" + data.minutes + ":" + data.seconds + '"';
exec(setTimeCommand, function (error, stdout, stderr) {
console.log('Set time to ' + setTimeCommand);
if (error) console.log(error);
Expand Down
7 changes: 2 additions & 5 deletions timelapse.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var camera = require('./cam.js');
var motor = require('./arduinoDriver');
var { sleep } = require('./helpers');
var positions = [];
var running = null;
var abort = false;
Expand Down Expand Up @@ -83,7 +84,7 @@ async function timelapse(interval, movieTime, cameraControl, ramping) {
console.log("takePictureWithRamping false");
var camReturn = camera.takePictureWithRamping(false);
} else if (cameraControl) {
var camReturn = camera.takePicture();
var camReturn = camera.takePictureAndDownload();
}

if (abort) {
Expand All @@ -106,10 +107,6 @@ async function timelapse(interval, movieTime, cameraControl, ramping) {
console.log('Timelapse done!');
}

function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}

function getDistance(point1, point2) {
// speed in 3d space is mutated according only to the X distance,
// to keep speed constant in X dimension
Expand Down