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

re-enable nite packages #12

Merged
merged 10 commits into from
May 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
language:
- cpp
- python
python:
- "2.7"
compiler:
- gcc
sudo: required
dist: trusty
language: generic
env:
- ROS_DISTRO=hydro ROSWS=wstool BUILDER=catkin USE_DEB=true
- ROS_DISTRO=indigo ROSWS=wstool BUILDER=catkin USE_DEB=true
- ROS_DISTRO=jade ROSWS=wstool BUILDER=catkin USE_DEB=true
- ROS_DISTRO=hydro USE_DEB=true USE_JENKINS=true
- ROS_DISTRO=indigo USE_DEB=true USE_JENKINS=false
- ROS_DISTRO=jade USE_DEB=true USE_JENKINS=false
matrix:
allow_failures:
- env: ROS_DISTRO=indigo ROSWS=wstool BUILDER=catkin USE_DEB=true
- env: ROS_DISTRO=jade ROSWS=wstool BUILDER=catkin USE_DEB=true
- env: ROS_DISTRO=jade USE_DEB=true
script: source .travis/travis.sh
before_script:
- export ROS_PARALLEL_JOBS="-j2 -l2"
Expand Down
17 changes: 0 additions & 17 deletions CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion Makefile

This file was deleted.

79 changes: 79 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
jsk_openni_kinect
=================

jsk openni tools


## Setup (trusty/inidgo)


### Create catkin workspace
```
$ mkdir-p catkin_ws/ws_jsk_openni_kinect/src
$ cd catkin_ws/ws_jsk_openni_kinect
$ wstool init src
$ wstool set jsk_openni_kinect https://github.com/jsk-ros-pkg/jsk_openni_kinect --git
$ wstool set openni_tracker https://github.com/ros-drivers/openni_tracker --git
$ wstool update
```

### Install missing apt package required to run this package
```
$ rosdep update
$ rosdep install -r -y
```

### Create primesense-nite-nonfree and install

Install patched version of libopenni-sensor-primesense.sh for devices with `ID 1d27:0609 ASUS`
```
$ ./apt-get-intall-libopenni-sensor-primesense.sh
```

Get NITE-Bin-Linux-x64-v1.5.2.23.tar.bz2 from somewhere and put it in this directory
```
$ ls -al NITE-Bin-Linux-x64-v1.5.2.23.tar.bz2 ## make sure you have NITE-BIN
-rw-rw-r-- 1 k-okada k-okada 108732440 5月 25 20:39 NITE-Bin-Linux-x64-v1.5.2.23.tar.bz2
$ ./apt-get-intall-primesense-nite-nonfree.sh
```

To confirm you have successfully primesense-nite-nonfree,
```
$ ls -al /usr/include/nite # check if include directory exists
$ ls -al /usr/lib/libXnVNite* # check if library installed
```

### Compile openni/nite packages
```
$ cd catkin_ws/ws_jsk_openni_kinect
$ catkin b
```

### Run roslaunch and check if your device run correctly
```
$ roslaunch openni_launch openni.launch
$ rosrun openni_tracker openni_tracker _camera_frame_id:=camera_depth_frame
```


## Troubleshooting
### Run lsusb and check if your device correctly recognized by your OS
```
$ lsusb
$ Bus ○○○ Device ○○○: ID 1d27:0601 ASUS
```
If there is no device like "ASUS", the connected device seems to be broken.

### Run NiViewer and check if you can run the device without NiTE function
```
$ NiViewer
```
If you have some error with this command, I recommend you to try
1. disconnect the device
2. sudo service udev restart
3. connect the device again

### Run sample program in NITE-Bin-Dev-Linux-x64-v1.5.2.23/Samples/Bin
```
$ ./Sample-Players
```
51 changes: 51 additions & 0 deletions apt-get-intall-libopenni-sensor-primesense.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
diff -ru openni-sensor-primesense-5.1.0.41/debian/changelog openni-sensor-primesense-5.1.0.41-99/debian/changelog
--- openni-sensor-primesense-5.1.0.41/debian/changelog 2016-05-26 18:59:42.736544744 +0900
+++ openni-sensor-primesense-5.1.0.41-99/debian/changelog 2016-05-26 18:58:00.300083609 +0900
@@ -1,3 +1,9 @@
+openni-sensor-primesense (5.1.0.41-99) unstable; urgency=low
+
+ * Support 1d27:0609 device
+
+ -- Kei Okada <[email protected]> Tue, 26 May 2016 18:55:55 +0900
+
openni-sensor-primesense (5.1.0.41-3) unstable; urgency=low

