Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PROG2900
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sara Savanovic Djordjevic
PROG2900
Commits
e6cff465
Commit
e6cff465
authored
11 months ago
by
Hoa Ben The Nguyen
Browse files
Options
Downloads
Patches
Plain Diff
change: prepare new method for finding relative data from lidar to map
parent
15b692a7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/data_processing/area_processing.py
+6
-6
6 additions, 6 deletions
server/data_processing/area_processing.py
server/data_processing/process_lidar_data.py
+6
-6
6 additions, 6 deletions
server/data_processing/process_lidar_data.py
with
12 additions
and
12 deletions
server/data_processing/area_processing.py
+
6
−
6
View file @
e6cff465
...
@@ -13,18 +13,18 @@ METER = (1 / ((2 * pi / 360) * EARTH)) / 1000 # 1 meter in degree
...
@@ -13,18 +13,18 @@ METER = (1 / ((2 * pi / 360) * EARTH)) / 1000 # 1 meter in degree
def
position_relative_to_pointcloud
(
l1
,
l2
,
p1
,
p2
,
center_lim
,
max_lim
):
def
position_relative_to_pointcloud
(
l1
,
l2
,
p1
,
p2
,
center_lim
,
max_lim
):
center_l
=
tuple
((
a
+
b
)
/
2
for
a
,
b
in
zip
(
l1
,
l2
))
center_l
=
tuple
((
a
+
b
)
/
2
for
a
,
b
in
zip
(
l1
,
l2
))
return
[
return
[
((
p1
[
0
]
-
center_lim
[
0
])
*
((
l1
[
0
]
-
l2
[
0
])
/
(
max_lim
[
1
][
0
]
-
max_lim
[
3
][
0
]))
+
center_l
[
0
],
((
p1
[
0
]
-
center_lim
[
0
])
*
((
l1
[
0
]
-
l2
[
0
])
/
(
max_lim
[
2
][
0
]
-
max_lim
[
0
][
0
]))
+
center_l
[
0
],
(
p1
[
1
]
-
center_lim
[
1
])
*
((
l1
[
1
]
-
l2
[
1
])
/
(
max_lim
[
1
][
1
]
-
max_lim
[
3
][
1
]))
+
center_l
[
1
]),
(
p1
[
1
]
-
center_lim
[
1
])
*
((
l1
[
1
]
-
l2
[
1
])
/
(
max_lim
[
2
][
1
]
-
max_lim
[
0
][
1
]))
+
center_l
[
1
]),
((
p2
[
0
]
-
center_lim
[
0
])
*
((
l1
[
0
]
-
l2
[
0
])
/
(
max_lim
[
1
][
0
]
-
max_lim
[
3
][
0
]))
+
center_l
[
0
],
((
p2
[
0
]
-
center_lim
[
0
])
*
((
l1
[
0
]
-
l2
[
0
])
/
(
max_lim
[
2
][
0
]
-
max_lim
[
0
][
0
]))
+
center_l
[
0
],
(
p2
[
1
]
-
center_lim
[
1
])
*
((
l1
[
1
]
-
l2
[
1
])
/
(
max_lim
[
1
][
1
]
-
max_lim
[
3
][
1
]))
+
center_l
[
1
])
(
p2
[
1
]
-
center_lim
[
1
])
*
((
l1
[
1
]
-
l2
[
1
])
/
(
max_lim
[
2
][
1
]
-
max_lim
[
0
][
1
]))
+
center_l
[
1
])
,
]
]
print
(
position_relative_to_pointcloud
((
-
20
,
3
0
),
(
-
10
,
2
0
),
(
1
,
3
),
(
2
,
2
),
(
2.5
,
2.5
),
[(
0
,
0
),(
0
,
5
),(
0
,
0
),(
5
,
0
)]))
print
(
position_relative_to_pointcloud
((
-
20
,
2
0
),
(
-
10
,
3
0
),
(
1
,
3
),
(
2
,
2
),
(
2.5
,
2.5
),
[(
5
,
5
),(
0
,
5
),(
0
,
0
),(
5
,
0
)]))
print
(
position_relative_to_pointcloud
((
-
3299999
,
4608018
),
(
-
3200001
,
4687153
),
(
61.47620866851029
,
8.961138281887507
),
(
61.95241733702057
,
6.8508373935926645
),
(
61
,
11
),
[(
61.95241733702057
,
15.125349549679886
),
(
60.04758266297943
,
15.125349549679886
),
(
60.04758266297943
,
6.8746504503201145
),
(
61.95241733702057
,
6.8746504503201145
)]))
print
(
position_relative_to_pointcloud
((
-
3299999
,
4608018
),
(
-
3200001
,
4687153
),
(
61.47620866851029
,
8.961138281887507
),
(
61.95241733702057
,
6.8508373935926645
),
(
61
,
11
),
[(
61.95241733702057
,
15.125349549679886
),
(
60.04758266297943
,
15.125349549679886
),
(
60.04758266297943
,
6.8746504503201145
),
(
61.95241733702057
,
6.8746504503201145
)]))
# check if lidar points is within range of the area selected
# check if lidar points is within range of the area selected
def
inArea
(
position
,
areaRange
):
def
inArea
(
position
,
areaRange
):
x
,
y
,
_
=
position
# position to be checked
x
,
y
,
_
=
position
# position to be checked
#
print((areaRange[0][0])," < ",x," < ",(areaRange[1][0])," and ",(areaRange[0][1])," > ",(y)," > ",(areaRange[1][1])," ",((areaRange[0][0]) < x < (areaRange[1][0])) and ((areaRange[0][1]) > (y) > (areaRange[1][1])))
print
((
areaRange
[
0
][
0
]),
"
<
"
,
x
,
"
<
"
,(
areaRange
[
1
][
0
]),
"
and
"
,(
areaRange
[
0
][
1
]),
"
>
"
,(
y
),
"
>
"
,(
areaRange
[
1
][
1
]),
"
"
,((
areaRange
[
0
][
0
])
<
x
<
(
areaRange
[
1
][
0
]))
and
((
areaRange
[
0
][
1
])
>
(
y
)
>
(
areaRange
[
1
][
1
])))
if
((
areaRange
[
0
][
0
])
<
x
<
(
areaRange
[
1
][
0
]))
and
((
areaRange
[
0
][
1
])
>
y
>
(
areaRange
[
1
][
1
])):
if
((
areaRange
[
0
][
0
])
<
x
<
(
areaRange
[
1
][
0
]))
and
((
areaRange
[
0
][
1
])
>
y
>
(
areaRange
[
1
][
1
])):
return
True
return
True
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
server/data_processing/process_lidar_data.py
+
6
−
6
View file @
e6cff465
...
@@ -92,15 +92,15 @@ def calculate_area_data(center, body_of_water):
...
@@ -92,15 +92,15 @@ def calculate_area_data(center, body_of_water):
# find the heights of each sub-area => area-heights
# find the heights of each sub-area => area-heights
if
len
(
map_data
)
>
0
:
if
len
(
map_data
)
>
0
:
for
sub_area
in
grid_area_heights
:
for
sub_area
in
grid_area_heights
:
start
=
(
sub_area
[
1
][
1
])
start
=
(
sub_area
[
1
][
2
])
end
=
(
sub_area
[
1
][
3
])
end
=
(
sub_area
[
1
][
0
])
#test data
#test data
# zone coordinates sett to be relative to the lidar data's point cloud
# zone coordinates sett to be relative to the lidar data's point cloud
print
(
"
extrem
"
,
min_point
,
"
"
,
max_point
)
print
(
"
l1 =
"
,
min_point
,
"
l2 =
"
,
max_point
)
print
(
"
finding
"
,
start
,
"
"
,
end
)
print
(
"
p1 =
"
,
start
,
"
p2 =
"
,
end
)
print
(
"
center
"
,
center
)
print
(
"
center
_lim =
"
,
center
)
print
(
"
limit
"
,
area_limit
)
print
(
"
max_lim =
"
,
area_limit
)
areazone
=
position_relative_to_pointcloud
(
min_point
,
max_point
,
start
,
end
,
center
,
area_limit
)
areazone
=
position_relative_to_pointcloud
(
min_point
,
max_point
,
start
,
end
,
center
,
area_limit
)
print
(
"
area
"
,
areazone
)
print
(
"
area
"
,
areazone
)
# calculate map zones height
# calculate map zones height
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment