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

structure sensor on jetson tx1 (aarch64) #101

Open
fpilote opened this issue Sep 13, 2016 · 6 comments
Open

structure sensor on jetson tx1 (aarch64) #101

fpilote opened this issue Sep 13, 2016 · 6 comments

Comments

@fpilote
Copy link

fpilote commented Sep 13, 2016

Hi, i'm trying to use the structure sensor, using openni2 on the nvidia jetson tx1 board.
i'm having trouble running the samples.

I had to make small change to get it to compile on aarch64 (arm-64) but i mostly copied and simplified the existing makefiles for arm.

can't find much info on using this specific camera on the tx1 though i can find some on the previous version of this board, the tk1.

Does anybody can help me out with this? Or better, would anyone with a similar setup would be interested in trying to make it work on their side? Thanks for your time guys.

here is the output from SimpleRead sample with verbose level = 0

ubuntu@tegra-ubuntu:~/OpenNI2/Bin/aarch64-Release$ ./SimpleRead
1374 INFO New log started on 2016-09-13 15:04:59
1794 INFO --- Filter Info --- Minimum Severity: VERBOSE
2234 VERBOSE No override device in configuration file
3179 VERBOSE Configuration has been read from './OpenNI.ini'
3377 VERBOSE OpenNI 2.2.0 (Build 33)-Linux-Arm (Sep 13 2016 15:02:36)
3520 VERBOSE Using './OpenNI2/Drivers' as driver path
3702 VERBOSE Looking for drivers in drivers repository './OpenNI2/Drivers'
20744 INFO New log started on 2016-09-13 15:04:59
20816 INFO --- Filter Info --- Minimum Severity: VERBOSE
20879 VERBOSE Initializing USB...
23969 INFO USB is initialized.
24111 INFO Device connected: PrimeSense PS1080 (1d27/0600@1/3)
26713 INFO New log started on 2016-09-13 15:04:59
26781 INFO --- Filter Info --- Minimum Severity: VERBOSE
26845 VERBOSE Initializing USB...
29669 INFO USB is initialized.
29821 VERBOSE Trying to open device by URI '(NULL)'
30416 VERBOSE Initializing device sensor...
30603 VERBOSE Configuring module 'Device' from section 'Device' in file '/home/ubuntu/OpenNI2/Bin/aarch64-Release/OpenNI2/Drivers/PS1080.ini'...
30769 INFO Module 'Device' configuration was loaded from file.
30831 VERBOSE Connecting to USB device...
30877 VERBOSE Trying to open sensor '1d27/0600@1/3'...
5276333 VERBOSE Starting libusb asynch thread...
5278864 WARNING Failed to set thread priority (1) - (1)
5279489 WARNING USB events thread: Failed to set thread priority to critical. This might cause loss of data...
Warning: USB events thread - failed to set priority. This might cause loss of data...
5280557 VERBOSE Trying to open endpoint 0x4 for control out (for old firmwares)...
5282246 INFO Connected to USB device
5319104 VERBOSE Getting hardware versions...
30833501 ERROR Get version failed: USB transfer timeout!
32834538 VERBOSE Getting hardware versions...
58346917 ERROR Get version failed: USB transfer timeout!
58347317 VERBOSE Getting hardware versions...
83860843 ERROR Get version failed: USB transfer timeout!
83861230 VERBOSE Shutting down USB depth read thread...
83861422 VERBOSE Shutting down USB image read thread...
83863406 VERBOSE Shutting down USB events thread...
83865091 VERBOSE Device closed successfully
83865824 VERBOSE Shutting down Scheduler thread...
Couldn't open device
Could not open "1d27/0600@1/3": USB transfer timeout!

using SUDO, the program is able to correctly set the thread priority :

