this runs for awhile before crashing (still no point cloud)

This commit is contained in:
Brandon Thomas committed 2020-04-18 23:22:48 -04:00
1 parent e192369bb8
commit e62ff78730
3 files changed
+22 -4

No files matched your search

+18 -2
View File
@@ -23,7 +23,7 @@ use sensor_control::CaptureProvider;
use point_cloud;
use point_cloud::point_cloud_compute_shader::PointCloudComputeShader;
use point_cloud::point_cloud_renderer_shader::PointCloudRendererShader;
use point_cloud::point_cloud_visualiser::PointCloudVisualizer;
use point_cloud::point_cloud_visualiser::{PointCloudVisualizer, PointCloudVisualizerError};
use point_cloud::viewer_image::ViewerImage;
//use shader::Shader;
@@ -335,7 +335,23 @@ pub fn run(capture_provider: Arc<CaptureProvider>, calibration_data: k4a_sys::k4
// TODO: This belongs in a worker thread with buffers on both producer and consumer.
if let Some(capture) = capture_provider.get_capture() {
//visualizer.update_texture(&texture, &capture);
println!("Got capture");
visualizer.update_texture(&texture, &capture)
.map(|_| {
println!("UPDATED TEXTURE!");
})
.map_err(|err| {
match err {
PointCloudVisualizerError::MissingDepthImage => { println!("Missing depth image"); },
PointCloudVisualizerError::MissingColorImage => { println!("Missing color image"); },
_ => {
unreachable!("Error: {:?}", err);
}
}
});
println!("Updated capture");
gl_window.swap_buffers().unwrap();
}
});
}
@@ -281,7 +281,7 @@ impl PointCloudRendererShader {
// void PointCloudRenderer::UpdateViewProjection(mat4x4 view, mat4x4 projection)
//mat4x4_dup(m_view, view);
//mat4x4_dup(m_projection, projection);
unimplemented!();
//unimplemented!();
}
pub fn update_point_clouds(&mut self, color_image: &k4a_sys_wrapper::Image,
@@ -398,6 +398,7 @@ impl PointCloudRendererShader {
// Render point cloud
gl::BindVertexArray(self.vertex_array_object.id());
println!("gl::DrawArrays - points in the point cloud");
gl::DrawArrays(
gl::POINTS,
0,
+2 -1
View File
@@ -215,6 +215,7 @@ impl PointCloudVisualizer {
// gl::FramebufferTexture(gl::FRAMEBUFFER, gl::COLOR_ATTACHMENT0, texture_buffer, 0);
//gl::FramebufferTexture(gl::FRAMEBUFFER, gl::COLOR_ATTACHMENT0, texture, 0);
println!("gl::DrawBuffers");
gl::DrawBuffers(1, &gl::COLOR_ATTACHMENT0);
let frame_buffer_status = gl::CheckFramebufferStatus(gl::FRAMEBUFFER);
@@ -248,7 +249,7 @@ impl PointCloudVisualizer {
Ok(img) => img,
Err(e) => {
// Capture doesn't have depth info. Drop the capture.
return Err(PointCloudVisualizerError::MissingDepthImage)
return Err(PointCloudVisualizerError::MissingDepthImage);
},
};