-
Notifications
You must be signed in to change notification settings - Fork 746
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
OpenNI2 driver #518
OpenNI2 driver #518
Conversation
Generally I will not comment on actual functionalities because first I don't know openni2 well, and second because it is isolated from the rest of the code base, as long as this works it should be acceptable. I have a few comments:
uint16_t *s2d = new uint16_t[2048]();
uint16_t *d2s = new uint16_t[10001]();
for (int i = 1; i <= 1052; i++)
s2d[i] = 342205.0/(1086.671 - i);
for (int i = 315; i <= 10000; i++)
d2s[i] = 1086.671 - 342205.0/(i + 1);
|
@@ -268,3 +269,8 @@ IF(BUILD_EXAMPLES) | |||
MESSAGE(STATUS "Configurating examples") | |||
ADD_SUBDIRECTORY(${MY_DIR}/examples) | |||
ENDIF() | |||
|
|||
IF(BUILD_OPENNI2FREENECT2DRIVER) | |||
MESSAGE(STATUS "Configurating OpenNI2 Freenect2 Driver") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Configurating" was a typo. Should use "Configuring". You can fix the typo in the above "Configurating examples" too.
…936af65766a4c140898bc3ea8
…R to BGRX color format
ef7c906
to
939cee4
Compare
85b9fc1
to
5992be3
Compare
@xlz Thank you for you comment.
These above are done.
I feel that the directory name "OpenNI2-Freenect2Driver" looks out of place in the root because of it's capitalization. So I wanted to move the directory into another place. |
This is not added yet. |
OpenNI2-FreenectDriver | ||
====================== | ||
|
||
OpenNI2-FreenectDriver is a bridge to libfreenect implemented as an OpenNI2 driver. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FreenectDriver -> Freenect2Driver
Hiding it under It becomes "drivers/OpenNI2-Freenect2...". |
@xlz I forgot to exec last 'git push', sorry.
I knew. But I thought that was better. |
I tried to build this and had multiple compilation errors. I also see several issues with the build system. I'll personally massage this patch series. I expect several changes:
|
e3e727a
to
d67cac8
Compare
I've added FindOpenNI2.cmake and I could build Protonect on Ubuntu 15.10 while I couldn't run the Protonect because the ubuntu was running in virtual machine on Mac. |
There are a few bugs in your FindOpenNI2.cmake. I don't think it works. Also, this is enough to build this driver: IF(BUILD_OPENNI2_DRIVER)
FIND_PACKAGE(OpenNI2)
IF(OpenNI2_FOUND)
FILE(GLOB OPENNI2_DRIVER_SOURCES src/openni2/*.cpp)
ADD_LIBRARY(freenect2-openni2 ${OPENNI2_DRIVER_SOURCES} ${LIBFREENECT2_THREADING_SOURCE})
TARGET_INCLUDE_DIRECTORIES(freenect2-openni2 PRIVATE ${OpenNI2_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(freenect2-openni2 freenect2 ${LIBFREENECT2_THREADING_LIBRARIES})
ENDIF()
ENDIF() I also tried to rebase your patch series cleanly, but there are something wrong in your commits that makes that almost impossible. Take a closer look at the two
case ONI_PIXEL_FORMAT_RGB888:
- reg->colorFrameRGB888(srcFrame, dstFrame);
+ if (reg->isEnabled()) {
+ libfreenect2::Frame registered(512, 424, 3);
+
+ reg->colorFrameRGB888(srcFrame, ®istered);
+
+ copyFrame(static_cast<uint8_t*>(registered.data), srcX, srcY, registered.width * registered.bytes_per_pixel,
+ static_cast<uint8_t*>(dstFrame->data), dstX, dstY, dstFrame->stride,
+ width, height, mirroring);
+ } else {
+ copyFrame(static_cast<uint8_t*>(srcFrame->data), srcX, srcY, srcFrame->width * srcFrame->bytes_per_pixel,
+ static_cast<uint8_t*>(dstFrame->data), dstX, dstY, dstFrame->stride,
+ width, height, mirroring);
+ }
The first commit is ahead of the second in the patch series, but by patch logic the first commit must be after the second commit. And even if the first commit does go after the second one, why is the registration functionality is already added before "Add registration"? I was trying to merge these commits onto other commits, which should be:
|
I put together a cleaned up patch series https://github.com/xlz/libfreenect2/commits/openni2 Each commit builds correctly. Windows specific things will be later. |
Each commit builds correctly on my Mac (OS X 10.11) too. But I had to specify '-DENABLE_OPENGL=NO' for cmake because of the NVIDIA driver problem. |
OpenNI2 driver. (#243)
rebase into head of master at 2015/12/31.
(old request was #302)