ubuntu@tegra-ubuntu:~/OpenNI2/Bin/aarch64-Release$ sudo ./SimpleRead
344 INFO New log started on 2016-09-13 15:10:09
451 INFO --- Filter Info --- Minimum Severity: VERBOSE
552 VERBOSE No override device in configuration file
627 VERBOSE Configuration has been read from './OpenNI.ini'
841 VERBOSE OpenNI 2.2.0 (Build 33)-Linux-Arm (Sep 13 2016 15:02:36)
883 VERBOSE Using './OpenNI2/Drivers' as driver path
930 VERBOSE Looking for drivers in drivers repository './OpenNI2/Drivers'
5266 INFO New log started on 2016-09-13 15:10:09
5336 INFO --- Filter Info --- Minimum Severity: VERBOSE
5393 VERBOSE Initializing USB...
8890 INFO USB is initialized.
9019 INFO Device connected: PrimeSense PS1080 (1d27/0600@1/3)
10039 INFO New log started on 2016-09-13 15:10:09
10104 INFO --- Filter Info --- Minimum Severity: VERBOSE
10161 VERBOSE Initializing USB...
16149 INFO USB is initialized.
16260 VERBOSE Trying to open device by URI '(NULL)'
17001 VERBOSE Initializing device sensor...
17127 VERBOSE Configuring module 'Device' from section 'Device' in file '/home/ubuntu/OpenNI2/Bin/aarch64-Release/OpenNI2/Drivers/PS1080.ini'...
18021 INFO Module 'Device' configuration was loaded from file.
18059 VERBOSE Connecting to USB device...
18387 VERBOSE Trying to open sensor '1d27/0600@1/3'...
5272756 VERBOSE Starting libusb asynch thread...
5274641 VERBOSE Trying to open endpoint 0x4 for control out (for old firmwares)...
5278283 INFO Connected to USB device
5337926 VERBOSE Getting hardware versions...
30850496 ERROR Get version failed: USB transfer timeout!
32854179 VERBOSE Getting hardware versions...
58368169 ERROR Get version failed: USB transfer timeout!
58368939 VERBOSE Getting hardware versions...
83883152 ERROR Get version failed: USB transfer timeout!
83883856 VERBOSE Shutting down USB depth read thread...
83884670 VERBOSE Shutting down USB image read thread...
83886246 VERBOSE Shutting down USB events thread...
83886761 VERBOSE Device closed successfully
83887274 VERBOSE Shutting down Scheduler thread...
Couldn't open device
Could not open "1d27/0600@1/3": USB transfer timeout!

some info on the board/os :

uname -a

Linux tegra-ubuntu 3.10.67-g458d45c #2 SMP PREEMPT Wed Aug 24 17:25:02 UTC 2016 aarch64 aarch64 aarch64 GNU/Linux

lsusb

Bus 002 Device 002: ID 0955:09ff NVidia Corp. Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 003: ID 1d27:0600 ASUS Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

@dtmoodie
Copy link

dtmoodie commented Jan 7, 2017

Hello I'm working through the same issue. How did you set verbose?

@fpilote
Copy link
Author

fpilote commented Jan 9, 2017

i don't remember changing anything for the verbose level.

Though i realised that the verbose level is read from OpenNI.ini file (from the log output)

ubuntu@tegra-ubuntu:~/OpenNI2$ locate OpenNI.ini
/etc/openni2/OpenNI.ini
/home/ubuntu/OpenNI2/Config/OpenNI.ini
ubuntu@tegra-ubuntu:~/OpenNI2$ more /etc/openni2/OpenNI.ini
[Log]
; 0 - Verbose; 1 - Info; 2 - Warning; 3 - Error. Default - None
Verbosity=3
LogToConsole=0
LogToFile=0

[Device]
;Override=""

[Drivers]
; Location of the drivers specified by a relative path based on OpenNI's shared library or an absolute path.
; Path separator "/" can be used to be portable for any platforms.
; Default - OpenNI2/Drivers
;Repository=OpenNI2/Drivers
ubuntu@tegra-ubuntu:~/OpenNI2$ more Config/OpenNI.ini
[Log]
; 0 - Verbose; 1 - Info; 2 - Warning; 3 - Error. Default - None
Verbosity=3
LogToConsole=0
LogToFile=0

[Device]
;Override=""

[Drivers]
; Location of the drivers specified by a relative path based on OpenNI's shared library or an absolute path.
; Path separator "/" can be used to be portable for any platforms.
; Default - OpenNI2/Drivers
;Repository=OpenNI2/Drivers

After re-reading the log output from the software in my initial post, it is looking for a .ini file in current directory. I'm assuming that default value for verbosity is VERBOSE (since no OpenNI.ini file is located in the current directory)

FYI : here are my changes in the source

diff --git a/ThirdParty/PSCommon/BuildSystem/CommonDefs.mak b/ThirdParty/PSCommon/BuildSystem/CommonDefs.mak
index dd88b04..9953349 100644
--- a/ThirdParty/PSCommon/BuildSystem/CommonDefs.mak
+++ b/ThirdParty/PSCommon/BuildSystem/CommonDefs.mak
@@ -18,6 +18,8 @@ else ifneq (,$(findstring i386,$(MACHINE)))
        HOST_PLATFORM = x86
 else ifneq (,$(findstring arm,$(MACHINE)))
        HOST_PLATFORM = Arm