[ Jochen Sprickerhof ]
diff -ru openni-sensor-primesense-5.1.0.41/Source/XnDeviceSensorV2/XnDeviceSensorIO.cpp openni-sensor-primesense-5.1.0.41-99/Source/XnDeviceSensorV2/XnDeviceSensorIO.cpp
--- openni-sensor-primesense-5.1.0.41/Source/XnDeviceSensorV2/XnDeviceSensorIO.cpp 2012-01-04 20:43:06.000000000 +0900
+++ openni-sensor-primesense-5.1.0.41-99/Source/XnDeviceSensorV2/XnDeviceSensorIO.cpp 2016-05-26 18:58:00.308083645 +0900
@@ -33,6 +33,7 @@
#define XN_SENSOR_5_0_PRODUCT_ID 0x0500
#define XN_SENSOR_6_0_PRODUCT_ID 0x0600
#define XN_SENSOR_6_0_1_PRODUCT_ID 0x0601
+#define XN_SENSOR_6_0_9_PRODUCT_ID 0x0609

//---------------------------------------------------------------------------
// Enums
@@ -402,6 +403,10 @@
#else
XnStringsHash devicesSet;

+ // search for a v6.0.9 device
+ nRetVal = Enumerate(XN_SENSOR_6_0_9_PRODUCT_ID, devicesSet);
+ XN_IS_STATUS_OK(nRetVal);
+
// search for a v6.0.1 device
nRetVal = Enumerate(XN_SENSOR_6_0_1_PRODUCT_ID, devicesSet);
XN_IS_STATUS_OK(nRetVal);
--- openni-sensor-primesense-5.1.0.41/debian/libopenni-sensor-primesense0.udev 2013-11-30 05:35:50.000000000 +0900
+++ openni-sensor-primesense-5.1.0.41-99/debian/libopenni-sensor-primesense0.udev 2016-05-26 19:13:22.027791765 +0900
@@ -5,3 +5,4 @@
SUBSYSTEM=="usb", ATTR{idProduct}=="0500", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="0600", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idProduct}=="0601", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
+SUBSYSTEM=="usb", ATTR{idProduct}=="0609", ATTR{idVendor}=="1d27", MODE:="0666", OWNER:="root", GROUP:="video"
diff -ru openni-sensor-primesense-5.1.0.41/Platform/Linux/Install/55-primesense-usb.rules openni-sensor-primesense-5.1.0.41-99/Platform/Linux/Install/55-primesense-usb.rules
--- openni-sensor-primesense-5.1.0.41/Platform/Linux/Install/55-primesense-usb.rules 2012-01-04 20:43:06.000000000 +0900
+++ openni-sensor-primesense-5.1.0.41-99/Platform/Linux/Install/55-primesense-usb.rules 2016-05-26 19:15:43.172355043 +0900
@@ -5,4 +5,5 @@
SYSFS{idProduct}=="0500",SYSFS{idVendor}=="1d27",MODE="666",OWNER="xxx",GROUP="users"
SYSFS{idProduct}=="0600",SYSFS{idVendor}=="1d27",MODE="666",OWNER="xxx",GROUP="users"
SYSFS{idProduct}=="0601",SYSFS{idVendor}=="1d27",MODE="666",OWNER="xxx",GROUP="users"
+SYSFS{idProduct}=="0609",SYSFS{idVendor}=="1d27",MODE="666",OWNER="xxx",GROUP="users"

20 changes: 20 additions & 0 deletions apt-get-intall-libopenni-sensor-primesense.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash -e
set -x
_THIS_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)

# run everythin within /tmp
cd /tmp
rm -fr openni-sensor-primesense* # make sure we start from clean environment
apt-src install libopenni-sensor-primesense-dev
patch -p0 < ${_THIS_DIR}/apt-get-intall-libopenni-sensor-primesense.diff
apt-src build libopenni-sensor-primesense-dev

# install
ls -al *.deb
sudo dpkg -i libopenni-sensor-primesense*

echo "OK"




39 changes: 39 additions & 0 deletions apt-get-intall-primesense-nite-nonfree.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash -e

_THIS_DIR=$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)

