Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
x3domlet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Elphel
x3domlet
Commits
7be238eb
Commit
7be238eb
authored
Jul 22, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tilt and roll adjustment - in development
parent
2c3e9726
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
0 deletions
+84
-0
ui_align.js
js/ui_align.js
+79
-0
ui_init.js
js/ui_init.js
+4
-0
x3dom_init.js
js/x3dom_init.js
+1
-0
No files found.
js/ui_align.js
View file @
7be238eb
...
@@ -409,6 +409,11 @@ function x3dom_align_tr(){
...
@@ -409,6 +409,11 @@ function x3dom_align_tr(){
console
.
log
(
"Tilt: "
+
tilt
+
" Roll: "
+
roll
);
console
.
log
(
"Tilt: "
+
tilt
+
" Roll: "
+
roll
);
var
epsilon
=
1
e
-
8
;
var
result
=
numbers
.
calculus
.
GaussNewton
([
0
,
0
,
0
],
Data
.
markers
.
length
,
_r_i
,[
_dr_dx_i
,
_dr_dy_i
,
_dr_da_i
],
epsilon
);
console
.
log
(
result
);
}
}
/*
/*
...
@@ -420,6 +425,80 @@ function align_roll(){
...
@@ -420,6 +425,80 @@ function align_roll(){
}
}
function
_f1_3d_i
(
i
,
v
){
var
mark
=
Data
.
markers
[
i
];
var
xi
=
mark
.
align
.
x
;
var
yi
=
mark
.
align
.
y
;
var
zi
=
mark
.
align
.
z
;
var
res
=
-
Math
.
cos
(
v
[
0
])
*
Math
.
sin
(
v
[
1
])
*
xi
;
res
+=
Math
.
cos
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
yi
;
res
+=
-
Math
.
sin
(
v
[
0
])
*
zi
;
return
res
;
}
function
_f2_map_i
(
i
,
v
){
var
mark
=
Data
.
markers
[
i
];
return
(
v
[
2
]
+
mark
.
align
.
altitude
);
}
function
_r_i
(
i
,
v
){
var
f1
=
_f1_3d_i
(
i
,
v
);
var
f2
=
_f2_map_i
(
i
,
v
);
//return (f1-f2+360)%360;
return
(
f1
-
f2
)
/
_l_i
(
i
);
}
function
_dr_dx_i
(
i
,
v
){
var
mark
=
Data
.
markers
[
i
];
var
xi
=
mark
.
align
.
x
;
var
yi
=
mark
.
align
.
y
;
var
zi
=
mark
.
align
.
z
;
var
res
=
Math
.
sin
(
v
[
0
])
*
Math
.
sin
(
v
[
1
])
*
xi
;
res
+=
-
Math
.
sin
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
yi
;
res
+=
-
Math
.
cos
(
v
[
0
])
*
zi
;
return
res
/
_l_i
(
i
);
}
function
_dr_dy_i
(
i
,
v
){
var
mark
=
Data
.
markers
[
i
];
var
xi
=
mark
.
align
.
x
;
var
yi
=
mark
.
align
.
y
;
var
zi
=
mark
.
align
.
z
;
var
res
=
-
Math
.
cos
(
v
[
0
])
*
Math
.
cos
(
v
[
1
])
*
xi
;
res
+=
-
Math
.
cos
(
v
[
0
])
*
Math
.
sin
(
v
[
1
])
*
yi
;
return
res
/
_l_i
(
i
);
}
function
_dr_da_i
(
i
,
v
){
return
1
;
}
function
_l_i
(
i
){
var
mark
=
Data
.
markers
[
i
];
var
xi
=
mark
.
align
.
x
;
var
yi
=
mark
.
align
.
y
;
var
zi
=
mark
.
align
.
z
;
return
Math
.
sqrt
(
xi
*
xi
+
yi
*
yi
+
zi
*
zi
);
}
/*
/*
* not used
* not used
*/
*/
...
...
js/ui_init.js
View file @
7be238eb
...
@@ -626,6 +626,7 @@ function leaf_events(){
...
@@ -626,6 +626,7 @@ function leaf_events(){
mark
.
align
=
{
mark
.
align
=
{
latitude
:
mark
.
latitude
,
latitude
:
mark
.
latitude
,
longitude
:
mark
.
longitude
,
longitude
:
mark
.
longitude
,
altitude
:
0
,
x
:
0
,
x
:
0
,
y
:
0
,
y
:
0
,
z
:
0
z
:
0
...
@@ -788,6 +789,8 @@ function leaf_drag_marker(){
...
@@ -788,6 +789,8 @@ function leaf_drag_marker(){
function
leaf_update_x3dom_marker
(
p1_ll
,
p2_ll
,
index
){
function
leaf_update_x3dom_marker
(
p1_ll
,
p2_ll
,
index
){
var
Camera
=
Map
.
marker
;
var
mark
=
Data
.
markers
[
index
];
var
mark
=
Data
.
markers
[
index
];
var
hecs
=
Map
.
marker
.
getHCState
();
var
hecs
=
Map
.
marker
.
getHCState
();
...
@@ -797,6 +800,7 @@ function leaf_update_x3dom_marker(p1_ll,p2_ll,index){
...
@@ -797,6 +800,7 @@ function leaf_update_x3dom_marker(p1_ll,p2_ll,index){
mark
.
align
.
latitude
=
mark
.
latitude
;
mark
.
align
.
latitude
=
mark
.
latitude
;
mark
.
align
.
longitude
=
mark
.
longitude
;
mark
.
align
.
longitude
=
mark
.
longitude
;
mark
.
align
.
altitude
=
Camera
.
_measureMarkers
[
index
].
_altitude
;
var
distance
=
p1_ll
.
distanceTo
(
p2_ll
);
var
distance
=
p1_ll
.
distanceTo
(
p2_ll
);
...
...
js/x3dom_init.js
View file @
7be238eb
...
@@ -1381,6 +1381,7 @@ X3DOMObject.createNewMarker = function(x,y,z){
...
@@ -1381,6 +1381,7 @@ X3DOMObject.createNewMarker = function(x,y,z){
mark
.
align
=
{
mark
.
align
=
{
latitude
:
0
,
latitude
:
0
,
longitude
:
0
,
longitude
:
0
,
altitude
:
0
,
x
:
mark
.
x
,
x
:
mark
.
x
,
y
:
mark
.
y
,
y
:
mark
.
y
,
z
:
mark
.
z
z
:
mark
.
z
...
...
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