# photoneo官网已经提供了ubuntu16.04的安装包了,此条博客内容无效,请到官网下载(2019.06.13)
首先在此网址下载电脑对应的驱动Ubuntu Linux 16.04 LTS (64bit) – gcc5.4并安装.
然后在phoxi_camera的github网址上下载包并编译,安装步骤见文件README,使用的branch是master.
注意!!!:在README中你会发现安装的gcc版本是4.9,这与我们下载的Ubuntu16.04对应的PhoXi Control Software的gcc版本5.4不符,需要额外操作.
解决方法:
这一步就是按照README中的步骤来:
cd catkin_ws/src
git clone https://github.com/photoneo/phoxi_camera.git
cd phoxi_camera
chmod +x install_prerequisities.sh
./install_prerequisities.sh
然后执行:
$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 120 --slave /usr/bin/g++ g++ /usr/bin/g++-5
$ sudo update-alternatives --config gcc
显示:
有 2 个候选项可用于替换 gcc (提供 /usr/bin/gcc)。
选择 路径 优先级 状态
------------------------------------------------------------
* 0 /usr/bin/gcc-5 120 自动模式
1 /usr/bin/gcc-4.9 60 手动模式
2 /usr/bin/gcc-5 120 手动模式
要维持当前值[*]请按<回车键>,或者键入选择的编号:
输入编号gcc-5的版本然后按回车,这一步非常重要,在帖子上说是用4.9,经测试这样是行不通的,请务必使用gcc-5,然后继续执行如下步骤:
cd ../..
catkin build
这时会有如下报错:
Errors << phoxi_camera:cmake /home/zzz/phoxi_camera-master/logs/phoxi_camera/build.cmake.000.log
CMake Error at /opt/PhotoneoPhoXiControl/PhoXiConfig.cmake:25 (include):
include could not find load file:
/opt/PhotoneoPhoXiControl/cmake/PhoXiConfig_.cmake
Call Stack (most recent call first):
CMakeLists.txt:4 (find_package)
CMake Warning (dev) at CMakeLists.txt:77 (target_link_libraries):
Link library type specifier "optimized" is followed by specifier "debug"
instead of a library name. The first specifier will be ignored.
This warning is for project developers. Use -Wno-dev to suppress it.
好的,此时我们与成功只有一步之遥了,观察报错信息发现编译过程中在目录/opt/PhotoneoPhoXiControl/cmake/
下找不到PhoXiConfig_.cmake
文件,我们cd到这个目录下,将文件名更改为PhoXiConfig_.cmake
即可.可能会碰到文件无法重命名的情况,使用命令sudo chmod -R 777 [文件名]
即可对文件修改了.
在我们原来编译的空间内使用catkin clean
和catkin clean -b
确保之前的编译内容被删除,然后重新编译catkin build
或者catkin_make
即可编译成功了.
然后在workspace中运行:
roslaunch phoxi_camera phoxi_camera_test.launch
即可看到和github教程上一样的结果.
打开phoxi_camera_test.launch
文件可以看到这个文件订阅了两个node,分别是phoxi_camera.cpp
和phoxi_camera_example.py
着重看phoxi_camera_example.py
文件,其中name = ""
这一行将""中的内容改为你自己的相机在phoxi control软件中显示的ID,到此你就可以顺利的在ROS中使用photoneo的深度相机了!
如果仍旧有问题,请参考此网页:https://github.com/BerkeleyAutomation/manuals/blob/master/phoxi_camera_setup.md