ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Openni and Kinect on Hydro, OSX 10.8

asked 2014-04-28 22:31:04 -0600

karthik_ms gravatar image

updated 2014-05-28 06:10:49 -0600

I believe I have a clean install of Hydro on my OS X 10.8. This I did through Hydro tutorial for OSX. I did the Desktop-Full Install through rosinstall_generator desktop_full --rosdistro hydro --deps --wet-only --tar > hydro-desktop-full-wet.rosinstall and Hence built the packages.

I see that the "openni" stack is missing and I cannot run commands like roslaunch openni_launch openni.launch

I also installed openni later through brew install openni and below is the info of that.

openni: stable 1.5.7.10, devel 1.5.8.5, HEAD
http://www.openni.org/
/usr/local/Cellar/openni/1.5.7.10 (1614 files, 33M) *
  Built from source
From: https://github.com/Homebrew/homebrew/commits/master/Library/Formula/openni.rb
==> Dependencies
Build: automake ✔, libtool ✔, doxygen ✔
Required: libusb ✔
==> Options
--universal
    Build a universal binary
--devel
    install development version 1.5.8.5
--HEAD
    install HEAD version

After installing openni from brew, I built all the packages again. But still the openni stack is missing.

Now that openni is installed from brew, I followed the instructions @William has suggested me.

I did the following :

$ mkdir ~/openni_ws
$ cd ~/openni_ws
$ source /path/to/hydro/install/setup.bash
$ rosinstall_generator openni_launch --deps --exclude RPP --tar > openni-hydro.rosinstall
$ wstool init src -j8 openni-hydro.rosinstall

When I ran this : rosdep install --from-paths ./src --ignore-src -y, I got the following error.

openni_camera: No definition of [libopenni-sensor-primesense-dev] for OS [osx]

Hence I did the following command :

rosdep install --from-paths ./src --ignore-src -y --skip-keys "libopenni-sensor-primesense-dev libopenni-dev"

After this I did catkin_make install and got an error stream from which I inferred that is is not able to find the libopenni library, which I installed through brew already(as explained in first part).

-- checking for module 'libopenni'
--   package 'libopenni' not found
CMake Error at /usr/local/Cellar/cmake/2.8.12.2/share/cmake/Modules/FindPkgConfig.cmake:279 (message):
  A required package was not found
Call Stack (most recent call first):

