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
5e599a5e
Commit
5e599a5e
authored
Jul 18, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed south 2 + test set
parent
b35f45d3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
9 deletions
+31
-9
ui_align.js
js/ui_align.js
+31
-9
No files found.
js/ui_align.js
View file @
5e599a5e
...
@@ -42,7 +42,9 @@ function align_init(){
...
@@ -42,7 +42,9 @@ function align_init(){
$
(
"#align_button"
).
on
(
"click"
,
function
(){
$
(
"#align_button"
).
on
(
"click"
,
function
(){
//align_heading();
//align_heading();
//test_markers_set1();
//test_markers_set1();
if
(
DEBUG_ALIGN
)
test_markers_set2
();
//if (DEBUG_ALIGN) test_markers_set1();
//if (DEBUG_ALIGN) test_markers_set2();
if
(
DEBUG_ALIGN
)
test_markers_set3
();
x3dom_align_GN
();
x3dom_align_GN
();
});
});
...
@@ -122,6 +124,8 @@ function x3dom_align_GN(){
...
@@ -122,6 +124,8 @@ function x3dom_align_GN(){
var
y0
=
Data
.
camera
.
kml
.
longitude
;
var
y0
=
Data
.
camera
.
kml
.
longitude
;
var
h0
=
Data
.
camera
.
kml
.
heading
;
var
h0
=
Data
.
camera
.
kml
.
heading
;
//if (h0>180) h0 = h0 - 360;
//tests
//tests
//test_AxB();
//test_AxB();
//test_At();
//test_At();
...
@@ -133,7 +137,7 @@ function x3dom_align_GN(){
...
@@ -133,7 +137,7 @@ function x3dom_align_GN(){
var
iterate
=
true
;
var
iterate
=
true
;
var
counter
=
0
;
var
counter
=
0
;
var
result
=
0
;
var
result
=
0
;
var
xyh
=
[
x0
,
y0
,
h0
];
var
xyh
=
[
x0
,
y0
,
(
h0
>
180
)?
h0
-
360
:
h0
];
while
(
iterate
){
while
(
iterate
){
...
@@ -148,8 +152,8 @@ function x3dom_align_GN(){
...
@@ -148,8 +152,8 @@ function x3dom_align_GN(){
//console.log("Interation: "+counter+" for "+xyh[0]+" "+xyh[1]+" "+xyh[2]);
//console.log("Interation: "+counter+" for "+xyh[0]+" "+xyh[1]+" "+xyh[2]);
xyh_new
=
GaussNewtonAlgorithm
(
xyh
[
0
],
xyh
[
1
],
xyh
[
2
]);
xyh_new
=
GaussNewtonAlgorithm
(
xyh
[
0
],
xyh
[
1
],
xyh
[
2
]);
//if (xyh_new[2]<-180) xyh_new[2] += 360;
if
(
DEBUG_ALIGN
)
console
.
log
(
xyh_new
)
;
//if (xyh_new[2]> 180) xyh_new[2] -= 360
;
var
s0
=
sigma
(
xyh
[
0
],
xyh
[
1
],
xyh
[
2
]);
var
s0
=
sigma
(
xyh
[
0
],
xyh
[
1
],
xyh
[
2
]);
var
s1
=
sigma
(
xyh_new
[
0
],
xyh_new
[
1
],
xyh_new
[
2
]);
var
s1
=
sigma
(
xyh_new
[
0
],
xyh_new
[
1
],
xyh_new
[
2
]);
...
@@ -159,10 +163,11 @@ function x3dom_align_GN(){
...
@@ -159,10 +163,11 @@ function x3dom_align_GN(){
iterate
=
false
;
iterate
=
false
;
}
}
//console.log("Errors: "+(xyh_new[0]-xyh[0])+" "+(xyh_new[1]-xyh[1])+" "+(xyh_new[2]-xyh[2]));
if
(
DEBUG_ALIGN
){
//console.log("Iteration "+counter+" result: "+xyh_new[0]+" "+xyh_new[1]+" "+xyh_new[2]);
console
.
log
(
"Errors: "
+
(
xyh_new
[
0
]
-
xyh
[
0
])
+
" "
+
(
xyh_new
[
1
]
-
xyh
[
1
])
+
" "
+
(
xyh_new
[
2
]
-
xyh
[
2
]));
console
.
log
(
"Iteration "
+
counter
+
" result: "
+
xyh_new
[
0
]
+
" "
+
xyh_new
[
1
]
+
" "
+
xyh_new
[
2
]);
//console.log("Error function value: "+sigma(xyh_new[0],xyh_new[1],xyh_new[2]));
console
.
log
(
"Error function value: "
+
sigma
(
xyh_new
[
0
],
xyh_new
[
1
],
xyh_new
[
2
]));
}
if
(
counter
==
1000
){
if
(
counter
==
1000
){
iterate
=
false
;
iterate
=
false
;
...
@@ -268,7 +273,10 @@ function f2_map_i(i,x,y,h){
...
@@ -268,7 +273,10 @@ function f2_map_i(i,x,y,h){
* residuals function
* residuals function
*/
*/
function
r_i
(
i
,
x
,
y
,
h
){
function
r_i
(
i
,
x
,
y
,
h
){
return
(
f1_3d_i
(
i
,
x
,
y
,
h
)
-
f2_map_i
(
i
,
x
,
y
,
h
));
var
f1
=
f1_3d_i
(
i
,
x
,
y
,
h
);
var
f2
=
f2_map_i
(
i
,
x
,
y
,
h
);
//return (f1-f2+360)%360;
return
(
f1
-
f2
);
}
}
/*
/*
...
@@ -728,3 +736,17 @@ function test_markers_set2(){
...
@@ -728,3 +736,17 @@ function test_markers_set2(){
}
}
// bad set, needed more points
function
test_markers_set3
(){
Data
.
camera
.
kml
.
latitude
=
40.79437830462248
;
Data
.
camera
.
kml
.
longitude
=
-
111.90397158265115
;
Data
.
camera
.
kml
.
heading
=
249.4439547804165
;
Data
.
markers
=
[
{
d_map
:
0
,
d_x3d
:
0
,
align
:{
latitude
:
40.79412143437496
,
longitude
:
-
111.90607845783235
,
x
:
13.930790294993443
,
y
:
17.628990742021394
,
z
:
-
154.9656658238599
}},
{
d_map
:
0
,
d_x3d
:
0
,
align
:{
latitude
:
40.79364474960238
,
longitude
:
-
111.90520875155927
,
x
:
-
30.99517183539921
,
y
:
8.62831993127737
,
z
:
-
92.96031068292253
}},
{
d_map
:
0
,
d_x3d
:
0
,
align
:{
latitude
:
40.79441790113347
,
longitude
:
-
111.90620452165605
,
x
:
34.451361546214116
,
y
:
30.539873602241727
,
z
:
-
133.39148171966684
}}
];
}
\ No newline at end of file
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