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

[realsense2] Enable OpenNI2 driver option #5275

Merged
merged 6 commits into from
Jun 17, 2019

Conversation

UnaNancyOwen
Copy link
Contributor

@vicroms vicroms self-assigned this Jan 31, 2019
@UnaNancyOwen UnaNancyOwen force-pushed the update_realsense branch 2 times, most recently from 263e262 to f69353a Compare February 1, 2019 13:14
Update realsense2 port to librealsense v2.18.0.
@UnaNancyOwen
Copy link
Contributor Author

@vicroms Why did you do this operation?
What should I do something next?

@vicroms
Copy link
Member

vicroms commented Feb 7, 2019

@UnaNancyOwen

I had a local branch of this PR for testing that became outdated, I had to merge it with master in order to get regression results from the CI system.

Please feel free to revert my commits if they had an adverse effect.

Also, the CI build reported regressions on x86, x64, and x64-static that I haven't been able to reproduce locally, which is strange... I'll queue a fresh build and wait for results.

Add OpenNI2 driver option.
@UnaNancyOwen
Copy link
Contributor Author

@vicroms I fixed some problem.

@vicroms
Copy link
Member

vicroms commented Mar 5, 2019

Hi @UnaNancyOwen

Sorry for the long delay. I tried installing realsense2[core,tools,openni2]:x64-windows locally, openni2 is installed correctly but the build for realsense2 fails with the following log output:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\CL.exe /c
    /I"D:\vcpkg\buildtrees\realsense2\src\v2.18.0-5ace468cc5\realsense2" 
    /I"D:\vcpkg\buildtrees\realsense2\src\v2.18.0-5ace468cc5\src" 
    /I"D:\vcpkg\buildtrees\realsense2\src\v2.18.0-5ace468cc5\include" 
    /I"D:\vcpkg\buildtrees\realsense2\src\v2.18.0-5ace468cc5\third-party\glfw\include" 
    /Z7 /W3 /WX- /diagnostics:classic /MP /O2 /Oi /D WIN32 /D _WINDOWS /D NDEBUG /D _UNICODE 
    /D NOMINMAX /D ELPP_THREAD_SAFE /D ELPP_NO_DEFAULT_LOG_FILE /D BUILD_EASYLOGGINGPP 
    /D HWM_OVER_XU /D ENFORCE_METADATA /D RS2_USE_WMF_BACKEND /D UNICODE /D __SSSE3__ 
    /D _CRT_SECURE_NO_WARNINGS /D "CMAKE_INTDIR=\"Release\"" /D _UNICODE /D UNICODE /Gm- 
    /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"rs-color.dir\Release\\" 
    /Fd"rs-color.dir\Release\vc141.pdb" /Gd /TC /FC /errorReport:queue  /utf-8 
    "D:\vcpkg\buildtrees\realsense2\src\v2.18.0-5ace468cc5\examples\C\color\rs-color.c"
.
.
.
30> D:\vcpkg\buildtrees\realsense2\src\v2.18.0-5ace468cc5\wrappers\openni2\src\rs2base.h(3): 
    fatal error C1083:
        Cannot open include file: 'Driver/OniDriverAPI.h': 
        No such file or directory (compiling source file 
            D:\vcpkg\buildtrees\realsense2\src\v2.18.05ace468cc5\wrappers\openni2\src\Rs2Base.cpp)

It looks like the build is not finding the installed OpenNI2 headers.

@UnaNancyOwen
Copy link
Contributor Author

@vicroms Thanks, I fixed it. Please re-confirm.

@vicroms
Copy link
Member

vicroms commented Mar 6, 2019

Looks like that fixed the build with the OpenNI feature, however we still have problems in the CI machine.

Specifically, it fails in the configure step when trying to fetch libusb from git.
Can you make it so that it depends on the libusb installed by vcpkg?

-- Use external libusb
CMake Error at D:/downloads/tools/cmake-3.12.4-windows/cmake-3.12.4-win32-x86/share/cmake-3.12/Modules/ExternalProject.cmake:2324 (message):
  error: could not find git for clone of libusb
Call Stack (most recent call first):
  D:/downloads/tools/cmake-3.12.4-windows/cmake-3.12.4-win32-x86/share/cmake-3.12/Modules/ExternalProject.cmake:3100 (_ep_add_download_command)
  CMake/external_libusb.cmake:4 (ExternalProject_Add)
  CMake/windows_config.cmake:41 (include)
  CMakeLists.txt:17 (os_set_flags)

@vicroms vicroms added the wip label Mar 6, 2019
@UnaNancyOwen
Copy link
Contributor Author

