This repository was archived by the owner on Jul 26, 2024. It is now read-only.
Use a separate thread to pop k4abt_tracker result. Fix #109. #161
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #109
Description of the changes:
k4abt_tracker_
and publishing body_tracking_data following the suggestion from this post:Before submitting a Pull Request:
I tested changes on:
I measured the delay by adding
ROS_INFO_STREAM("Body tracking delay: " << (ros::Time::now() - capture_time).toSec() * 1000.0 << " ms.");
below Line 990Azure_Kinect_ROS_Driver/src/k4a_ros_device.cpp
Line 990 in 87d10fa
roslaunch azure_kinect_ros_driver driver.launch fps:=30 depth_mode:=WFOV_2X2BINNED body_tracking_enabled:=true
. The delay increases quickly from 80 ms to around 280 ms on my laptop if/when I run some light-weight tasks such as opening a new webpage in Chrome browser or scrolling up/down in vscode editor. (Laptop specs: Intel® Core™ i7-9750H CPU @ 2.60GHz × 12 , GeForce RTX 2060, 32 GB RAM)By moving
Azure_Kinect_ROS_Driver/src/k4a_ros_device.cpp
Lines 990 to 1039 in 87d10fa
Alternatively the delay can be measured by
printTimestampDebugMessage("Body tracking", capture_time);
, runningroslaunch azure_kinect_ros_driver driver.launch fps:=30 depth_mode:=WFOV_2X2BINNED body_tracking_enabled:=true imu_rate_target:=3
and change log verbosity level to debug.