0
$\begingroup$

Rosanswers logo

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/karthikkovalam/41ab44e53283390646be)

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
[ 86%] Built target openni_driver
[ 93%] Built target openni_node
Linking CXX shared library /Users/Siva/openni_ws/devel/lib/libopenni_nodelet.dylib
Undefined symbols for architecture x86_64:
  "log4cxx::Level::getWarn()", referenced from:
      openni_camera::DriverNodelet::onInitImpl() in driver.cpp.o
  "log4cxx::Level::getError()", referenced from:
      openni_camera::DriverNodelet::onInitImpl() in driver.cpp.o
  "log4cxx::Level::getFatal()", referenced from:
      openni_camera::DriverNodelet::onInitImpl() in driver.cpp.o
  "log4cxx::Logger::getLogger(char const*)", referenced from:
      openni_camera::DriverNodelet::onInitImpl() in driver.cpp.o
  "log4cxx::helpers::ObjectPtrBase::~ObjectPtrBase()", referenced from:
      log4cxx::helpers::ObjectPtrT<log4cxx::Logger>::~ObjectPtrT() in driver.cpp.o
      log4cxx::helpers::ObjectPtrT<log4cxx::Level>::~ObjectPtrT() in driver.cpp.o
  "typeinfo for log4cxx::helpers::ObjectPtrBase", referenced from:
      typeinfo for log4cxx::helpers::ObjectPtrT<log4cxx::Logger> in driver.cpp.o
      typeinfo for log4cxx::helpers::ObjectPtrT<log4cxx::Level> in driver.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [/Users/Siva/openni_ws/devel/lib/libopenni_nodelet.dylib] Error 1
make[1]: *** [openni_camera/CMakeFiles/openni_nodelet.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

Originally posted by karthik_ms on ROS Answers with karma: 71 on 2014-04-28

Post score: 1


Original comments

Comment by William on 2014-04-30:
Well it is not finding openni, but I don't know why. You can also try libfreenect.

Comment by karthik_ms on 2014-04-30:
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

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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-science/pull/882
  2. openni_camera needs a patch to compile: https://github.com/ros-drivers/openni_camera/pull/22
  3. rosdep keys are missing: https://github.com/ros/rosdistro/pull/4264

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?


Originally posted by demmeln with karma: 4306 on 2014-05-13

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by demmeln on 2014-05-13:
You might not actually need the sensor-kinect formula... at least not to compile it seems.

Comment by karthik_ms on 2014-05-13:
I will try this soon. Thanks a lot.

Comment by demmeln on 2014-05-13:
On 10.8 you might not even need the openni_camera patch, but it shouldn't hurt.

Comment by anaderi on 2014-05-26:
works on OS X 10.9

Comment by karthik_ms on 2014-05-28:
@demmeln Edited the question with the new errors (after post edit). Kindly help.

$\endgroup$
0
$\begingroup$

Rosanswers logo

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.


Originally posted by William with karma: 17335 on 2014-04-29

This answer was NOT ACCEPTED on the original site

Post score: 1


Original comments

Comment by karthik_ms on 2014-04-29:
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 ?

Comment by William on 2014-04-29:
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.

Comment by karthik_ms on 2014-04-30:
@william : Updated the question with new errors.

$\endgroup$

Your Answer

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