UnaNancyOwen commented Mar 7, 2019

Hmmm, libusb port can not be installed on my environments.
Were you able to install it? vcpkg install libusb:x64-windows

@vicroms
Copy link
Member

vicroms commented Mar 7, 2019

I'm able to install libusb:x64-windows.

I'm using the latest portfile version from master 1.0.22-1.
Can you see why it fails for you in the output logs?

PS D:\github\vcpkg> ./vcpkg install libusb:x64-windows --no-binarycaching
The following packages will be built and installed:
    libusb[core]:x64-windows
Starting package 1/1: libusb:x64-windows
Building package libusb[core]:x64-windows...
-- Downloading https://github.com/libusb/libusb/archive/v1.0.22.tar.gz...
-- Extracting source D:/github/vcpkg/downloads/libusb-libusb-v1.0.22.tar.gz
-- Using source at D:/github/vcpkg/buildtrees/libusb/src/v1.0.22-f45a56be59
-- Building msvc/libusb_dll_2017.vcxproj for Release
-- Building msvc/libusb_dll_2017.vcxproj for Debug
-- Installing: D:/github/vcpkg/packages/libusb_x64-windows/share/libusb/copyright
-- Installing: D:/github/vcpkg/packages/libusb_x64-windows/include/libusb-1.0/libusb.h
-- Performing post-build validation
-- Performing post-build validation done
Building package libusb[core]:x64-windows... done
Installing package libusb[core]:x64-windows...
Installing package libusb[core]:x64-windows... done

@UnaNancyOwen
Copy link
Contributor Author

It is this error libusb/libusb#207.
It seems to be occure problem on multi-byte character locale such as Japanese.
I think that it should make the same fix as this patch to libusb port.

c:\vcpkg\buildtrees\libusb\x64-windows-rel\v1.0.22-f45a56be59\libusb\strerror.c(111): error C2001: newline in constant [C:\vcpkg\buildtrees\libusb\x64-windows-rel\v1.0.22-f45a56be59\msvc\libusb_dll_2017.vcxproj]
c:\vcpkg\buildtrees\libusb\x64-windows-rel\v1.0.22-f45a56be59\libusb\strerror.c(117): error C2001: newline in constant [C:\vcpkg\buildtrees\libusb\x64-windows-rel\v1.0.22-f45a56be59\msvc\libusb_dll_2017.vcxproj]

@UnaNancyOwen
Copy link
Contributor Author

Can you make it so that it depends on the libusb installed by vcpkg?

@vicroms I tried it, but I gave up because it was difficult for me at least. :'(

@grdowns grdowns self-assigned this Apr 12, 2019
@vicroms
Copy link
Member

vicroms commented May 16, 2019

Update to 2.19 is being handled in PR #5777

@UnaNancyOwen
Can the scope of this PR be reduced to adding NI driver support?
I seem to recall that working OK at least locally.

@UnaNancyOwen
Copy link
Contributor Author

@vicroms No, OpenNI2 driver is included since RealSense SDK v2.16.2 (or later). However, This port is RealSense SDK v2.16.1 in the current vcpkg (master/HEAD).
Therefore, It is necessary to update RealSense SDK to v2.16.2 (or later) to implement OpenNI2 driver option. (I suggest to implement this option after merged #5777. )

@vicroms vicroms removed their assignment Jun 4, 2019
@ras0219-msft ras0219-msft assigned vicroms and unassigned grdowns Jun 11, 2019
@vicroms vicroms changed the title [realsense2] Update to v2.18.0 [realsense2] Enable OpenNI2 driver option Jun 17, 2019
@vicroms vicroms merged commit 5e9ccbc into microsoft:master Jun 17, 2019
@vicroms
Copy link
Member

vicroms commented Jun 17, 2019

@UnaNancyOwen

Thanks for the PR!

@@ -63,5 +70,11 @@ if(BUILD_EXAMPLES)
endif()
endif()


if(BUILD_OPENNI2_BINDINGS)
file(COPY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/_out/rs2driver*
Copy link
Contributor

Choose a reason for hiding this comment

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

error

CMake Error at ports/realsense2/portfile.cmake:75 (file):
file COPY cannot find
"E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver*".
Call Stack (most recent call first):
scripts/ports.cmake:74 (include)

ls E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver*

E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver.dll
E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver.dll.manifest
E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver.exp
E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver.lib
E:/tools/vcpkg/buildtrees/realsense2/x64-windows-rel/_out/rs2driver.pdb

copy tools /openni2 ? *.lib? why?

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