Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ftl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Nicolas Pope
ftl
Commits
d26a07cb
Commit
d26a07cb
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Remove recon disp, fix key controls
parent
a766c238
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
applications/gui/src/main.cpp
+12
-6
12 additions, 6 deletions
applications/gui/src/main.cpp
applications/reconstruct/src/main.cpp
+7
-8
7 additions, 8 deletions
applications/reconstruct/src/main.cpp
components/rgbd-sources/src/net.cpp
+1
-1
1 addition, 1 deletion
components/rgbd-sources/src/net.cpp
with
20 additions
and
15 deletions
applications/gui/src/main.cpp
+
12
−
6
View file @
d26a07cb
...
...
@@ -128,6 +128,7 @@ class FTLApplication : public nanogui::Screen {
lookPoint_
=
Eigen
::
Vector3f
(
0.0
f
,
0.0
f
,
-
4.0
f
);
lerpSpeed_
=
0.4
f
;
depth_
=
false
;
ftime_
=
(
float
)
glfwGetTime
();
mShader
.
init
(
"RGBDShader"
,
defaultImageViewVertexShader
,
defaultImageViewFragmentShader
);
...
...
@@ -175,14 +176,14 @@ class FTLApplication : public nanogui::Screen {
if
(
Screen
::
keyboardEvent
(
key
,
scancode
,
action
,
modifiers
))
{
return
true
;
}
else
{
LOG
(
INFO
)
<<
"Key press"
<<
key
<<
" - "
<<
action
;
if
(
key
==
81
||
key
==
83
)
{
LOG
(
INFO
)
<<
"Key press
"
<<
key
<<
" - "
<<
action
;
if
(
key
==
263
||
key
==
262
)
{
// TODO Should rotate around lookAt object, but requires correct depth
Eigen
::
Quaternion
<
float
>
q
;
q
=
Eigen
::
AngleAxis
<
float
>
((
key
==
81
)
?
0.01
f
:
-
0.01
f
,
up_
);
Eigen
::
Quaternion
<
float
>
q
;
q
=
Eigen
::
AngleAxis
<
float
>
((
key
==
262
)
?
0.01
f
:
-
0.01
f
,
up_
);
eye_
=
(
q
*
(
eye_
-
centre_
))
+
centre_
;
return
true
;
}
else
if
(
key
==
8
4
||
key
==
8
2
)
{
float
scalar
=
(
key
==
8
4
)
?
0.99
f
:
1.01
f
;
}
else
if
(
key
==
26
4
||
key
==
2
65
)
{
float
scalar
=
(
key
==
26
4
)
?
0.99
f
:
1.01
f
;
eye_
=
((
eye_
-
centre_
)
*
scalar
)
+
centre_
;
return
true
;
}
...
...
@@ -196,9 +197,13 @@ class FTLApplication : public nanogui::Screen {
auto
src_
=
swindow_
->
getSource
();
Vector2f
imageSize
(
0
,
0
);
float
now
=
(
float
)
glfwGetTime
();
float
delta
=
now
-
ftime_
;
ftime_
=
now
;
if
(
src_
)
{
cv
::
Mat
rgb
,
depth
;
centre_
+=
(
lookPoint_
-
centre_
)
*
(
lerpSpeed_
*
0.1
f
);
centre_
+=
(
lookPoint_
-
centre_
)
*
(
lerpSpeed_
*
delta
);
Eigen
::
Matrix4f
viewPose
=
lookAt
<
float
>
(
eye_
,
centre_
,
up_
).
inverse
();
src_
->
setPose
(
viewPose
);
...
...
@@ -267,6 +272,7 @@ class FTLApplication : public nanogui::Screen {
Eigen
::
Vector3f
lookPoint_
;
float
lerpSpeed_
;
bool
depth_
;
float
ftime_
;
};
int
main
(
int
argc
,
char
**
argv
)
{
...
...
This diff is collapsed.
Click to expand it.
applications/reconstruct/src/main.cpp
+
7
−
8
View file @
d26a07cb
...
...
@@ -156,7 +156,7 @@ static void run(ftl::Configurable *root) {
LOG
(
INFO
)
<<
"Using sources:"
;
for
(
auto
&
input
:
inputs
)
{
LOG
(
INFO
)
<<
" "
+
(
string
)
input
.
source
->
getURI
();
}
ftl
::
rgbd
::
Display
*
display
=
ftl
::
create
<
ftl
::
rgbd
::
Display
>
(
root
,
"display"
);
//
ftl::rgbd::Display *display = ftl::create<ftl::rgbd::Display>(root, "display");
ftl
::
rgbd
::
Source
*
virt
=
ftl
::
create
<
ftl
::
rgbd
::
Source
>
(
root
,
"virtual"
,
net
);
auto
virtimpl
=
new
ftl
::
rgbd
::
VirtualSource
(
virt
);
...
...
@@ -164,7 +164,7 @@ static void run(ftl::Configurable *root) {
ftl
::
voxhash
::
SceneRep
*
scene
=
ftl
::
create
<
ftl
::
voxhash
::
SceneRep
>
(
root
,
"voxelhash"
);
virtimpl
->
setScene
(
scene
);
display
->
setSource
(
virt
);
//
display->setSource(virt);
ftl
::
rgbd
::
Streamer
*
stream
=
ftl
::
create
<
ftl
::
rgbd
::
Streamer
>
(
root
,
"stream"
,
net
);
stream
->
add
(
virt
);
...
...
@@ -177,12 +177,12 @@ static void run(ftl::Configurable *root) {
bool
paused
=
false
;
// Keyboard camera controls
display
->
onKey
([
&
paused
](
int
key
)
{
if
(
key
==
32
)
paused
=
!
paused
;
});
//
display->onKey([&paused](int key) {
//
if (key == 32) paused = !paused;
//
});
int
active
=
inputs
.
size
();
while
(
ftl
::
running
&&
display
->
active
()
)
{
while
(
ftl
::
running
)
{
if
(
active
==
0
)
{
LOG
(
INFO
)
<<
"Waiting for sources..."
;
sleep_for
(
milliseconds
(
1000
));
...
...
@@ -203,7 +203,6 @@ static void run(ftl::Configurable *root) {
auto
&
cam
=
inputs
[
i
];
auto
in
=
inputs
[
i
].
source
;
if
(
cam
.
params
.
m_imageWidth
==
0
)
{
LOG
(
INFO
)
<<
"SETTING UP CAM PARAMS: "
<<
in
->
parameters
().
fx
;
cam
.
params
.
fx
=
in
->
parameters
().
fx
;
cam
.
params
.
fy
=
in
->
parameters
().
fy
;
cam
.
params
.
mx
=
-
in
->
parameters
().
cx
;
...
...
@@ -246,7 +245,7 @@ static void run(ftl::Configurable *root) {
frameCount
++
;
stream
->
poll
();
display
->
update
();
//
display->update();
//sleep_for(milliseconds(10));
}
}
...
...
This diff is collapsed.
Click to expand it.
components/rgbd-sources/src/net.cpp
+
1
−
1
View file @
d26a07cb
...
...
@@ -89,7 +89,7 @@ void NetSource::setPose(const Eigen::Matrix4f &pose) {
}
catch
(...)
{
}
Source
::
setPose
(
pose
);
//
Source::setPose(pose);
}
void
NetSource
::
_updateURI
()
{
...
...
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