ros-drivers / openni_tracker

24 stars 45 forks source link

Branch for ros indigo #9

Open Jochen1980 opened 10 years ago

Jochen1980 commented 10 years ago

Hi, is it possible to use openni_tracker with ros indigo? Thanks in advance for your reply.

bit-pirate commented 10 years ago

There are a couple of issues related to recent builds.

I believe we have to solved #6 before attempting a debbuild for indigo.

It would be helpful, if you could test PR #8 together with a manual install of NITE. If that works, then we can merge the PR and to the deb build.

Jochen1980 commented 9 years ago

Hi bit-pirate, are there any news on this ticket yet? Actually I am not able to test PR #8. I am quite new to ROS. Thanks in advance for your respone.

bit-pirate commented 9 years ago

Jochen, I'm on a business trip right now, but will take a look at it when I'm back at the office.

Cheers!

On 9 January 2015 at 08:22, Jochen notifications@github.com wrote:

Hi bit-pirate, are there any news on this ticket yet? Actually I am not able to test PR #8 https://github.com/ros-drivers/openni_tracker/pull/8. I am quite new to ROS. Thanks in advance for your respone.

— Reply to this email directly or view it on GitHub https://github.com/ros-drivers/openni_tracker/issues/9#issuecomment-69357320 .

saihv commented 9 years ago

Hi Jochen, the hydro-devel branch of openni_tracker works fine with ROS Indigo. I am currently using it with NITE 1.5 manually installed.

Jochen1980 commented 9 years ago

Thanks for your comment saihv! Can you add a short description or a link how to manually install NITE 1.5? Maybe we can add a description on ros-wiki, that all people are able to use openni_tracker with ros-indigo.

saihv commented 9 years ago

Hi Jochen,

http://www.openni.ru/openni-sdk/openni-sdk-history-2/index.html

Go to this link and download NITE v1.5.2.23 for your architecture, x86 or 64. Once downloaded, all you need to do is extract it and run the install.sh file in the archive. Once that's done, try running rosrun openni_tracker openni_tracker and it should detect that NITE is installed and use the libraries.

BastiAB commented 9 years ago

Hi guys, I think I've found a Method that will work as an Installation of the hydro-openni_tracker under ROS-Indigo. Here is a full instruction of what I've done using Ubuntu 14.04 64Bit:

First we have to install some peripheral Libraries: _OpenNI_ I don't know if all of the following components really have to be installed, but I found this part of the Manual in another forum:

sudo apt-get install git-core cmake freeglut3-dev pkg-config build-essential libxmu-dev libxi-dev  libusb-1.0-0-dev openjdk-6-jdk
doxygen graphviz mono-complete

Now it is possible to download the OpenNI-Package

mkdir ~/kinect
cd ~/kinect
git clone https://github.com/OpenNI/OpenNI.git

We're using the Redist-System for compiling the package:

cd OpenNI/Platform/Linux/CreateRedist/
chmod +x RedistMaker
./RedistMaker

Next step is the Installation of OpenNI:

cd Final
tar -xjf OpenNI-Bin-Dev-Linux-x64-v1.5.7.10.tar.bz2
cd OpenNI-Bin-Dev-Linux-x64-v1.5.7.10
sudo ./install.sh

_SesorKinect_ The way to get this part to work is similar to the OpenNI guide: Download Package:

cd ~kinect/
git clone git://github.com/ph4m/SensorKinect.git

Compile Package with Redit:

cd SensorKinect/Platform/Linux/CreateRedist/
chmod +x RedistMaker
./RedistMaker

And finally Installation:

cd Final
tar -xjf Sensor-Bin-Linux-x64-v5.1.2.1.tar.bz2
cd Sensor-Bin-Linux-x64-v5.1.2.1
sudo ./install.sh

_NITE_ You can download this Library for example from the link mentioned in the post above. Don't forget that only the Versions NITE v1.5.2.21 and NITE v1.5.2.23 will work for you. Paste the nite-folder into your kinect-folder to keep track of your data:

cd ~kinect/nite/
tar -xjf NITE-Bin-Dev-Linux-x64-v1.5.2.23.tar.bz2
cd NITE-Bin-Dev-Linux-x64-v1.5.2.23
sudo ./install.sh

Now that everything around ROS is installed, we should reboot the system:

sudo reboot

_ROS-Components_ After we have installed all peripheral Libraries, we can install the required ros-core-components for OpenNI-usage. But we have to delete one library before that because of some issues that will appear otherwise:

sudo apt-get remove libopenni-sensor-pointclouds0

Next Step is the Installation of the ROS-Kinect-driver:

sudo apt-get install ros-indigo-openni-launch
sudo apt-get install ros-indigo-openni-camera

Finally we can install the openni_tracker to our usually workspace (for example the catkin_ws):

cd ~catkin_ws/src
git clone https://github.com/ros-drivers/openni_tracker.git 
cd ..
catkin_make

_Usage_ You need to start several terminals to work with the tracker. Terminal_1:

roslaunch openni_launch openni_launch

Terminal_2:

rosrun openni_tracker openni_tracker

Terminal_3:

rosrun rviz rviz

Now your system should be set up to be able to track a person under Indigo and to visualize the result. It would be very nice if someone could try to follow the instructions to verify this way.

Jochen1980 commented 9 years ago

Great! Thanks.

chamberger commented 9 years ago

Hi Biersack, I follow the way you instructed. When compiling the OpenNI package, it came up with the result as follow:

Can you tell me how to solve it? Thanks in advance for your respone!

BastiAB commented 9 years ago

Hi chamberger, indeed i got the same error yesterday. It says that you don 't have the program javc installed on your system. You can get that with either openjdk-6-jdk or openjdk-7-jdk. Install one of these libraries, for example: sudo apt-get install openjdk-6-jdk

Then try to compile again. I will put that library in the first step of my manual above.

Thank you for your participation.

chamberger commented 9 years ago

It works. Thanks a lot!

chamberger commented 9 years ago

Hi Biersack, The openni drivers you mentioned above seem not work. When I started the the openni.launch, I got: [ INFO] [1428634860.023792990]: No devices connected.... waiting for devices to be connected

My kinect is the kinect for windows v2. Do you have suggestions?

BastiAB commented 9 years ago

Hi chamberger, as far as I know the Drivers and packages we discuss in this thread will only work with the kinect360, but not with the Kinect V2. Now the good News: There is a Ros-Driver to get the new Kinect to work in Ros-Environment, but you have to use other Drivers than the ones we used for this Manual. If you want i can send you a short manual for Kinect V2 on Monday. Bad News: I don't know if the new Kinect-sensors already are compatible with the openni_tracker. We were not able to realize this combination yet.

chamberger commented 9 years ago

Hi Blersack, Thanks for your reply! I will be appreciated if you send me the manual for Kinect V2. I hope the kinect to work in Ubuntu 14.04 with ROS-Indigo-Environment.

BastiAB commented 9 years ago

Hi chamberger, sorry I'm a little late, but now i have some Instructions for you to get kinect_one (v2) to work with ubuntu 14.04. Perhaps this will allow you to develop a sollution to work with the new kinect and the openni_tracker.

