Jean-Yves Didier

pipe app debugging

This diff is collapsed. Click to expand it.
......@@ -131,7 +131,6 @@ arcs_module(
// put here the code to set orientation and position of object camera3d
// see also documentation of Object3D (API Three.js)
// since a camera is an Object3D
console.log("viewing");
var rotation = markers[i].pose.rotation;
var translation = markers[i].pose.position;
......@@ -310,4 +309,4 @@ arcs_module(
return {ARViewer: ARViewer};
},
[ 'deps/three.js/index','deps/three.js/frustumcamera']
);
);
\ No newline at end of file
......
......@@ -16,7 +16,7 @@ arcs_module(function (ARCS) {
this.start = function() {
if (window.DeviceOrientationEvent) {
console.log("Device orientation capability detected");
window.addEventListener("deviceorientation", handleOrientation, true);
window.addEventListener("deviceorientation", handleOrientation, false);
//window.ondeviceorientation = handleOrientation;
} else {
console.log("[Inertial]","no device orientation API");
......@@ -28,6 +28,8 @@ arcs_module(function (ARCS) {
} else {
console.log("[Inertial]","no device motion API");
}
};
},
......
......@@ -26,15 +26,17 @@ arcs_module(function(ARCS) {
var setUserMedia = function() {
if (navigator.mediaDevices !== undefined) {
navigator.mediaDevices.getUserMedia({video:true})
navigator.mediaDevices.getUserMedia({video:{facingMode : "environment"}})
.then(handleMediaStream)
.catch(errorMediaStream);
} else {
var getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
if (getUserMedia !== undefined) {
getUserMedia({video:true}, handleMediaStream,
console.log(getUserMedia(), handleMediaStream, errorMediaStream);
/*getUserMedia({video:true}, handleMediaStream,
errorMediaStream
);
);*/
getUserMedia({video:true}).then(handleMediaStream);
}
}
};
......
@viewport {
width: device-width;
height: device-height;
zoom: 1;
}
......@@ -125,7 +126,7 @@ body {
left:0px;
top:0px;
width: 100%;
height: 100%;
height: 100vh;
}
......
{
"context": {
"libraries": [
"components/animator",
"components/arviewer",
"components/geojson",
"components/geolocator",
"components/gpsinertialpose",
"components/inertial",
"components/video",
"components/windowevent"
],
"components": {
"viewer": { "type": "ARViewer"},
"animator": { "type": "Animator"},
"windowresize": { "type": "WindowEvent"},
"gps" : { "type" : "GeoLocator" },
"inertial" : { "type" : "Inertial" },
"fuser" : { "type" : "GPSInertialPose" },
"pipeNetwork" : { "type" : "PipeNetwork", "url": "./Conduites_UFRST.geojson"},
"video": {"type": "LiveSource"},
"statemachine" : {
"type": "StateMachine",
"value" : {
"initial": "init",
"transitions" : {
"init" : { "next" : "start"}
}
}
}
}
},
"controller": "statemachine",
"sheets": {
"init": {
"preconnections": [
{ "destination": "video", "slot": "setWidgets", "value": ["video", "canvas"] },
{ "destination": "viewer", "slot": "keepAspectRatio", "value": [true] },
{ "destination": "viewer", "slot": "setWidgets", "value": ["container", "video"]},
{ "destination": "viewer", "slot": "setFocal", "value": [ 600 ]},
{ "destination": "fuser", "slot": "setId", "value": [ 17 ] },
{ "destination": "viewer", "slot": "setSceneId", "value": [17] },
{ "destination": "inertial", "slot": "start", "value": [] },
{ "destination": "gps", "slot": "watchPosition", "value": [] }
],
"postconnections": [
{ "destination": "pipeNetwork", "slot": "init", "value": [] }
],
"connections": [
{ "destination": "viewer", "slot": "addScene", "source": "pipeNetwork", "signal": "sendSceneGraph" },
{ "destination": "statemachine", "slot": "next", "source": "pipeNetwork", "signal": "sendSceneGraph" }
],
"cleanups": [
]
},
"start": {
"preconnections": [
],
"postconnections": [
{ "destination": "viewer", "slot": "viewAll", "value": []},
{ "destination": "animator", "slot": "start", "value":[]}
],
"connections": [
{ "source": "windowresize", "signal": "onResize", "destination": "viewer", "slot":"setSize"},
{ "source": "animator", "signal": "onAnimationFrame", "destination": "video", "slot": "grabFrame"},
{ "source": "video", "signal": "onImage", "destination": "viewer", "slot": "render"},
{ "source": "video", "signal": "onReady", "destination": "viewer", "slot": "resetCamera"},
{ "source": "gps", "signal": "sendCoordinates", "destination": "fuser", "slot": "setPosition"},
{ "source": "inertial", "signal": "sendOrientation", "destination": "fuser", "slot": "setOrientation"},
{ "source": "fuser", "signal": "sendPose", "destination": "viewer", "slot": "setExtrinsics"}
],
"cleanups": []
}
}
}
\ No newline at end of file
......
......@@ -13,7 +13,13 @@
</head>
<body>
<video id="video" width=320 height=240 autoplay="true" style="display: none;"></video>
<canvas id="canvas" ></canvas>
<div id="container"></div>
<div id="contents">
<a id="logo" href="http://arcs.ibisc.univ-evry.fr"><img src="../../docs/arcs_logo.png" alt="ARCS"/></a>
</div>
</body>
</html>
\ No newline at end of file
......