安装ubuntu18.04 +ros+kinectV1

参考连接

安装方法1(未尝试)

(1)安装
sudo apt-get install ros-kinetic-freenect-*
rospack profile

(2)使用
安装rqt-image-view显示图像
sudo apt-get install ros-kinetic-rqt-image-view
运行相机以及显示
roslaunch freenect_launch freenect.launch
rosrun rqt_image_view rqt_image_view

(3)可能会有的错误
kinect v1深度相机介绍以及ubuntu16.04下的使用_第3张图片
会有警告和错误,不影响图像显示,因为点云图的话题没有才报的错。

安装方法2,githup下载功能包安装

一.安装ros melodic
对于ubuntu18,需要先安装ros melodic才能使用catkin_make命令,对于ros melodic的安装,几篇博客倒是介绍的比较完整,下面贴出链接:
https://blog.csdn.net/haiyinshushe/article/details/84256137
按照里面的步骤安装测试即可,基本都不会有问题

二.安装libfreenect库

安装ubuntu18.04 +ros+kinectV1_第1张图片

选择一个位置

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

三.安装freenect_stack
首先,创建catkin_ws/src文件夹,在home下运行如下命令

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
git clone https://github.com/ros-drivers/freenect_stack.git
cd ~/catkin_ws
catkin_make
rospack profile

catkin_make出错:

安装ubuntu18.04 +ros+kinectV1_第2张图片
catkin_makes需要先安装ros melodic才能使用catkin_make命令; tx2换源,参考:
https://blog.csdn.net/qlulibin/article/details/80271096

清华源: deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/
xenial-updates main restricted universe multiverse deb-src
http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-updates main
restricted universe multiverse deb
http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main
restricted universe multiverse deb-src
http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-security main
restricted universe multiverse deb
http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports
main restricted universe multiverse deb-src
http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial-backports
main restricted universe multiverse deb
http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main universe
restricted deb-src
http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ xenial main universe
restricted

科大的源: deb http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main
restricted universe multiverse deb-src
http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-updates main
restricted universe multiverse deb
http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main
restricted universe multiverse deb-src
http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-security main
restricted universe multiverse deb
http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main
restricted universe multiverse deb-src
http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial-backports main
restricted universe multiverse deb
http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial main universe
restricted deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ xenial
main universe restricted

替换之后,执行 sudo apt-get update

此时还不能成功运行
roslaunch freenect_launch freenect.launch
还需要运行

source devel/setup.bash
roslaunch freenect_launch freenect.launch

可能出现错误esource not found: rgbd_launch,解决如下:

sudo apt-get install ros-melodic-rgbd-launch

最后运行相机

cd /home/ubuntu/catkin_ws
source devel/setup.bash
roslaunch freenect_launch freenect.launch
rosrun rqt_image_view rqt_image_view 

在rqt_image_view中左上角选择不同的话题,就可以查看不同的图像,也可以查看深度图。

你可能感兴趣的:(TX2,ros,安装,linux,ubuntu,深度学习)