Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Added k4a_image_get/set_system_timestamp_nsec #350

Merged
merged 11 commits into from
May 31, 2019

Conversation

wes-b
Copy link
Contributor

@wes-b wes-b commented May 15, 2019

Fixes #198

Description of the changes:

  • Added k4a_image_get_system_timestamp_nsec() & k4a_image_set_system_timestamp_nsec().
  • Added k4a_image_get_device_timestamp_usec().
  • Added k4a_image_set_exposure_usec().
  • Deprecated k4a_image_get_timestamp_usec() & k4a_image_set_timestamp_usec().
  • Deprecated k4a_image_set_exposure_time_usec().
  • System Timestamp on Windows is based on QueryPerformanceCounter, while Linux is based on clock_gettime(CLOCK_MONOTONIC). There is a nice writeup here: ros2/rcutils#43.
  • libuvc needed to be updated to capture the time at the completion of last USB packet. So libuvc was converted from a patch to a fork.

Before submitting a Pull Request:

I tested changes on:

  • Windows
  • Linux

…mestamp_nsec.

libuvc is now a forked repo with patches applied to Azure-Kinect branch.
Updated libuvc so it can report capture_time
CHANGELOG.md Outdated Show resolved Hide resolved
include/k4a/k4a.hpp Outdated Show resolved Hide resolved
@williampMSFT
Copy link
Contributor

                                                   k4a_imu_sample_t *imu_sample,

This may be out of scope for this change, but figured I'd mention it:
k4a_imu_sample_t has (presumably device) timestamps embedded in it - do we need to provide a facility for getting system timestamps for IMU samples?


Refers to: include/k4a/k4a.h:255 in ac64c8d. [](commit_id = ac64c8d, deletion_comment = False)

CHANGELOG.md Outdated Show resolved Hide resolved
.gitmodules Show resolved Hide resolved
CHANGELOG.md Show resolved Hide resolved
include/k4a/k4a.h Outdated Show resolved Hide resolved
include/k4a/k4a.h Show resolved Hide resolved
src/color/mfcamerareader.cpp Outdated Show resolved Hide resolved
src/image/image.c Show resolved Hide resolved
tests/ColorTests/FunctionalTest/color_ft.cpp Show resolved Hide resolved
tests/TestUtil/Capture.cpp Outdated Show resolved Hide resolved
tests/TestUtil/Capture.cpp Outdated Show resolved Hide resolved
@wes-b wes-b requested review from schultetwin1 and xthexder May 30, 2019 18:57
Copy link
Contributor

@schultetwin1 schultetwin1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just have 1 comment about a change to the MIN macro.

include/k4ainternal/common.h Show resolved Hide resolved
Copy link
Contributor

@schultetwin1 schultetwin1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to contributiuon policies, changing this to request changes since I would like MIN changed.

@wes-b
Copy link
Contributor Author

wes-b commented May 31, 2019

__typeof__ is not C, I got lucky building before because that macro was never used in C code. I am reverting the change.

@schultetwin1
Copy link
Contributor

__typeof__ is not C, I got lucky building before because that macro was never used in C code. I am reverting the change.

Ugh, its a GNU extension. Good find. If we are never using these MIN and MAX macros in C code, then should we include them? C++ provides a much safer std::max and std::min that we can use.

@schultetwin1
Copy link
Contributor

__typeof__ is not C, I got lucky building before because that macro was never used in C code. I am reverting the change.

Ugh, its a GNU extension. Good find. If we are never using these MIN and MAX macros in C code, then should we include them? C++ provides a much safer std::max and std::min that we can use.

Talked with Wes offline, we are using these macros in C code. Looks good to me!

@wes-b wes-b merged commit 3a7edce into microsoft:develop May 31, 2019
@wes-b wes-b deleted the user/wesb/system_time branch June 7, 2019 15:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide method to convert device timestamps to system timestamps
4 participants