Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preemptive API expansion #507

Merged
merged 2 commits into from
Dec 17, 2015
Merged

Preemptive API expansion #507

merged 2 commits into from
Dec 17, 2015

Conversation

xlz
Copy link
Member

@xlz xlz commented Dec 16, 2015

  • Add return values to Freenect2Device start(), stop(), close() so device errors can be reported.
  • Add a status field to Frame so processor errors can be reported. And a new format field. Also some minor tweaking in field ordering.

Though no actual error reporting is implemented. This only extends the API to preemptively avoid ABI breakage between 0.1 and 0.2.

This changes the current API though but most applications should be able to run without changes.

Tested with Debian, Ubuntu 14.04, Windows 8/MSVC2015, and tested with iai_kinect2.

@RyanGordon
Copy link
Contributor

Tested on MacBook Air 10.11.2 - Working fine as well

@floe floe added this to the 0.1 milestone Dec 17, 2015
@floe
Copy link
Contributor

floe commented Dec 17, 2015

This looks straightforward enough, thanks. Merging.

floe added a commit that referenced this pull request Dec 17, 2015
@floe floe merged commit 7867c9e into OpenKinect:master Dec 17, 2015
@xlz xlz deleted the preemptive-api-expansion branch December 25, 2015 03:46
@ahundt
Copy link

ahundt commented Dec 27, 2015

I think there are some issues here, a uint32_t 0.1 ms timestamp is could be too small, it would wrap in only 49 days! I know that seems like a lot but if someone just sits it on a wall watching for passerbys it could easily get that high in <2 months once the code is more hardened.

(2^32) milliseconds =
49.7102696 days

The sequence number is probably too small as well:
((2^32) / 30) * seconds =
1 657.00899 days

Perhaps it would be best to use the standard combo on unix systems, which I believe is long sec + long nanosec since the epoch in 1970? Could also be time since program startup.

For the sequence number I'm sure switching to uint64_t would be fine and preempt any problems in our lifetime. :-)

As for the format, should different orders and types be considered? For example RGBD could all be float values, or 3 chars and a float, or some other appropriate combination. gil does this in a clever way but perhaps that is too complicated, either way should other storage orders and sizes be accounted for?

@floe
Copy link
Contributor

floe commented Dec 27, 2015

I think the uint32_t for timestamp and sequence is simply what the Kinect itself sends in the packet footer, so no way to change it.

@ahundt
Copy link

ahundt commented Dec 27, 2015

Oh I see anything based on the actual hardware should definitely stay true to form. I thought it was going to be data added by the library. Kind of makes me want to leave an xbox with kinect running for 2 months to see if any shenanigans occur. Are all those fields based on hardware?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants