From fcdee8628e233a1c786a43cf81da071412f72f9a Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Sun, 20 Mar 2022 04:47:28 -0400 Subject: [PATCH] wip --- .../capture/multi_device_capturer.rs | 24 +++++++++++-------- src/main_opencv.rs | 2 +- .../shaders/point_cloud_fragment_shader.glsl | 7 +++++- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/azure_kinect/capture/multi_device_capturer.rs b/src/azure_kinect/capture/multi_device_capturer.rs index c7e67e1bf3..82213a77ee 100644 --- a/src/azure_kinect/capture/multi_device_capturer.rs +++ b/src/azure_kinect/capture/multi_device_capturer.rs @@ -41,11 +41,13 @@ impl MultiDeviceCapturer { let mut device = Device::open(i).unwrap(); let jack_status = device.get_synchronization_jack_status().unwrap(); - if jack_status.sync_out_jack_connected && !jack_status.sync_in_jack_connected { - if primary_device.is_some() { - // NB: This assumes a daisy chain topology. - panic!("We already one primary device. We can't have two."); - } + // TODO/NB(2022-03-20): This is broken + //if jack_status.sync_out_jack_connected && !jack_status.sync_in_jack_connected { + if primary_device.is_none() { + //if primary_device.is_some() { + // // NB: This assumes a daisy chain topology. + // panic!("We already one primary device. We can't have two."); + //} let calibration = device.get_calibration(depth_mode, color_format).unwrap(); @@ -55,9 +57,10 @@ impl MultiDeviceCapturer { continue; } - if !jack_status.sync_in_jack_connected { - panic!("Secondary device does not have 'in' jack connected!"); - } + // TODO/NB(2022-03-20): This is broken + //if !jack_status.sync_in_jack_connected { + // panic!("Secondary device does not have 'in' jack connected!"); + //} let calibration = device.get_calibration(depth_mode, color_format).unwrap(); @@ -200,8 +203,9 @@ pub fn start_capture_thread(capturer: MultiDeviceCapturer) { fn get_primary_device_config() -> DeviceConfiguration { let mut config = get_default_device_config(); - config.wired_sync_mode = k4a_sys::k4a_wired_sync_mode_t_K4A_WIRED_SYNC_MODE_MASTER; - config.synchronized_images_only = true; + // TODO/NB(2022-03-20): This is broken + //config.wired_sync_mode = k4a_sys::k4a_wired_sync_mode_t_K4A_WIRED_SYNC_MODE_MASTER; + //config.synchronized_images_only = true; // Two depth images should be seperated by MIN_TIME_BETWEEN_DEPTH_CAMERA_PICTURES_USEC to ensure the depth imaging // sensor doesn't interfere with the other. To accomplish this the master depth image captures diff --git a/src/main_opencv.rs b/src/main_opencv.rs index 877a3e6a53..cb898f1727 100644 --- a/src/main_opencv.rs +++ b/src/main_opencv.rs @@ -109,7 +109,7 @@ pub fn main() -> AnyhowResult<()> { }; let capture_provider: Arc = if opts.enable_cameras { - let multi_device = MultiDeviceCapturer::new(2, Some(1)) + let multi_device = MultiDeviceCapturer::new(1, None) .expect("multi-device create"); multi_device.start_cameras().expect("start cameras"); diff --git a/src/point_cloud/shaders/point_cloud_fragment_shader.glsl b/src/point_cloud/shaders/point_cloud_fragment_shader.glsl index 01d972c84f..53ae323063 100644 --- a/src/point_cloud/shaders/point_cloud_fragment_shader.glsl +++ b/src/point_cloud/shaders/point_cloud_fragment_shader.glsl @@ -24,7 +24,12 @@ void main() { // Object mode vec2 coord = texCoord; - fragmentColor = texture2D(objTexture, coord); + + // TODO/NB(2022-03-20): This is broken - why did GLSL break!? + //fragmentColor = texture2D(objTexture, coord); + //fragmentColor = texture(objTexture, coord); + //fragmentColor = vec4(0, 0, 0, 0); + fragmentColor = vertexColor; } else if (vertexType == 2) {