Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
PCPVisualTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
ik1g19
PCPVisualTool
Commits
bc877a08
Commit
bc877a08
authored
2 years ago
by
ik1g19
Browse files
Options
Downloads
Patches
Plain Diff
update_point_clouds accepts optional parameter for slam data
parent
5272aad6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pcp_gui.py
+7
-1
7 additions, 1 deletion
src/pcp_gui.py
with
7 additions
and
1 deletion
src/pcp_gui.py
+
7
−
1
View file @
bc877a08
...
@@ -12,6 +12,7 @@ import open3d.visualization.gui as gui
...
@@ -12,6 +12,7 @@ import open3d.visualization.gui as gui
class
Viewer3D
(
object
):
class
Viewer3D
(
object
):
frame_counter
=
0
frame_counter
=
0
pcd
=
None
def
__init__
(
self
,
title
):
def
__init__
(
self
,
title
):
app
=
gui
.
Application
.
instance
app
=
gui
.
Application
.
instance
...
@@ -32,6 +33,7 @@ class Viewer3D(object):
...
@@ -32,6 +33,7 @@ class Viewer3D(object):
self
.
skeletons
=
o3d
.
geometry
.
LineSet
()
self
.
skeletons
=
o3d
.
geometry
.
LineSet
()
# the name is necessary to remove from the scene
# the name is necessary to remove from the scene
self
.
skeletons_name
=
"
skeletons
"
self
.
skeletons_name
=
"
skeletons
"
self
.
slam_name
=
"
slam
"
self
.
mesh_box
=
o3d
.
geometry
.
TriangleMesh
.
create_box
(
width
=
20.0
,
self
.
mesh_box
=
o3d
.
geometry
.
TriangleMesh
.
create_box
(
width
=
20.0
,
height
=
0.1
,
height
=
0.1
,
...
@@ -44,7 +46,7 @@ class Viewer3D(object):
...
@@ -44,7 +46,7 @@ class Viewer3D(object):
self
.
skeleton_data
=
np
.
load
(
"
../input/dataset.npy
"
)
self
.
skeleton_data
=
np
.
load
(
"
../input/dataset.npy
"
)
def
update_point_clouds
(
self
):
def
update_point_clouds
(
self
,
slam
=
None
):
self
.
frame_counter
=
self
.
frame_counter
+
1
self
.
frame_counter
=
self
.
frame_counter
+
1
if
self
.
frame_counter
==
10
or
self
.
frame_counter
%
500
==
0
:
if
self
.
frame_counter
==
10
or
self
.
frame_counter
%
500
==
0
:
...
@@ -54,6 +56,8 @@ class Viewer3D(object):
...
@@ -54,6 +56,8 @@ class Viewer3D(object):
self
.
skeletons
=
Skeleton3D
.
skeleton_poses
(
poses
)
self
.
skeletons
=
Skeleton3D
.
skeleton_poses
(
poses
)
self
.
skeletons
.
colors
=
Skeleton3D
.
skeleton_paint
(
3
)
self
.
skeletons
.
colors
=
Skeleton3D
.
skeleton_paint
(
3
)
self
.
pcd
=
o3d
.
io
.
read_point_cloud
(
slam
)
if
slam
is
not
None
else
None
def
setup_o3d_scene
(
self
):
def
setup_o3d_scene
(
self
):
self
.
main_vis
.
add_geometry
(
self
.
skeletons_name
,
self
.
skeletons
)
self
.
main_vis
.
add_geometry
(
self
.
skeletons_name
,
self
.
skeletons
)
...
@@ -71,7 +75,9 @@ class Viewer3D(object):
...
@@ -71,7 +75,9 @@ class Viewer3D(object):
def
update_o3d_scene
(
self
):
def
update_o3d_scene
(
self
):
self
.
main_vis
.
remove_geometry
(
self
.
skeletons_name
)
self
.
main_vis
.
remove_geometry
(
self
.
skeletons_name
)
if
self
.
pcd
is
not
None
:
self
.
main_vis
.
remove_geometry
(
self
.
slam_name
)
self
.
main_vis
.
add_geometry
(
self
.
skeletons_name
,
self
.
skeletons
)
self
.
main_vis
.
add_geometry
(
self
.
skeletons_name
,
self
.
skeletons
)
if
self
.
pcd
is
not
None
:
self
.
main_vis
.
add_geometry
(
self
.
slam_name
,
self
.
pcd
)
def
run_one_tick
(
self
):
def
run_one_tick
(
self
):
app
=
o3d
.
visualization
.
gui
.
Application
.
instance
app
=
o3d
.
visualization
.
gui
.
Application
.
instance
...
...
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