+else ifneq (,$(findstring aarch64,$(MACHINE)))
+       HOST_PLATFORM = Arm
 else
        DUMMY:=$(error Can't determine host platform)
 endif
diff --git a/ThirdParty/PSCommon/BuildSystem/Platform.Arm b/ThirdParty/PSCommon/BuildSystem/Platform.Arm
index c4a112d..4b78b1d 100644
--- a/ThirdParty/PSCommon/BuildSystem/Platform.Arm
+++ b/ThirdParty/PSCommon/BuildSystem/Platform.Arm
@@ -1,7 +1,7 @@
 ifeq "$(CFG)" "Release"

     # Hardware specifying flags
-    CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp #-mcpu=cortex-a8
+    #CFLAGS += -march=armv7-a -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp #-mcpu=cortex-a8

     # Optimization level, minus currently buggy optimizing methods (which break bit-exact)
     CFLAGS += -O3 -fno-tree-pre -fno-strict-aliasing
@@ -9,6 +9,6 @@ ifeq "$(CFG)" "Release"
     # More optimization flags
     CFLAGS += -ftree-vectorize -ffast-math -funsafe-math-optimizations #-fsingle-precision-constant

-    DEFINES += XN_NEON
+    #DEFINES += XN_NEON
     CFLAGS += -flax-vector-conversions
 endif

@sivaariram
Copy link

when I trying to make its failed I did the following changes in CommonDefs.mak

nvidia@tegra-ubuntu:/media/nvidia/JetsonSSD/OpenNI2$ sudo make
make -C ThirdParty/PSCommon/XnLib/Source
make[1]: Entering directory '/media/nvidia/JetsonSSD/OpenNI2/ThirdParty/PSCommon/XnLib/Source'
g++ -MD -MP -MT "./../Bin/Intermediate/Arm-Release/libXnLib.a/XnErrorLogger.d ../Bin/Intermediate/Arm-Release/libXnLib.a/XnErrorLogger.o" -c -march=armv7-a -mtune=cortex-a15 -mfpu=neon-vfpv4 -mfloat-abi=hard -O3 -fno-tree-pre -fno-strict-aliasing -ftree-vectorize -ffast-math -funsafe-math-optimizations -flax-vector-conversions -Wall -O2 -DNDEBUG -I../Include -DXN_NEON -fPIC -fvisibility=hidden -o ../Bin/Intermediate/Arm-Release/libXnLib.a/XnErrorLogger.o XnErrorLogger.cpp
g++: error: unrecognized command line option ‘-mfpu=neon-vfpv4’
g++: error: unrecognized command line option ‘-mfloat-abi=hard’
../../BuildSystem/CommonCppMakefile:133: recipe for target '../Bin/Intermediate/Arm-Release/libXnLib.a/XnErrorLogger.o' failed
make[1]: *** [../Bin/Intermediate/Arm-Release/libXnLib.a/XnErrorLogger.o] Error 1
make[1]: Leaving directory '/media/nvidia/JetsonSSD/OpenNI2/ThirdParty/PSCommon/XnLib/Source'
Makefile:122: recipe for target 'ThirdParty/PSCommon/XnLib/Source' failed
make: *** [ThirdParty/PSCommon/XnLib/Source] Error 2

@mikeh9
Copy link

mikeh9 commented Nov 26, 2017

I see a lot of people are having issues compiling for aarch64. To make it easy for everyone, I have uploaded a copy of my OpenNI2 source files that have been modified to work on aarch64, cortex-A57 on my github: https://github.com/mikeh9/OpenNI2-TX1.git

Also included are samples in binary format if you want to just run them.

Thanks to jetsonhacks.com for providing the instructions on how to compile the source for TK1.

@gowtham212
Copy link

@mikeh9 I too used your repo but You didn't dump your edited one ,You dump original one there is no support for aarch64 ,kindly helps us because we are facing lot of difficult on jetson tx2 ,ni viewer doesn't seems to open,Thank you

@mikeh9
Copy link

mikeh9 commented May 9, 2022

Sorry, I just checked and I don't have the archive anymore.

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

No branches or pull requests

5 participants