Ejemplo n.º 1
0
 .then(function (res) {
   fileName = res.body.results.entries[0].name;
   console.log('res.body.results.entries' + res.body.results.entries);
   console.log('running getimage on:');
   console.log(fileName);
   return thetaClient.getImage(res.body.results.entries[0].uri, "full");
 })
Ejemplo n.º 2
0
 .then(function (err) {
   //don't close session yet
   //call python script with the fileName
   console.log('closing the session');
   return thetaClient.closeSession(sessionId);
 })
Ejemplo n.º 3
0
 .then(function (_res) {
   console.log('running listall');
   // need to get the unique video uri
   return thetaClient.listAll({entryCount:1, sort:"newest"});
 })
Ejemplo n.º 4
0
  .then(function (res) {
    console.log('starting capture');
    return thetaClient.takePicture(sessionId);
//    return thetaClient.startCapture(sessionId);

  })
Ejemplo n.º 5
0
 thetaClient.startSession().then(function (res) {
   //Grab the session id
   sessionId = res.body.results.sessionId;
   console.log('set options on theta client');
   return thetaClient.setOptions(sessionId, {captureMode:"image"})
 })
Ejemplo n.º 6
0
var fs = require('fs');
var ThetaSOscClient = require('osc-client-theta_s').ThetaSOscClient;

var domain = '192.168.1.1';
var port = '80';

var thetaClient = new ThetaSOscClient(domain, port);
var sessionId;
var fileName;

// module.exports = function (socket) {
  thetaClient.startSession().then(function (res) {
    //Grab the session id
    sessionId = res.body.results.sessionId;
    console.log('set options on theta client');
    return thetaClient.setOptions(sessionId, {captureMode:"image"})
  })
  .then(function (res) {
    console.log('starting capture');
    return thetaClient.takePicture(sessionId);
//    return thetaClient.startCapture(sessionId);

  })
  .catch(function (error) {
    console.log(error);
  });

  // Delay for camera to write image -- #TODO there has got to be a better way to do this
  var interval = 8000;
  // Number of keyframes to grab
  var count = 3;