# run everythin within /tmp
cd /tmp
rm -fr primesense-nite-nonfree* # make sure we start from clean environment
if [ ! -e primesense-nite-nonfree-0.1 ]; then
apt-src install primesense-nite-nonfree
fi
NITE_LIB=NITE-Bin-Linux-x64-v1.5.2.23.tar.bz2
if [ ! -e ${_THIS_DIR}/${NITE_LIB} ]; then
echo "Please put $NITE_LIB"
exit 1
fi
if [ ! -e $NITE_LIB.zip ]; then
zip $NITE_LIB.zip ${_THIS_DIR}/$NITE_LIB
fi
set -x
# fix to use local .zip
sed -i "[email protected]@$NITE_LIB.zip@" primesense-nite-nonfree-0.1/update-primesense-nite-nonfree
sed -i "s@^\s*wget@echo wget@" primesense-nite-nonfree-0.1/update-primesense-nite-nonfree
sed -i "s@\$checksum@$(sha256sum /tmp/$NITE_LIB.zip | cut -f1 -d\ )@" primesense-nite-nonfree-0.1/update-primesense-nite-nonfree
sed -i "s@/usr/lib/primesense-nite-nonfree/primesense-nite-nonfree-make-deb@/tmp/primesense-nite-nonfree-0.1/primesense-nite-nonfree-make-deb@" primesense-nite-nonfree-0.1/update-primesense-nite-nonfree

sed -i "s@/usr/share/primesense-nite-nonfree/nite_debian_dir@/tmp/primesense-nite-nonfree-0.1/nite_debian_dir@" primesense-nite-nonfree-0.1/primesense-nite-nonfree-make-deb

# create deb
apt-src build primesense-nite-nonfree

# install
sudo dpkg -i primesense-nite-nonfree_0.1_amd64.deb
sudo dpkg -i /var/cache/primesense-nite-nonfree/openni-module-primesense-nite-nonfree_1.5.2.21-1_amd64.deb

echo "OK"




51 changes: 33 additions & 18 deletions openni_pointer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,38 @@
if(NOT ("$ENV{ROS_Distributions}" STREQUAL "electric" OR "$ENV{ROS_DISTRO}" STREQUAL "fuerte"))
include(catkin.cmake)
return()
endif()
cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
rosbuild_init()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
cmake_minimum_required(VERSION 2.8.3)
project(openni_pointer)
find_package(catkin REQUIRED COMPONENTS roscpp roslib geometry_msgs tf)

set(PC_NITE_DEV_INCLUDE_DIRS "/usr/include/nite")
find_package(PkgConfig)
pkg_check_modules(PC_LIBOPENNI REQUIRED libopenni)
include_directories(
${PC_LIBOPENNI_INCLUDE_DIRS}
${PC_NITE_DEV_INCLUDE_DIRS})
if($ENV{ROS_DISTRO} STREQUAL "groovy")
add_definitions(-DUSE_PCL_AS_PCL_MSGS)
set(PC_NITE_DEV_INCLUDE_DIRS "/usr/include/nite")
set(PC_NITE_DEV_LIBRARIES XnVNite_1_3_1;OpenNI)

catkin_package(
DEPENDS openni nite
CATKIN-DEPENDS roscpp roslib geometry_msgs tf
#INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
)

if(NOT EXISTS ${PC_NITE_DEV_INCLUDE_DIRS})
message(WARNING "-- Nite is not found, so could not compile ${PROJECT_NAME}")
else()

include_directories(
${PC_LIBOPENNI_INCLUDE_DIRS}
${PC_NITE_DEV_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS})
add_definitions(${PC_LIBOPENNI_CFLAGS_OTHER})
add_executable(openni_pointer src/openni_pointer.cpp)
target_link_libraries(openni_pointer ${catkin_LIBRARIES} ${PC_NITE_DEV_LIBRARIES})

install(TARGETS ${PROJECT_NAME} openni_pointer
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

endif()
rosbuild_add_executable(openni_pointer src/openni_pointer.cpp)

# https://code.ros.org/trac/ros-pkg/ticket/5287
set(PC_NITE_DEV_LIBRARIES XnVNite_1_3_1;OpenNI)
target_link_libraries(openni_pointer ${PC_NITE_DEV_LIBRARIES})
install(FILES openni_pointer.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
1 change: 0 additions & 1 deletion openni_pointer/Makefile

This file was deleted.

46 changes: 0 additions & 46 deletions openni_pointer/catkin.cmake

This file was deleted.

25 changes: 0 additions & 25 deletions openni_pointer/manifest.xml

This file was deleted.

Loading