Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jeremie Garcia
Trajectoires
Commits
cde2e341
Commit
cde2e341
authored
Nov 05, 2015
by
Jérémie Garcia
Browse files
bug fix
parent
d4beb737
Changes
4
Hide whitespace changes
Inline
Side-by-side
WOB/server/interfaces/Trajectoires.html
View file @
cde2e341
...
...
@@ -65,8 +65,8 @@
<form>
<label
for=
"flip-loop"
>
Loop Mode:
</label>
<select
name=
"flip-loop"
id=
"flip-loop"
data-role=
"slider"
data-theme=
"b"
onchange=
"javascript:Traj.Player.updateLoopMode()"
>
<option
value=
"on"
>
On
</option>
<option
value=
"off"
selected=
"selected"
>
Off
</option>
<option
value=
"on"
>
On
</option>
</select>
</form>
<form>
...
...
WOB/server/interfaces/js/OSC.js
View file @
cde2e341
...
...
@@ -112,14 +112,11 @@ Traj.OSC = {
Traj
.
OSC
.
sendMessage
(
Traj
.
OSC
.
record_address
,
msg
);
},
orientation_rate
:
3
,
//used to send orientaiton events one time over the rate
//
orientation_rate :
0
, //used to send orientaiton events one time over the rate
sendOrientation
:
function
(
msg
){
//ussing Spat formatting source ID xyz x y z
if
(
rate
%
3
===
0
){
Traj
.
OSC
.
sendSpatMessage
([
'
source
'
,
Traj
.
Manager
.
currentSource
,
'
yaw
'
,
msg
[
0
]]);
Traj
.
OSC
.
sendSpatMessage
([
'
source
'
,
Traj
.
Manager
.
currentSource
,
'
pitch
'
,
msg
[
1
]]);
}
rate
=
(
rate
+
1
)
%
3
;
Traj
.
OSC
.
sendSpatMessage
([
'
source
'
,
Traj
.
Manager
.
currentSource
,
'
yaw
'
,
msg
[
0
]]);
//Traj.OSC.sendSpatMessage(['source', Traj.Manager.currentSource, 'pitch', msg[1]]);
// Traj.OSC.sendSpatMessage(['source', Traj.Manager.currentSource, 'roll', msg[2]]);
},
sendNewTraj
:
function
(
msg
){
...
...
WOB/server/interfaces/js/events.js
View file @
cde2e341
...
...
@@ -300,15 +300,20 @@ Traj.Events = {
},
processOrientationEvents
:
function
(
event
)
{
// console.log(event);
var
alpha
=
event
.
alpha
;
// gamma: left to right
var
gamma
=
event
.
gamma
;
// beta: front back motion
var
beta
=
event
.
beta
;
var
msg
=
[
alpha
,
beta
,
gamma
];
// gamma is the left-to-right tilt in degrees, where right is positive
var
tiltLR
=
event
.
gamma
;
// beta is the front-to-back tilt in degrees, where front is positive
var
tiltFB
=
event
.
beta
;
// alpha is the compass direction the device is facing in degrees
var
dir
=
event
.
alpha
//put with correct offset for android
dir
=
(
360
-
dir
)
%
360
;
if
(
Traj
.
Events
.
stream_orientation
){
Traj
.
OSC
.
sendOrientation
(
msg
);
Traj
.
OSC
.
sendOrientation
(
[
dir
,
tiltLR
,
tiltFB
]
);
}
},
...
...
WOB/server/interfaces/js/manager.js
View file @
cde2e341
...
...
@@ -472,6 +472,8 @@ Traj.Manager = {
var
newCurve
=
Traj
.
Utils
.
simplifyCurve
(
currentCurve
,
tolerance
);
Traj
.
Manager
.
trajectories
[
Traj
.
Manager
.
currentCurveIndex
]
=
newCurve
;
}
Traj
.
View
.
current_repaint
();
},
SelectandRedrawEdit
:
function
(){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment