0
$\begingroup$

Rosanswers logo

I wanted to install freenect in ROS to take depth images using Kinect XBOX 360 1473. I cloned the repository from https://github.com/ros-drivers/freenect_stack and kept it in ~/catkin_ws/src under the folder name freenect_stack. Upon running catkin_make in ~/catkin_ws I get the following error:

[ 21%] Building CXX object freenect_stack/freenect_camera/CMakeFiles/freenect_nodelet.dir/src/nodelets/driver.cpp.o
In file included from /home/athul/catkin_ws/src/freenect_stack/freenect_camera/src/nodelets/driver.h:54:0,
                 from /home/athul/catkin_ws/src/freenect_stack/freenect_camera/src/nodelets/driver.cpp:39:
/home/athul/catkin_ws/src/freenect_stack/freenect_camera/include/freenect_camera/freenect_driver.hpp:4:10: fatal error: libfreenect/libfreenect.h: No such file or directory
 #include <libfreenect/libfreenect.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
freenect_stack/freenect_camera/CMakeFiles/freenect_nodelet.dir/build.make:62: recipe for target 'freenect_stack/freenect_camera/CMakeFiles/freenect_nodelet.dir/src/nodelets/driver.cpp.o' failed
make[2]: *** [freenect_stack/freenect_camera/CMakeFiles/freenect_nodelet.dir/src/nodelets/driver.cpp.o] Error 1
CMakeFiles/Makefile2:2697: recipe for target 'freenect_stack/freenect_camera/CMakeFiles/freenect_nodelet.dir/all' failed
make[1]: *** [freenect_stack/freenect_camera/CMakeFiles/freenect_nodelet.dir/all] Error 2
Makefile:140: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j1 -l1" failed

Please help. Any input is welcome.


Originally posted by athul on ROS Answers with karma: 11 on 2019-01-27

Post score: 1

$\endgroup$

3 Answers 3

0
$\begingroup$

Rosanswers logo

Is there a reason that you can't install the binary?

Anyways, try installing the dependencies before compiling. From the root of your workspace, run

~/catkin_ws$ rosdep install --from-paths src -i
~/catkin_ws$ catkin_make

Originally posted by jayess with karma: 6155 on 2019-01-27

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by gvdhoorn on 2019-01-28:\

Is there a reason that you can't install the binary?

afaict, freenect_stack hasn't been released for Melodic.

Comment by jayess on 2019-01-28:
@gvdhoorn Thanks. I figured as much, wasn't sure though

Comment by athul on 2019-01-28:
I guess libfreenect does not work with melodic :(

The error I got when I ran rosdep:

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
freenect_camera: Cannot locate rosdep definition for [libfreenect]

@gvdhoorn @jayess Thanks

Comment by wesliao on 2019-02-05:
I'm having the same issue. I have libfreenect and libfreenect-dev installed, but freenect_stack won't build.

Comment by ChriMo on 2019-02-13:
same problem :-(

Comment by WyattAutomation on 2019-07-22:
see my answer posted itt; I was able to get it installed and preliminary tests suggest it works fine.

Comment by 130s on 2020-09-20:
Release was tracked at https://github.com/ros-drivers/freenect_stack/issues/48, which is now closed with a release work done. So I think this can now be an "accept" answer.

$\endgroup$
0
$\begingroup$

Rosanswers logo

I was able to install this, and I don't know if it's going to work like I'm expecting but I now have libfreenect and the ros freenect_launch and other freenect_node stuff all installed in Melodic on Ubuntu18.04, per the commands below:

Compile/install libfreenect from source, NOT an apt install of libfreenect-dev (if you installed that via apt it shouldn't hurt, it just won't work. No need to remove that apt package afaik):

cd  ~    
git clone https://github.com/OpenKinect/libfreenect.git    
cd libfreenect    
mkdir build   
cd build    
cmake -L ..    
make
sudo make install

Then, cd into your catkin workspace source, (I'm assuming yours is "~/catkin_workspace/src" but you may need to change that if yours is different). Clone the repo, then cd up one directory back into your catkin workspace root, and run catkin_make:

cd ~/catkin_workspace/src
git clone https://github.com/ros-drivers/freenect_stack.git
cd ..
catkin_make

I'm on Ubuntu 18.04 running ROS Melodic, and was able to get this installed the day of this post (July20-22, 2019).

Whoever is running this repo really should just update the package to make it installable via apt, it already appears to work with Melodic, it's just grief for us noobs..

(just kidding, I appreciate the work that's been put into this; without it my $8 Xbox 360 Kinect from a thrift store wouldn't be of any use to me. Would really like to help make this easier to install on Melodic, but the repo looks so dead I don't even want to put in a pull request..)

Let me know if you run into problems with this; I haven't tested it at all but it DOES install.

It's still a very useful tool you know? What's 2019 if you can't build robots of doom out of scrap consumer electronics?..


Originally posted by WyattAutomation with karma: 31 on 2019-07-22

This answer was NOT ACCEPTED on the original site

Post score: 3

$\endgroup$
0
$\begingroup$

Rosanswers logo

Just in case anybody encounters it, in search of solutions - I recently wrote an article about using Kinect 360 and RTAB-MAP ROS Melodic with Rasberry Pi 4, with some tweaks it does work now! https://www.hackster.io/dmitrywat/rgb-d-slam-with-kinect-on-raspberry-pi-4-ros-melodic-ace795


Originally posted by Wintermute with karma: 21 on 2020-05-10

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by gvdhoorn on 2020-05-10:
+100 for sharing your solution with the community, but link-only answers are not very nice: if (when) your blog changes, the link will 404 or be located somewhere else. Future readers cannot benefit from it any more then.

It would be good if you could post the important parts of your solution here in your answer to make it stand-alone.

Comment by maxsvetlik on 2020-05-12:
There shouldn't be any need to clone freenect-stack directly on Melodic as the latest binary release should have taken care of the issue in the question. If cloning and compiling from source is still required, please open an issue on the freenect github!

Comment by Wintermute on 2020-05-12:
Point taken :) The article itself is quite long, so I cannot post all of it - besides for freenect driver and freenect_stack the procedure is the same as in https://answers.ros.org/question/313893/unabe-to-install-freenect-in-ros-melodicubuntu-1804/?answer=329094#post-id-329094 What took most of my time and was difficult to figure out is this: " as soon as I would try accessing two streams simultaneously the Kinect would start timing out. Then in one of GitHub's issues I saw an account of a person who said their Kinect was unstable, until they "loaded the USB bus" by connecting WiFi dongle. I tried that and it worked. On the one hand, I'm glad that it worked. On the other hand, somebody is really ought to fix that. " This issue is very likely Raspberry Pi 4 specific and related to libusb or freenect drivers.

Comment by Wintermute on 2020-05-12:
maxsvetlik the article is about ROS Melodic on Debian Buster - it doesn't have pre-built binaries :) so still need to build from source

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.