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
ed36edb7
Commit
ed36edb7
authored
5 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Fixes
#67
gui click exception
parent
008ebdaf
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
applications/gui/src/main.cpp
+20
-2
20 additions, 2 deletions
applications/gui/src/main.cpp
components/rgbd-sources/src/source.cpp
+2
-2
2 additions, 2 deletions
components/rgbd-sources/src/source.cpp
with
22 additions
and
4 deletions
applications/gui/src/main.cpp
+
20
−
2
View file @
ed36edb7
...
...
@@ -161,7 +161,24 @@ class FTLApplication : public nanogui::Screen {
}
else
{
auto
src_
=
swindow_
->
getSource
();
if
(
src_
&&
src_
->
isReady
()
&&
down
)
{
Eigen
::
Vector4f
camPos
=
src_
->
point
(
p
[
0
],
p
[
1
]);
Eigen
::
Vector2f
screenSize
=
size
().
cast
<
float
>
();
auto
mScale
=
(
screenSize
.
cwiseQuotient
(
imageSize
).
minCoeff
());
Eigen
::
Vector2f
scaleFactor
=
mScale
*
imageSize
.
cwiseQuotient
(
screenSize
);
Eigen
::
Vector2f
positionInScreen
(
0.0
f
,
0.0
f
);
auto
mOffset
=
(
screenSize
-
(
screenSize
.
cwiseProduct
(
scaleFactor
)))
/
2
;
Eigen
::
Vector2f
positionAfterOffset
=
positionInScreen
+
mOffset
;
float
sx
=
((
float
)
p
[
0
]
-
positionAfterOffset
[
0
])
/
mScale
;
float
sy
=
((
float
)
p
[
1
]
-
positionAfterOffset
[
1
])
/
mScale
;
Eigen
::
Vector4f
camPos
;
try
{
camPos
=
src_
->
point
(
sx
,
sy
);
}
catch
(...)
{
return
true
;
}
camPos
*=
-
1.0
f
;
Eigen
::
Vector4f
worldPos
=
src_
->
getPose
()
*
camPos
;
lookPoint_
=
Eigen
::
Vector3f
(
worldPos
[
0
],
worldPos
[
1
],
worldPos
[
2
]);
...
...
@@ -195,7 +212,7 @@ class FTLApplication : public nanogui::Screen {
using
namespace
Eigen
;
auto
src_
=
swindow_
->
getSource
();
Vector2f
imageSize
(
0
,
0
)
;
imageSize
=
{
0
,
0
}
;
float
now
=
(
float
)
glfwGetTime
();
float
delta
=
now
-
ftime_
;
...
...
@@ -273,6 +290,7 @@ class FTLApplication : public nanogui::Screen {
float
lerpSpeed_
;
bool
depth_
;
float
ftime_
;
Eigen
::
Vector2f
imageSize
;
};
int
main
(
int
argc
,
char
**
argv
)
{
...
...
This diff is collapsed.
Click to expand it.
components/rgbd-sources/src/source.cpp
+
2
−
2
View file @
ed36edb7
...
...
@@ -128,8 +128,8 @@ void Source::getFrames(cv::Mat &rgb, cv::Mat &depth) {
Eigen
::
Vector4f
Source
::
point
(
uint
ux
,
uint
uy
)
{
const
auto
&
params
=
parameters
();
const
float
x
=
((
float
)
ux
-
params
.
width
/
2
)
/
(
float
)
params
.
fx
;
const
float
y
=
((
float
)
uy
-
params
.
height
/
2
)
/
(
float
)
params
.
fy
;
const
float
x
=
((
float
)
ux
-
(
float
)
params
.
cx
)
/
(
float
)
params
.
fx
;
const
float
y
=
((
float
)
uy
-
(
float
)
params
.
cy
)
/
(
float
)
params
.
fy
;
shared_lock
<
shared_mutex
>
lk
(
mutex_
);
const
float
depth
=
depth_
.
at
<
float
>
(
uy
,
ux
);
...
...
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