-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
108 lines (78 loc) · 3.78 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html>
<head>
<!-- <script src="https://static.robotwebtools.org/threejs/current/three.js"></script> -->
<script src="https://unpkg.com/[email protected]/build/three.js"></script>
<script src="STLLoader.js"></script>
<!--<script src="https://static.robotwebtools.org/threejs/r89/ColladaLoader.js"></script>
<script src="https://static.robotwebtools.org/ros3djs/0.18.0/ColladaLoader.js"></script> -->
<script src="https://aframe.io/releases/1.0.4/aframe.js"></script>
<script src="https://static.robotwebtools.org/EventEmitter2/current/eventemitter2.js"></script>
<script src="https://static.robotwebtools.org/roslibjs/current/roslib.js"></script>
<script src="ros3djs/ros3d.js"></script>
<script src="https://unpkg.com/aframe-input-mapping-component/dist/aframe-input-mapping-component.min.js"></script>
<script src="https://rawgit.com/rdub80/aframe-gui/master/dist/aframe-gui.js"></script>
<script src="aframe-teleport-controls.js"></script>
<script src="common/mappings.js"></script>
<script src="common/aframeros.js"></script>
<script src="robotcontrol.js"></script>
<script src="robotcontrol-debug.js"></script>
<script src="common/aframe-controls.js"></script>
<script>
// window.postMessage('INJECT_AFRAME_INSPECTOR','*');
// AFRAME.registerComponent('thumbstick-logging',{
// init: function () {
// this.el.addEventListener('trackpadmoved', this.logThumbstick);
// console.log(this)
// console.log("inited")
// },
// logThumbstick: function (evt) {
// console.log(AFRAME.currentInputMapping)
// if(AFRAME.currentInputMapping==='roboControls') {
// controls = [evt.detail.y,0,0,0,0,evt.detail.x]
// moveRobot(controls)
// if (evt.detail.y > 0.95) { console.log("DOWN"); }
// if (evt.detail.y < -0.95) { console.log("UP"); }
// if (evt.detail.x < -0.95) { console.log("LEFT"); }
// if (evt.detail.x > 0.95) { console.log("RIGHT"); }
// }
// }
// });
</script>
</head>
<body onload="init_env_after_seconds(1)">
<a-scene inspector
id="main">
<a-entity id="rig" position="0 0 0">
<a-entity id="camera" camera look-controls wasd-controls="acceleration:100" position="0 1.3 0">
<!-- remove this cursor when not debugging without vr -->
<!-- <a-gui-cursor id="cursor"
raycaster="objects: [gui-interactable]"
fuse="true" fuse-timeout="2000"
design="ring"
>
</a-gui-cursor> -->
</a-entity>
<!-- hand controls abstract 6dof controllers-->
<a-entity thumbstick-logging id="leftHand" teleport-controls="cameraRig: #rig;
startEvents: teleportstart; endEvents: teleportend;
" raycaster="objects: [gui-interactable]" laser-controls="hand: left;">
</a-entity>
<!-- right hand contains our indicator for the mode -->
<a-entity id="rightHand" teleport-controls="type: line; cameraRig: #rig;
startEvents: teleportstart; endEvents: teleportend;
" raycaster="objects: [gui-interactable]" laser-controls="hand: right;">
<a-entity id="mode-text" scale="1 1 1" position="0.3 0 0.1" text="color:#FF0000; zOffset:-0.178; xOffset:0.08; value: default;"></a-entity>
<a-box position="0 0 0" scale="0.01 0.01 0.01" color="#FF0000" id="mode-indicator">'
</a-box>
</a-entity>
</a-entity>
<a-entity position="0 0 0" rotation="-90 0 0" id='robot-element-parent'>
</a-entity>
<a-box position="-1 0.5 -8" rotation="0 45 0" color="#4CC3D9"></a-box>
<!-- <a-plane position="0 0 0" rotation="-90 0 0" width="4" height="4" color="#7BC8A4"></a-plane>
<a-sky color="#ECECEC"></a-sky>
-->
</a-scene>
</body>
</html>