Azure-Kinect-Sensor-SDK icon indicating copy to clipboard operation
Azure-Kinect-Sensor-SDK copied to clipboard

k4a.hpp cannot access the k4a_capture_t handle from the capture class

Open yijiew opened this issue 7 years ago • 4 comments

Is your feature request related to a problem? Please describe. The C++ wrapper for capture is handy and easy to use. I would like to use the C++ wrapper in body tracking. However, there is no way I can access the k4a_capture_t handle from the class. Since the recording API requires the raw k4a_capture_t handle, there is no way I can use the capture class with the k4a recording feature.

Describe the solution you'd like Create a "handle()" function like the image class that expose allow users to access the k4a_capture_t handle from the capture class.

Describe alternatives you've considered None.

Additional context None.

yijiew avatar Jun 18 '19 17:06 yijiew

This issue also occurs when using Azure Kinect Body Tracking SDK with C ++ wrapper of Azure Kinect Sensor SDK. The second argument of k4abt_tracker_enqueue_capture() requests k4a_capture_t handle. But, there is no way to reference k4a_capture_t handle from k4a::capture class. We need to add a way to access k4a_capture_t handle to k4a::capture class.

+   k4a_capture_t get_handle() const noexcept
+   {
+       return m_handle;
+   }

private:
    k4a_capture_t m_handle;
};

UnaNancyOwen avatar Jul 29 '19 05:07 UnaNancyOwen

@UnaNancyOwen If this method would be added, would I need to call the release capture method for each k4a_capture_t returned by this method or is it enough when only the wrapper class releases the original capture once with its reset method?

RoseFlunder avatar Aug 06 '19 16:08 RoseFlunder

@RoseFlunder I’m not sure. I think it is maybe enough to just call k4a::capture::reset().

UnaNancyOwen avatar Aug 06 '19 16:08 UnaNancyOwen

@yijiew : I'm going to take this bug. This is blocking some work on the Azure Kinect ROS Driver (adding Body Tracking support) and I'd like to just quickly add a capture::handle() function (like the image:: class has) to provide access to the underlying k4a_capture_t handle.

skalldri avatar Aug 09 '19 18:08 skalldri