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
6b3e4144
Commit
6b3e4144
authored
Aug 30, 2017
by
Oleg Dzhimiev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
location and heading more alignment options
parent
f05bad46
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
216 additions
and
3 deletions
+216
-3
align_functions.js
js/align_functions.js
+61
-1
ui.css
js/ui.css
+30
-2
ui_align.js
js/ui_align.js
+125
-0
No files found.
js/align_functions.js
View file @
6b3e4144
...
@@ -207,11 +207,71 @@ function hll_w_i(i,v){
...
@@ -207,11 +207,71 @@ function hll_w_i(i,v){
* hll2_...
* hll2_...
*/
*/
function
hll2_r_i
(
i
,
v
){
var
lat
=
Data
.
camera
.
kml
.
latitude
;
var
lng
=
Data
.
camera
.
kml
.
longitude
;
var
f1
=
hll_f_3d_i
(
i
,[
lat
,
lng
,
v
[
0
]]);
var
f2
=
hll_f_map_i
(
i
,[
lat
,
lng
,
v
[
0
]]);
//return (f1-f2+360)%360;
return
(
f1
-
f2
);
}
function
hll2_dr_dx_i
(
i
,
v
){
function
hll2_dr_dx_i
(
i
,
v
){
return
0
;
var
lat
=
Data
.
camera
.
kml
.
latitude
;
var
lng
=
Data
.
camera
.
kml
.
longitude
;
return
hll_dr_dh_i
(
i
,[
lat
,
lng
,
v
[
0
]]);
}
function
hll2_w_i
(
i
,
v
){
var
lat
=
Data
.
camera
.
kml
.
latitude
;
var
lng
=
Data
.
camera
.
kml
.
longitude
;
return
hll_w_i
(
i
,[
lat
,
lng
,
v
[
0
]]);
}
/**
* Functions for position latitude and longitude (heading is fixed)
* hll3_...
*/
function
hll3_r_i
(
i
,
v
){
var
heading
=
Data
.
camera
.
kml
.
heading
;
var
f1
=
hll_f_3d_i
(
i
,[
v
[
0
],
v
[
1
],
heading
]);
var
f2
=
hll_f_map_i
(
i
,[
v
[
0
],
v
[
1
],
heading
]);
//return (f1-f2+360)%360;
return
(
f1
-
f2
);
}
}
function
hll3_dr_dx_i
(
i
,
v
){
var
heading
=
Data
.
camera
.
kml
.
heading
;
return
hll_dr_dx_i
(
i
,[
v
[
0
],
v
[
1
],
heading
]);
}
function
hll3_dr_dy_i
(
i
,
v
){
var
heading
=
Data
.
camera
.
kml
.
heading
;
return
hll_dr_dy_i
(
i
,[
v
[
0
],
v
[
1
],
heading
]);
}
function
hll3_w_i
(
i
,
v
){
var
heading
=
Data
.
camera
.
kml
.
heading
;
return
hll_w_i
(
i
,[
v
[
0
],
v
[
1
],
heading
]);
}
...
...
js/ui.css
View file @
6b3e4144
...
@@ -187,7 +187,12 @@ html, body, #x3d_wrapper {
...
@@ -187,7 +187,12 @@ html, body, #x3d_wrapper {
height
:
25px
;
height
:
25px
;
}
}
#exit_button
,
#align_button
,
#align_tr_button
,
#download_button
{
#exit_button
,
#align_button
,
#align_button_heading
,
#align_button_location
,
#align_tr_button
,
#download_button
{
background-size
:
32px
32px
;
background-size
:
32px
32px
;
background-repeat
:
no-repeat
;
background-repeat
:
no-repeat
;
background-position
:
center
;
background-position
:
center
;
...
@@ -222,7 +227,11 @@ html, body, #x3d_wrapper {
...
@@ -222,7 +227,11 @@ html, body, #x3d_wrapper {
background-color
:
rgba
(
240
,
150
,
150
,
1
);
background-color
:
rgba
(
240
,
150
,
150
,
1
);
}
}
#align_button
:hover
,
#align_tr_button
:hover
,
#download_button
:hover
{
#align_button
:hover
,
#align_button_heading
:hover
,
#align_button_location
:hover
,
#align_tr_button
:hover
,
#download_button
:hover
{
/* background-image:url('images/align.png'); */
/* background-image:url('images/align.png'); */
background-color
:
rgba
(
240
,
240
,
240
,
1
);
background-color
:
rgba
(
240
,
240
,
240
,
1
);
}
}
...
@@ -362,3 +371,22 @@ html, body, #x3d_wrapper {
...
@@ -362,3 +371,22 @@ html, body, #x3d_wrapper {
width
:
50px
;
width
:
50px
;
text-align
:
right
;
text-align
:
right
;
}
}
#align_button_heading
{
background-image
:
url('images/ic_explore_black_48dp_1x.png')
;
background-color
:
rgba
(
200
,
250
,
200
,
1
);
}
#align_button_location
{
background-image
:
url('images/ic_explore_black_48dp_1x.png')
;
background-color
:
rgba
(
200
,
200
,
250
,
1
);
}
#align_button
,
#align_button_heading
,
#align_button_location
{
display
:
block
;
/* float:right; */
/* margin-right:2px; */
}
js/ui_align.js
View file @
6b3e4144
...
@@ -48,6 +48,29 @@ function align_init(){
...
@@ -48,6 +48,29 @@ function align_init(){
x3dom_align_hll
();
x3dom_align_hll
();
});
});
var
pos
=
$
(
"#align_button"
).
position
();
var
width
=
$
(
"#align_button"
).
width
();
$
(
"#align_button_heading"
).
css
({
position
:
"absolute"
,
top
:
pos
.
top
+
"px"
,
left
:
-
(
width
+
2
)
+
"px"
});
$
(
"#align_button_location"
).
css
({
position
:
"absolute"
,
top
:
pos
.
top
+
"px"
,
left
:
-
(
2
*
(
width
+
2
))
+
"px"
});
$
(
"#align_button_heading"
).
on
(
"click"
,
function
(){
x3dom_align_hll2
();
});
$
(
"#align_button_location"
).
on
(
"click"
,
function
(){
x3dom_align_hll3
();
});
$
(
"#align_tr_button"
).
on
(
"click"
,
function
(){
$
(
"#align_tr_button"
).
on
(
"click"
,
function
(){
x3dom_align_art
();
x3dom_align_art
();
});
});
...
@@ -269,6 +292,108 @@ function distance_error(x,y,h){
...
@@ -269,6 +292,108 @@ function distance_error(x,y,h){
}
}
/**
* find heading (fixed lat and lng)
*/
function
x3dom_align_hll2
(){
// need at least 1 point
if
(
Data
.
markers
!=
undefined
){
if
(
Data
.
markers
.
length
<
1
){
var
msg
=
"Alignment error: place at least 1 marker"
;
ui_showMessage
(
"window-error"
,
msg
);
return
-
1
;
}
}
else
{
var
msg
=
"Alignment error: place at least 1 marker"
;
ui_showMessage
(
"window-error"
,
msg
);
return
-
1
;
}
if
(
!
check_markers
()){
//var msg = "Alignment error: marker has not been moved over 3D or Map";
//ui_showMessage("window-error",msg);
return
-
2
;
}
ui_hideMessage
(
"window-error"
);
// initial approximation:
var
x0
=
Data
.
camera
.
kml
.
latitude
;
var
y0
=
Data
.
camera
.
kml
.
longitude
;
var
h0
=
Data
.
camera
.
kml
.
heading
;
var
epsilon
=
1
e
-
8
;
//var xyh = [x0,y0,(h0>180)?h0-360:h0];
var
xyh
=
[(
h0
>
180
)?
h0
-
360
:
h0
];
var
result
=
numbers
.
calculus
.
GaussNewton
(
xyh
,
Data
.
markers
.
length
,
hll2_r_i
,[
hll2_dr_dx_i
],
epsilon
,
hll2_w_i
);
xyh
=
[
x0
,
y0
,
result
.
v
[
0
]];
var
s1
=
result
.
error
;
var
counter
=
result
.
count
;
//calc distance error
de
=
distance_error
(
x0
,
y0
,(
h0
>
180
)?
h0
-
360
:
h0
);
//de = -de;
//convert to conventional range
xyh
[
0
]
=
(
xyh
[
0
]
+
360
)
%
360
;
//init apply dialog
apply_alignment_dialog_hll
([
x0
,
y0
,
h0
],
xyh
,
counter
,
s1
,
de
);
}
/**
* find lat and lng (fixed heading)
*/
function
x3dom_align_hll3
(){
// need at least 3 points
if
(
Data
.
markers
!=
undefined
){
if
(
Data
.
markers
.
length
<
2
){
var
msg
=
"Alignment error: place at least 2 markers"
;
ui_showMessage
(
"window-error"
,
msg
);
return
-
1
;
}
}
else
{
var
msg
=
"Alignment error: place at least 2 markers"
;
ui_showMessage
(
"window-error"
,
msg
);
return
-
1
;
}
if
(
!
check_markers
()){
//var msg = "Alignment error: marker has not been moved over 3D or Map";
//ui_showMessage("window-error",msg);
return
-
2
;
}
ui_hideMessage
(
"window-error"
);
// initial approximation:
var
x0
=
Data
.
camera
.
kml
.
latitude
;
var
y0
=
Data
.
camera
.
kml
.
longitude
;
var
h0
=
Data
.
camera
.
kml
.
heading
;
var
epsilon
=
1
e
-
8
;
var
xyh
=
[
x0
,
y0
];
var
result
=
numbers
.
calculus
.
GaussNewton
(
xyh
,
Data
.
markers
.
length
,
hll3_r_i
,[
hll3_dr_dx_i
,
hll3_dr_dy_i
],
epsilon
,
hll3_w_i
);
xyh
=
[
result
.
v
[
0
],
result
.
v
[
1
],
h0
];
var
s1
=
result
.
error
;
var
counter
=
result
.
count
;
//calc distance error
de
=
distance_error
(
x0
,
y0
,(
h0
>
180
)?
h0
-
360
:
h0
);
//de = -de;
//convert to conventional range
xyh
[
2
]
=
(
xyh
[
2
]
+
360
)
%
360
;
//init apply dialog
apply_alignment_dialog_hll
([
x0
,
y0
,
h0
],
xyh
,
counter
,
s1
,
de
);
}
/**
/**
* Tilt, roll and relative height
* Tilt, roll and relative height
*/
*/
...
...
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