Before you try out this manual I want you to know that there is another package made by bit-pirate with the openni_tracker using openni2 and NITE2 (https://github.com/ros-drivers/openni2_tracker). Perhaps it would be a better sollution to work with the other package instead of the first openni_tracker. But if you want to try out this package, you could go this way:

The new Version of the kinect works with a new driver called Libfreenect2. First of all we have to install this driver and all dependencies around. There are different versions available, but if you want to use OpenCL-acceleration you have to work with the version from this Manual. Otherwise you can use other versions like the official branch for example:

sudo apt-get install -y build-essential libturbojpeg libtool autoconf libudev-
dev cmake mesa-common-dev freeglut3-dev libxrandr-dev doxygen libxi-dev
libopencv-dev

sudo ln -s /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0 /usr/lib/x86_64-linux-
gnu/libturbojpeg.so

git clone https://github.com/wiedemeyer/libfreenect2

No we have to do some work with the binaries before we can compile and install the driver. Go to the dorectory libfreenect2/examples/protonect, where you can find aCMakeLists.txt. In this file replace lines 48 - 50 with:

LibUSB

GET_FILENAME_COMPONENT(LIBUSB_DIR "${MY_DIR}/../../depends/libusb/" REALPATH) INCLUDE_DIRECTORIES("${LIBUSB_DIR}/include/libusb-1.0/") LINK_DIRECTORIES("${LIBUSB_DIR}/lib/") SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

Save the file and exit. To be sure that every peripherical program to this driver installed go to folder libfreenect2/depends and try:

sh install_ubuntu.sh

if you get an error-message that the library "libturbojpeg" was not found you have to link this one manually:

sudo ln -s /usr/lib/x86_64-linux-gnu/libturbojpeg.so.0.0.0 /usr/lib/x86_64-
linux-gnu/libturbojpeg.so

If you're using ubuntu 14.04 64bit with an NVidia graphics card there could appear another error that says: "No rule to make target `/usr/lib/x86_64-linux-gnu/libGL.so". This could be solved the following way:

sudo rm /usr/lib/x86_64-linux-gnu/libGL.so
sudo ln -s /usr/lib/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so

Now you have to do one more replacement to get the example to work if you don't have OpenCL onboard. Open the libfreenect2.cpp whitch is locatet in folder libfreenect2/examples/protonect/src and change line 76, this is the initialization of the depth_package_processor, from

OpenCLDepthPacketProcessor depth_packet_processor_;

to

CpuDepthPacketProcessor depth_packet_processor_;

It is time to compile the binaries and install the driver. Do:

cd ../build
mkdir linux
cd linux
cmake ../../examples/protonect/ -DENABLE_CXX11=ON
make && sudo make install

To prove that the installation was successful you can run the example:

cd ../../examples/protonect/bin
sudo ./Protonect

If everything works correctly you should see three images, a RGB-Image, an IR-image and a Depth-image.

_iai_kinect2toolkit This is the actual Ros-package for kinect_one useage. Go to your workspace (We used catkin_ws) and do:

cd ~/catkin_ws/src/
git clone https://github.com/code-iai/iai_kinect2.git
cd iai_kinect2
rosdep install -r --from-paths 
cd ~/catkin_ws
catkin_make -DCMAKE_BUILD_TYPE="Release"

If you don't have OpenCL open the CMakeLists.txt (location: /src/iai_kinect2/kinect2_bridge/) and change the parameters in line 4 and 5 to "OFF". After that you have to do catkin_make one more time to apply the changes.

Now go to /etc/udev/rules.d/ and do:

sudo gedit 90-kinect2.rules

This new file should contain the following text:

ATTR{product}=="Kinect2"

SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02c4", MODE="0666" SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02d8", MODE="0666" SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02d9", MODE="0666"

You can find the idProduct of your kinect using the following command:

dmesg | grep "045e"

If it is not yet in the list add your ID and save the file. No your Kinect should be ready to work with.

ihshareef commented 9 years ago

I tried this out with an ASUS Xtion with ROS Indigo, and it worked for me. However, I skipped downloading the Sensor package. Thanks a lot for the instructions @BastiAB

adelleodel commented 9 years ago

hi there, i followed those instruction but still hv problem when i 'catkin_make' those with my program. it said that

KinectController.cpp:1:22: fatal error: XnOpenNI.h: No such file or directory

include

                  ^

compilation terminated. make[2]: * [my_package/CMakeFiles/kinect_controller.dir/src/KinectController.cpp.o] Error 1 make[1]: * [my_package/CMakeFiles/kinect_controller.dir/all] Error 2 make[1]: *\ Waiting for unfinished jobs.... /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11 /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12 ....


as u can see, my KinectController which include XnOpenNI.h and other files that available in OpenNI-package doesn't recognize by my sistem(?)

i followed pi_tracker code by Patrick Goebel such as in this web http://docs.ros.org/electric/api/pi_tracker/html/KinectController_8cpp.html

do you know how to fix this? fyi, when i 'catkin_make my_package' it wasn't error either when 'catkin_make openni_tracker'. so i got confused when i 'catkin_make' for all the package.

khadirowsky commented 8 years ago

Thanks very very much @BastiAB

javalosv commented 8 years ago

Somebody know the extra step to work with Xtion sensor. This is working great with Kinect sensor but It doesn't recognize the xtion sensor.

130s commented 7 years ago

Any plan for making a release into Indigo, Kinetic (and possibly Lunar)? Seems to be that someone is able to run on Kinetic on answers.

Dhagash4 commented 7 years ago

I am using Ubuntu 16.04 and ros kinectand I am getting the following ./Redistmaker while building the OpenNI package I am following the tutorials of the link given below: http://wiki.ros.org/Robots/evarobot/Tutorials/indigo/Kinect

The following is the error:


  • PrimeSense OpenNI Redist *
  • 2017-09-29 18:07:30 *

Target: Linux-x64 Version: 1.5.4.0 Num of compile jobs: 8

  • Building OpenNI... ../../../../Source/OpenNI/XnRecorderImpl.cpp: In constructor ‘xn::RecorderImpl::RecorderImpl()’: ../../../../Source/OpenNI/XnRecorderImpl.cpp:51:18: warning: converting to non-pointer type ‘XN_FILE_HANDLE {aka int}’ from NULL [-Wconversion-null] m_hRecorder(NULL) ^ ../../../../Source/OpenNI/XnProfiling.cpp: In function ‘void xnProfilingThread(XN_THREAD_PARAM)’: ../../../../Source/OpenNI/XnProfiling.cpp:90:168: warning: field width specifier ‘’ expects argument of type ‘int’, but argument 3 has type ‘XnSizeT {aka long unsigned int}’ [-Wformat=] nReportChars += sprintf(csReport + nReportChars, "%-s %-5s %-6s %-9s %-7s\n", g_ProfilingData.nMaxSectionName, "TaskName", "Times", "% Time", "TotalTime", "AvgTime"); ^ ../../../../Source/OpenNI/XnProfiling.cpp:91:168: warning: field width specifier ‘’ expects argument of type ‘int’, but argument 3 has type ‘XnSizeT {aka long unsigned int}’ [-Wformat=] nReportChars += sprintf(csReport + nReportChars, "%-s %-5s %-6s %-9s %-7s\n", g_ProfilingData.nMaxSectionName, "========", "=====", "======", "=========", "======="); ^ ../../../../Source/OpenNI/XnProfiling.cpp:108:95: warning: field width specifier ‘’ expects argument of type ‘int’, but argument 3 has type ‘XnSizeT {aka long unsigned int}’ [-Wformat=] pSection->csName, pSection->nTimesExecuted, dCPUPercentage, pSection->nTotalTime, nAvgTime); ^ ../../../../Source/OpenNI/XnProfiling.cpp:121:90: warning: field width specifier ‘*’ expects argument of type ‘int’, but argument 3 has type ‘XnSizeT {aka long unsigned int}’ [-Wformat=] g_ProfilingData.nMaxSectionName, " Total ", "-", dCPUPercentage, nTotalTime, "-"); ^ ../../../../Source/OpenNI/XnPlayerImpl.cpp: In constructor ‘xn::PlayerImpl::PlayerImpl()’: ../../../../Source/OpenNI/XnPlayerImpl.cpp:71:33: warning: converting to non-pointer type ‘XN_FILE_HANDLE {aka int}’ from NULL [-Wconversion-null] m_bPlaybackThreadShutdown(FALSE) ^ /bin/sh: 1: javac: not found make[1]: [../../../Bin/x64-Release/org.OpenNI.jar] Error 127 make: [Wrappers/OpenNI.java] Error 2 make: ** Waiting for unfinished jobs.... ../../../../../Samples/NiViewer/Device.cpp: In function ‘XnStatus openDeviceFromXmlWithChoice(const char, xn::EnumerationErrors&)’: ../../../../../Samples/NiViewer/Device.cpp:252:22: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &chosen); ^ failed to execute: make -j8 -C /home/dhagash/OpenNI/Platform/Linux/CreateRedist/../Build > /home/dhagash/OpenNI/Platform/Linux/CreateRedist/Output/BuildOpenNI.txt Building Failed!

Anyone please help

130s commented 7 years ago

@Dhagash4 I'm afraid you will get very limited help if you post on an existing thread that is barely related to your question. http://answers.ros.org is the recommended place for questions in general for ROS.

willimBing commented 6 years ago

@BastiAB Hello! When I run this step, I got some warning. like this: rosrun openni_tracker openni_tracker [rospack] Warning: error while looking at /root/catkin_ws: boost::filesystem::status: Permission denied: "/root/catkin_ws" [rospack] Error: package 'openni_tracker' not found find: 无法查找 `': 没有那个文件或目录 [rospack] Warning: error while looking at /root/catkin_ws: boost::filesystem::status: Permission denied: "/root/catkin_ws" [rospack] Error: package 'openni_tracker' not found [librospack]: error while executing command [ERROR] [1519977679.307951514]: InitFromXml failed: File not found!