(Gist to error stream : https://gist.github.com/karthikkovala... )

I did brew unlink and link as well to make sure the openni that I installed from brew is properly linked.

I want to use my kinect through openni stack on ROS. This generally comes by default in Ubuntu. Could someone explain how I can do it on my Machine with OS X 10.8. I am really looking forward to his since the whole of my work depends on Kinect based TurtleBot navigation.

POST EDIT :

After @demmeln suggested the procedure, I get an error that I believe is related to the compiler somehow. After I do catkin_make install , I get the following errors : (I am running xcode 5.1 at present and OSX 10.8). I am not clear on how to solve this.

Source space: /Users/Siva/openni_ws/src
Build space: /Users/Siva/openni_ws/build
Devel space: /Users/Siva/openni_ws/devel
Install space: /Users/Siva/openni_ws/install
####
#### Running command: "make cmake_check_build_system" in "/Users/Siva/openni_ws/build"
####
####
#### Running command: "make install -j4 -l4" in "/Users/Siva/openni_ws/build"
####
[  6%] Built target openni_camera_gencfg ...
(more)
edit retag flag offensive close merge delete

Comments

Well it is not finding `openni`, but I don't know why. You can also try libfreenect.

William gravatar image William  ( 2014-04-30 08:19:37 -0600 )edit

The openni libraries are installed at `/usr/local/Cellar/openni/1.5.7.10`. Is this creating a problem by any chance ? Should I modify any environment variable? Is the CMakeLists.txt going wrong some where? I installed freenect anyways but I need Openni for openni_launch on ros. Kindly Help

karthik_ms gravatar image karthik_ms  ( 2014-04-30 21:47:00 -0600 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2014-05-13 03:13:28 -0600

demmeln gravatar image

updated 2015-08-11 10:33:34 -0600

130s gravatar image

In addition to what @William proposes, here are some additional steps needed to get this working. I have submitted pull requests for according patches.

  1. the openni formula has a typo in the pkg-config file path: https://github.com/Homebrew/homebrew-...
  2. openni_camera needs a patch to compile: https://github.com/ros-drivers/openni...
  3. rosdep keys are missing: https://github.com/ros/rosdistro/pull...

EDIT: Faults 1 and 3 have been fixed upstream. So the only additional step on top of William's instructions should the openni_camera patch.

Instructions with additional steps until the above fixes are in (which let me successfully compile on OS X 10.9):

mkdir ~/openni_ws
cd ~/openni_ws
source /path/to/hydro/install/setup.bash
rosinstall_generator openni_launch --deps --exclude RPP --tar > openni-hydro.rosinstall
wstool init src -j8 openni-hydro.rosinstall
rosdep install --from-paths ./src --ignore-src -y --skip-keys "libopenni-dev libopenni-sensor-primesense-dev"

# manually install the dependencies
brew install openni totakke/openni/sensor-kinect

# manually fix the typo in openni
cd /usr/local/lib/pkgconfig
ln -s ../pkg-config/libopenni.pc

# apply patch to openni_camera
pushd src/openni_camera
curl https://github.com/ros-drivers/openni_camera/pull/22.patch | patch -p1
popd

# now proceed building
catkin_make install
source ./install/setup.bash
roslaunch openni_launch openni.launch

EDIT 2: (in respose to your updated question)

I did the following :

...
$ source /path/to/hydro/install/setup.bash
...

When following the instructions, please make sure you actually replace the path in source /path/to/hydro/install/setup.bash with the actual path to where you installed hydro.

When I ran this : rosdep install --from-paths ./src --ignore-src -y, I got the following error.

openni_camera: No definition of [libopenni-sensor-primesense-dev] for OS [osx]

This indicates the rosdep database is out of date. Make sure to rosdep update beforehand. The --skip-keys is useful to make rosdep continue, but you have to make sure you install the dependencies by hand, in this case brew install openni totakke/openni/sensor-kinect (after update rosdep should be able to install them for you).

I did brew unlink and link as well to make sure the openni that I installed from brew is properly linked.

I have outlined in my instructions why this happened and how to fix it with a manual link. The homebrew formula is updated no, so if you do brew update and then brew uninstall openni and then brew install openni there should not be the need for manually creating a link.

After @demmeln suggested the procedure, I get an error that I believe is related to the compiler somehow.

What does rosdep check --from-paths ./src --ignore-src output (after you updated rosdep)? What does brew info gcc output?

edit flag offensive delete link more

Comments

You might not actually need the sensor-kinect formula... at least not to compile it seems.

demmeln gravatar image demmeln  ( 2014-05-13 04:32:04 -0600 )edit

I will try this soon. Thanks a lot.

karthik_ms gravatar image karthik_ms  ( 2014-05-13 04:49:49 -0600 )edit

On 10.8 you might not even need the openni_camera patch, but it shouldn't hurt.

demmeln gravatar image demmeln  ( 2014-05-13 07:08:33 -0600 )edit

works on OS X 10.9

anaderi gravatar image anaderi  ( 2014-05-26 08:56:04 -0600 )edit

@demmeln Edited the question with the new errors (after post edit). Kindly help.

karthik_ms gravatar image karthik_ms  ( 2014-05-28 06:12:58 -0600 )edit
1

answered 2014-04-29 09:12:06 -0600

William gravatar image

updated 2014-04-29 09:12:27 -0600

The openni drivers are not provided by default on Ubuntu and are not part of "desktop_full". I think you will want the openni_camera and openni_launch packages:

$ mkdir ~/openni_ws
$ cd ~/openni_ws
$ source /path/to/hydro/install/setup.bash
$ rosinstall_generator openni_launch --deps --exclude RPP --tar > openni-hydro.rosinstall
$ wstool init src -j8 openni-hydro.rosinstall
$ rosdep install --from-paths ./src --ignore-src -y
$ catkin_make install
$ source ./install/setup.bash
$ roslaunch openni_launch openni.launch

Another option (for the Kinect) is the libfreenect stack.

edit flag offensive delete link more

Comments

After the `rosdep install --from-paths ./src --ignore-src -y` command, I get the following error. `openni_camera: No definition of [libopenni-sensor-primesense-dev] for OS [osx]` What do I do ?

karthik_ms gravatar image karthik_ms  ( 2014-04-29 18:03:47 -0600 )edit

That means rosdep doesn't know how to install `libopenni-sensor-primesense-dev` for OS X. It maybe that installing `brew install openni` is sufficient, but I'm not sure. You can add a `--skip-keys libopenni-sensor-primesense-dev` to the `rosdep` command to try and continue without it.

William gravatar image William  ( 2014-04-29 20:50:37 -0600 )edit

@William : Updated the question with new errors.

karthik_ms gravatar image karthik_ms  ( 2014-04-30 06:26:48 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2014-04-28 22:31:04 -0600

Seen: 1,577 times

Last updated: Aug 11 '15