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
0cad90ef
Commit
0cad90ef
authored
4 years ago
by
Nicolas Pope
Browse files
Options
Downloads
Patches
Plain Diff
Tidy and log vr pose
parent
9f976481
No related branches found
No related tags found
No related merge requests found
Pipeline
#29131
failed
4 years ago
Stage: all
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/renderers/cpp/src/CUDARender.cpp
+0
-17
0 additions, 17 deletions
components/renderers/cpp/src/CUDARender.cpp
components/streams/src/renderers/openvr_render.cpp
+1
-21
1 addition, 21 deletions
components/streams/src/renderers/openvr_render.cpp
with
1 addition
and
38 deletions
components/renderers/cpp/src/CUDARender.cpp
+
0
−
17
View file @
0cad90ef
...
...
@@ -273,7 +273,6 @@ void CUDARender::_mesh(ftl::rgbd::Frame &out, const Eigen::Matrix4d &t, cudaStre
// Calculate and save virtual view screen position of each source pixel
if
(
f
.
hasChannel
(
Channel
::
Depth
))
{
LOG
(
INFO
)
<<
"DEPTH SCREEN COORD"
;
ftl
::
cuda
::
screen_coord
(
f
.
createTexture
<
float
>
(
Channel
::
Depth
),
depthbuffer
,
...
...
@@ -288,7 +287,6 @@ void CUDARender::_mesh(ftl::rgbd::Frame &out, const Eigen::Matrix4d &t, cudaStre
params_
,
transform
,
f
.
getLeftCamera
(),
stream
);
}
else
{
LOG
(
INFO
)
<<
"NON-DEPTH SCREEN COORD"
;
// Constant depth version
ftl
::
cuda
::
screen_coord
(
depthbuffer
,
...
...
@@ -304,12 +302,6 @@ void CUDARender::_mesh(ftl::rgbd::Frame &out, const Eigen::Matrix4d &t, cudaStre
depth_out_
.
to_gpumat
().
setTo
(
cv
::
Scalar
(
1000.0
f
),
cvstream
);
LOG
(
INFO
)
<<
"MESH BEFORE TRIANGLES"
;
cudaSafeCall
(
cudaStreamSynchronize
(
stream_
));
LOG
(
INFO
)
<<
"TEMP SIZE = "
<<
temp_
.
get
<
cv
::
cuda
::
GpuMat
>
((
do_blend
)
?
Channel
::
Depth
:
Channel
::
Depth2
).
size
();
LOG
(
INFO
)
<<
"Depth Buffer Size = "
<<
depthbuffer
.
width
()
<<
","
<<
depthbuffer
.
height
();
// Decide on and render triangles around each point
ftl
::
cuda
::
triangle_render1
(
depthbuffer
,
...
...
@@ -321,9 +313,6 @@ void CUDARender::_mesh(ftl::rgbd::Frame &out, const Eigen::Matrix4d &t, cudaStre
// TODO: Reproject here
// And merge based upon weight adjusted distances
LOG
(
INFO
)
<<
"MESH BLENDER"
;
cudaSafeCall
(
cudaStreamSynchronize
(
stream_
));
if
(
do_blend
)
{
// Blend this sources mesh with previous meshes
ftl
::
cuda
::
mesh_blender
(
...
...
@@ -343,9 +332,6 @@ void CUDARender::_mesh(ftl::rgbd::Frame &out, const Eigen::Matrix4d &t, cudaStre
if
(
valid_count
==
0
)
return
;
LOG
(
INFO
)
<<
"MESH PART 1"
;
cudaSafeCall
(
cudaStreamSynchronize
(
stream_
));
// Convert from int depth to float depth
//temp_.get<GpuMat>(Channel::Depth2).convertTo(out.get<GpuMat>(Channel::Depth), CV_32F, 1.0f / 100000.0f, cvstream);
...
...
@@ -668,10 +654,7 @@ bool CUDARender::submit(ftl::data::FrameSet *in, Channels<0> chans, const Eigen:
bool
success
=
true
;
try
{
LOG
(
INFO
)
<<
"START RENDERPASS 1"
;
_renderPass1
(
t
);
cudaSafeCall
(
cudaStreamSynchronize
(
stream_
));
LOG
(
INFO
)
<<
"END RENDERPASS 1"
;
}
catch
(
const
ftl
::
exception
&
e
)
{
LOG
(
ERROR
)
<<
"Exception in render: "
<<
e
.
what
();
success
=
false
;
...
...
This diff is collapsed.
Click to expand it.
components/streams/src/renderers/openvr_render.cpp
+
1
−
21
View file @
0cad90ef
...
...
@@ -261,9 +261,7 @@ bool OpenVRRender::retrieve(ftl::data::Frame &frame_out) {
int
width
=
rgbdframe
.
getLeft
().
width
;
int
height
=
rgbdframe
.
getLeft
().
height
;
LOG
(
INFO
)
<<
"WAIT GET POSE"
;
auto
vrerr
=
vr
::
VRCompositor
()
->
WaitGetPoses
(
rTrackedDevicePose_
,
vr
::
k_unMaxTrackedDeviceCount
,
NULL
,
0
);
LOG
(
INFO
)
<<
"GOT POSE"
;
if
(
vrerr
!=
vr
::
VRCompositorError_None
)
{
frame_out
.
message
(
ftl
::
data
::
Message
::
Error_OPENVR
,
"Could not get VR pose"
);
...
...
@@ -342,6 +340,7 @@ bool OpenVRRender::retrieve(ftl::data::Frame &frame_out) {
}
rgbdframe
.
setPose
()
=
initial_pose_
*
viewPose
;
LOG
(
INFO
)
<<
"VR POSE = "
<<
rgbdframe
.
getPose
();
}
else
{
LOG
(
ERROR
)
<<
"No VR Pose"
;
...
...
@@ -351,8 +350,6 @@ bool OpenVRRender::retrieve(ftl::data::Frame &frame_out) {
// TODO: Get controller data if available...
LOG
(
INFO
)
<<
"MAKE OPENGL TEXTURES"
;
texture1_
.
make
(
width
,
height
,
ftl
::
utility
::
GLTexture
::
Type
::
BGRA
);
texture2_
.
make
(
width
,
height
,
ftl
::
utility
::
GLTexture
::
Type
::
BGRA
);
...
...
@@ -373,8 +370,6 @@ bool OpenVRRender::retrieve(ftl::data::Frame &frame_out) {
ftl::operators::Poser::get(origin_name, origin);
}*/
LOG
(
INFO
)
<<
"START RENDER"
;
try
{
renderer_
->
begin
(
rgbdframe
,
ftl
::
codecs
::
Channel
::
Left
);
renderer2_
->
begin
(
rgbdframe
,
Channel
::
Colour2
);
...
...
@@ -443,7 +438,6 @@ bool OpenVRRender::retrieve(ftl::data::Frame &frame_out) {
}
}
LOG
(
INFO
)
<<
"START MIX"
;
mixer_
.
mix
();
// Write mixed audio to frame.
...
...
@@ -454,7 +448,6 @@ bool OpenVRRender::retrieve(ftl::data::Frame &frame_out) {
int
fcount
=
mixer_
.
frames
();
mixer_
.
read
(
list
.
emplace_front
().
data
(),
fcount
);
}
LOG
(
INFO
)
<<
"END MIX"
;
// TODO: Blend option
...
...
@@ -467,8 +460,6 @@ bool OpenVRRender::retrieve(ftl::data::Frame &frame_out) {
frame_out
.
message
(
ftl
::
data
::
Message
::
Error_RENDER
,
e
.
what
());
}
LOG
(
INFO
)
<<
"END RENDER"
;
if
(
!
post_pipe_
)
{
post_pipe_
=
ftl
::
config
::
create
<
ftl
::
operators
::
Graph
>
(
host
(),
"post_filters"
);
post_pipe_
->
append
<
ftl
::
operators
::
Poser
>
(
"poser"
);
...
...
@@ -478,36 +469,25 @@ bool OpenVRRender::retrieve(ftl::data::Frame &frame_out) {
post_pipe_
->
apply
(
rgbdframe
,
rgbdframe
,
0
);
LOG
(
INFO
)
<<
"END PIPELINE"
;
if
(
host_
->
value
(
"enable_touch"
,
false
))
{
ftl
::
render
::
collision2touch
(
rgbdframe
,
renderer_
->
getCollisions
(),
sets
,
my_id_
,
host_
->
value
(
"touch_min"
,
0.01
f
),
host_
->
value
(
"touch_max"
,
0.05
f
));
}
LOG
(
INFO
)
<<
"FINISHED TOUCH DATA"
;
// FIXME: Use a stream
ftl
::
cuda
::
flip
<
uchar4
>
(
rgbdframe
.
set
<
cv
::
cuda
::
GpuMat
>
(
Channel
::
Colour
),
0
);
ftl
::
cuda
::
flip
<
uchar4
>
(
rgbdframe
.
set
<
cv
::
cuda
::
GpuMat
>
(
Channel
::
Colour2
),
0
);
LOG
(
INFO
)
<<
"DONE FLIP"
;
texture1_
.
unmap
(
renderer_
->
getCUDAStream
());
texture2_
.
unmap
(
renderer2_
->
getCUDAStream
());
//return true;
LOG
(
INFO
)
<<
"UNMAP AND SEND TO VR"
;
// Send left and right textures to VR headset
vr
::
Texture_t
leftEyeTexture
=
{(
void
*
)(
uintptr_t
)
texture1_
.
texture
(),
vr
::
TextureType_OpenGL
,
vr
::
ColorSpace_Gamma
};
vr
::
VRCompositor
()
->
Submit
(
vr
::
Eye_Left
,
&
leftEyeTexture
);
vr
::
Texture_t
rightEyeTexture
=
{(
void
*
)(
uintptr_t
)
texture2_
.
texture
(),
vr
::
TextureType_OpenGL
,
vr
::
ColorSpace_Gamma
};
vr
::
VRCompositor
()
->
Submit
(
vr
::
Eye_Right
,
&
rightEyeTexture
);
LOG
(
INFO
)
<<
"ABOUT TO FLUSH"
;
glFlush
();
LOG
(
INFO
)
<<
"FINISH VR FRAME"
;
}
return
true
;
...
...
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