ros-indigo配置realsense R200的开发套件及遇到问题解决事项
2017-01-13 17:23
459 查看
本配置教程安装环境及需求如下:
Ubuntu 14.04.4 LTS (14.04.5也可以)
kernel 4.4.0-040400-generic
ros-indigo-desktop
gcc 4.9.3(貌似4.8.5也可以使用,第一步升级GCC4.9.3可以跳过)
realsense_camera
librealsense
一般情况下,安装完Ubuntu14.04.5及ros-indigo-desktop(完全安装)后,kernel4.4.0-040400-generic
就已经配置上了。
而在terminal输入'gcc-v',查看到当前gcc版本为4.8.4,需要升级为4.9.3
1.升级GCC4.9.3(这个步骤可以跳过,其实可以不升级)
在Terminal中输入下面的命令,在加上几分钟的等待,即可完成安装:
安装完成后,你会发现如果直接使用gcc/g++命令,默认采用的版本仍然是原来的4.8.4版本。你如果要使用新版的gcc/g++,必须采用命令gcc-4.9/g++-4.9。下面讲解如何将版本4.9设为默认。
采用以下命令:
就可将gcc/g++的默认版本设为4.9.4。update-alternatives是一个管理工具,能够管理同一个软件的不同版本。上命令中,参数slave保证gcc和g++版本的联动调整。而60是表示的优先级,你可以选用任何你喜欢的大于0的整数。那么,此时你再利用gcc命令查看当前的版本,就会发现已经是新版本了,如下图:
但是,接下来的一个问题是,如果你还想继续使用原来的版本,怎么办?况且原来版本并没有删除。同样还是利用update-alternatives,及如下的命令:
上面的优先级设为50,所有当前默认为4.9.2版本。你可以使用命令
来查看被update-alternatives管理的gcc不同版本,这同样可以针对g++。
既然gcc/g++的不同版本已被update-alternatives管理,那么如何在这两个不同的gcc/g++版本间进行切换使用呢?
采用如下图所示的命令,接着再输入对应的序号,就可以在不同的版本间进行切换:
2.安装realsense_camera
Useone of the following methods to enable the downloading of kernelsources on the system. This only needs to be done once per system orif the OS is re-installed or upgrade to a new major release.
(一般采用第一种方式就可以)
Method 1 (Script)(采用该方案即可)
or
Method 2 (Manual)
Updateyour
/etc/apt/sources.listfile and/or
/etc/apt/sources.list.d/*.listto uncomment (or add) the
deb-srcentries for all of the entries for the
mainrepositories. Below is an
examplefor ubuntu 16.04 (Xenial).
After the manual edits arecomplete, run the update commands to ensure the entries are correctand update the package database.
[ERROR]: /camera/driver - No cameras detected!
[ERROR]: /camera/driver - Error calling rs_create_context ( api_version:11100 ):
uvcvideo kernel module is not loaded
...
modprobe: ERROR: could not insert 'uvcvideo': Required key not available
Solution: (需要关掉Secure Boot,参考以下链接https://wiki.ubuntu.com/UEFI/SecureBoot/DKMS)
DKMS does not work with Secure Boot. You need to
disable it(https://wiki.ubuntu.com/UEFI/SecureBoot/DKMS).
DKMSFails to Build:
Solution:
Removethe failed DKMS installation
Most users should only need toinstall the prebuilt ROS Debian packages.
This will also install the requiredros-*-librealsense library on your system.
Keywords: realsense,librealsense, build, source, sources
Ubuntu 14.04.4 LTS (14.04.5也可以)
kernel 4.4.0-040400-generic
ros-indigo-desktop
gcc 4.9.3(貌似4.8.5也可以使用,第一步升级GCC4.9.3可以跳过)
realsense_camera
librealsense
一般情况下,安装完Ubuntu14.04.5及ros-indigo-desktop(完全安装)后,kernel4.4.0-040400-generic
就已经配置上了。
而在terminal输入'gcc-v',查看到当前gcc版本为4.8.4,需要升级为4.9.3
1.升级GCC4.9.3(这个步骤可以跳过,其实可以不升级)
在Terminal中输入下面的命令,在加上几分钟的等待,即可完成安装:
$ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
$ sudo apt-get update
$ sudo apt-get install gcc-4.9 g++-4.9
安装完成后,你会发现如果直接使用gcc/g++命令,默认采用的版本仍然是原来的4.8.4版本。你如果要使用新版的gcc/g++,必须采用命令gcc-4.9/g++-4.9。下面讲解如何将版本4.9设为默认。
采用以下命令:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.9
就可将gcc/g++的默认版本设为4.9.4。update-alternatives是一个管理工具,能够管理同一个软件的不同版本。上命令中,参数slave保证gcc和g++版本的联动调整。而60是表示的优先级,你可以选用任何你喜欢的大于0的整数。那么,此时你再利用gcc命令查看当前的版本,就会发现已经是新版本了,如下图:
但是,接下来的一个问题是,如果你还想继续使用原来的版本,怎么办?况且原来版本并没有删除。同样还是利用update-alternatives,及如下的命令:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
上面的优先级设为50,所有当前默认为4.9.2版本。你可以使用命令
sudo update-alternatives --query gcc
来查看被update-alternatives管理的gcc不同版本,这同样可以针对g++。
既然gcc/g++的不同版本已被update-alternatives管理,那么如何在这两个不同的gcc/g++版本间进行切换使用呢?
采用如下图所示的命令,接着再输入对应的序号,就可以在不同的版本间进行切换:
2.安装realsense_camera
参考地址:
http://wiki.ros.org/realsense_camera
http://wiki.ros.org/librealsense#Installation_Prerequisites
先安装
librealsense
Useone of the following methods to enable the downloading of kernelsources on the system. This only needs to be done once per system orif the OS is re-installed or upgrade to a new major release.
(一般采用第一种方式就可以)
Method 1 (Script)(采用该方案即可)
wget -O enable_kernel_sources.sh http://bit.ly/en_krnl_src bash ./enable_kernel_sources.sh'
or
Method 2 (Manual)
Updateyour
/etc/apt/sources.listfile and/or
/etc/apt/sources.list.d/*.listto uncomment (or add) the
deb-srcentries for all of the entries for the
mainrepositories. Below is an
examplefor ubuntu 16.04 (Xenial).
deb-src http://us.archive.ubuntu.com/ubuntu/ xenial main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-updates main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
After the manual edits arecomplete, run the update commands to ensure the entries are correctand update the package database.
sudo apt-get update
Re-install Package
If the package has failed toinstall because the kernel sources were not available, the packagewill need to be re-installed after the update.sudo apt-get --reinstall install 'ros-indigo-librealsense'
Installation Troubleshooting
如果安装过程出现问题,则参考如下方案:No cameras detected:
roslaunch realsense_camera [cam_type]_nodelet_[mode].launch
[ERROR]: /camera/driver - No cameras detected!
[ERROR]: /camera/driver - Error calling rs_create_context ( api_version:11100 ):
uvcvideo kernel module is not loaded
...
sudo modprobe uvcvideo
modprobe: ERROR: could not insert 'uvcvideo': Required key not available
Solution: (需要关掉Secure Boot,参考以下链接https://wiki.ubuntu.com/UEFI/SecureBoot/DKMS)
DKMS does not work with Secure Boot. You need to
disable it(https://wiki.ubuntu.com/UEFI/SecureBoot/DKMS).
DKMSFails to Build:
make KERNELRELEASE=4.4.0-43-generic -C /var/lib/dkms/uvcvideo/1.1.1-3-realsense/build/linux-src M=drivers/media/usb/uvc/....(bad exit status: 2) Error! Bad return status for module build on kernel: 4.4.0-43-generic (x86_64)
Solution:
Removethe failed DKMS installation
dkms remove -m uvcvideo -v "1.1.1-3-realsense" --all
再安装
realsense_
camera
Most users should only need toinstall the prebuilt ROS Debian packages.
sudo apt-get install 'ros-indigo-realsense-camera'
This will also install the requiredros-*-librealsense library on your system.
Building both librealsenseand RealSense Camera from Sources
Description: Instructions for building bothlibrealsense AND realsense_camera package from source files in thesame workspace.Keywords: realsense,librealsense, build, source, sources
Cloning sources into catkin Workspace
# Create the catkin workspace
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src #Download the source files
git clone https://github.com/intel-ros/realsense.git[/code]git clone https://github.com/IntelRealSense/librealsense.git[/code]#Checkout the latest stable codecd ~/catkin_ws/src/realsensegit checkout -b stable-branch stablecd ~/catkin_ws/src/librealsensegit checkout -b stable-branch stableInstall Dependencies
# Update the dependencies databaserosdep update#Attempt to install dependencies#Requires that your login has sudo privileges to instal as root using apt-getcd ~/catkin_wsrosdep -y install --from-paths src --ignore-srcBuild the Packages
Build librealsense FIRST
cd ~/catkin_wscatkin_make --pkg librealsenseBuild realsense_camera second
cd ~/catkin_ws#Remove any existing realsense_camera binariescatkin_make clean --pkg realsense_camera#Build the packagecatkin_make --pkg realsense_cameraUse the Package
source ~/catkin_ws/devel/setup.bashroslaunch realsense_camera r200_nodelet_default.launch(这句如果有问题,可能需要Linux安装摄像头的驱动,按照下一步安装摄像头驱动)
2.安装realsense_camera驱动roslaunch realsense_camera r200_nodelet_default.launch(这句会有问题,因为目前Linux还未安装摄像头的驱动,下一步我们需要安装摄像头驱动)
Ensure apt-get is up to datesudoapt-get update && sudo apt-get upgrade
Note: Usesudoapt-get dist-upgrade, instead ofsudoapt-get upgrade, in case you have an older Ubuntu 14.04version (with deprecatednvidia-331*packages installed), as this prevents the linux 4.4* kernel tocompile properly.
这一步运行的时候可能会出现security模式的问题,可以退出安全模式,看到一个窗口时先按esc,再确定,设置8位密码,然后确定即可。
Install libusb-1.0 and pkg-configvia apt-getsudoapt-get install libusb-1.0-0-dev pkg-config
glfw3 is not available in apt-geton Ubuntu 14.04. Use included installer script:scripts/install_glfw3.sh(该文件在下载的librealsensepackage下面,我们需要先cd到librealsense目录下,执行该命令)
For 16.04 you can install glfw3viasudo apt-get install libglfw3-dev
We use QtCreator as an IDE forLinux development on Ubuntu
Note: QtCreatoris presently configured to use the V4L2 backend by defaultsudoapt-get install qtcreatorsudoscripts/install_qt.sh(we also need qmake from thefull qt5 distribution)all.procontains librealsense and all example applications
From the QtCreator top menu:Clean => Run QMake => Build
Built QtCreator projects will beplaced into./bin/debugor./bin/release
We also provide a cmake file ifyou'd prefer to use your own favourite text editormkdirbuildcdbuildcmake..make&& sudo make install
The library will be installed in/usr/local/liband header file in /usr/local/include
Note: If youwould also like to compile the code examples use:cmake.. -DBUILD_EXAMPLES:BOOL=truemake&& sudo make install
The example executables will build into./examplesand install into/usr/local/bin.此时,摄像头即可运行~
相关文章推荐
- Android Studio-—使用OpenCV的配置方法和demo以及开发过程中遇到的问题解决
- Android Studio-—使用OpenCV的配置方法和demo以及开发过程中遇到的问题解决
- Java与Android开发环境配置以及遇到的问题解决
- myeclipse配置hadoop开发环境,及遇到问题解决
- 配置开发环境遇到的一些问题及解决方法
- iOS开发工具-如何使用网络封包分析工具Charles,通过配置proxy对http、https、tcp、udp 等协议的请求响应过程交互信息进行分析、判断、解决我们移动开发中的遇到的各种实际问题。
- ros indigo安装时遇到的问题以及解决办法
- myeclipse配置hadoop开发环境,及遇到问题解决
- myeclipse配置hadoop开发环境,及遇到问题解决
- myeclipse配置hadoop开发环境,及遇到问题解决
- Flex4 + FluorineFx配置开发环境时遇到的问题及解决方法
- kafka+zookeeper集群安装与配置(CENTOS7环境)及开发中遇到的问题解决
- asp.net2.0开发遇到的小问题解决方法
- 最近oracle开发中遇到的一些问题及解决办法(一)待续
- 最近oracle开发中遇到的一些问题及解决办法(二)待续
- 在windows2003下安装Microsoft SQL Server2000企业版后配置客户端ODBC遇到的问题及解决方法
- Cas单点登录配置SSL时遇到的javax.net.ssl.SSLPeerUnverifiedException问题的解决方法
- 解决在Eclipse中配置JBoss、Tomcat等插件时遇到的问题