Ubuntu14.04安装MoveIt以及Kinect2驱动的问题

news/2024/11/22 5:44:29/

2019年1月15日更新:回头看这篇博客,写的比较乱、冗杂,所以,做了一些修改。

之所以写这篇博客,是因为我在这个上面浪费了两三天时间,算是总结出来一个比较正确的安装流程。

电脑配置:型号:ThinkPad E470,220G固态硬盘,8G内存,双显卡:Intel HD Graphics 620和NVIDIA GeForce 940MX。

系统:Win10与Ubuntu14.04双系统。关于双系统的安装较为简单,首先是用rufus制作一个U盘系统安装盘,记得选择MER for BIOS or UEFI。然后一步步安装,在系统安装位置选择界面,选择与Win10共存,即安装出来的是双系统。

本文主要参考了如下教程:

ROS indigo安装:

http://wiki.ros.org/indigo/Installation/Ubuntu

http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment

MoveIt:http://moveit.ros.org/install/。

UR配置文件:

http://wiki.ros.org/ur_gazebo?distro=indigo

https://blog.csdn.net/jayandchuxu/article/details/54693870

https://github.com/ThomasTimm/ur_modern_driver,

Kinect配置:

https://blog.csdn.net/sunbibei/article/details/51594824

https://github.com/OpenKinect/libfreenect2

https://developer.nvidia.com/cuda-75-downloads-archive

https://github.com/code-iai/iai_kinect2 

当Ubuntu系统安装好之后,开始安装ROS indigo,官网上有详细的安装的步骤,摘抄如下:

1)、安装ROS Indigo

参照官网教程

ROS Indigo ONLY supportsSaucy (13.10) and Trusty (14.04) for debian packages.

Configure yourUbuntu repositories

Configure your Ubuntu repositories to allow "restricted,""universe," and "multiverse."

Setup yoursources.list

Setup your computer to accept software from packages.ros.org.

sudo sh -c 'echo "debhttp://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" >/etc/apt/sources.list.d/ros-latest.list'

Set up your keys

sudo apt-key adv --keyserverhkp://ha.pool.sks-keyservers.net:80 --recv-key421C365BD9FF1F717815A3895523BAEEB01FA116

Installation

First, make sure your Debian package index is up-to-date:

· sudo apt-get update

· Desktop-FullInstall: (Recommended) : ROS, rqtrviz, robot-generic libraries, 2D/3D simulators and 2D/3Dperception

o  sudo apt-get install ros-indigo-desktop-full

To find available packages, use:

apt-cache search ros-indigo

Initialize rosdep

Before you can use ROS, you will need to initialize rosdep. rosdep enables youto easily install system dependencies for source you want to compile and isrequired to run some core components in ROS.

sudo rosdep initrosdep update

Environment setup

It's convenient if the ROS environmentvariables are automatically added to your bash session every time a new shellis launched:

echo "source /opt/ros/indigo/setup.bash">> ~/.bashrcsource ~/.bashrc

Getting rosinstall

rosinstall is a frequently used command-line tool in ROS that is distributedseparately. It enables you to easily download many source trees for ROSpackages with one command.

To install this tool on Ubuntu, run:

sudo apt-get installpython-rosinstall

 

2)、建立工作空间

Managing Your Environment

$ printenv | grep ROS

Create a ROS Workspace

Let's create and build a catkin workspace:

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make
source devel/setup.bash

 

echo $ROS_PACKAGE_PATH
/home/youruser/catkin_ws/src:/opt/ros/kinetic/share

为了后续更好地使用工作空间,在此增加两句命令:

echo "source ~/catkin_ws/devel/setup.bash">> ~/.bashrcsource ~/.bashrc

这样不用每次打开一个Terminald都去source setup.bash文件了。

至此ROS安装完毕。

接下来就是安装MoveIt和UR机器人的配置文件。

3)、MoveItROS Indigo

Install Ubuntu Packages

Simplyrun:

sudo apt-get install ros-indigo-moveit

Optional: Install PR2 UbuntuPackages for MoveIt!

sudo apt-get install ros-indigo-moveit-full-pr2

Setup your environment

source /opt/ros/indigo/setup.bash

 

4)、UR机器人配置文件(与Gazebo配合)(不建议用这种方式安装,无法编辑程勋,推荐用git clone)

To simulate a UR5 and control it in simulation, first installthe necessary packages:

sudo apt-get install \
ros-indigo-ur-gazebo \
ros-indigo-ur5-moveit-config \
ros-indigo-ur-kinematics

 

git clone的安装方式(推荐使用)

git clone -b indigo https://github.com/ros-industrial/universal_robot.git
https://github.com/ros-industrial/universal_robot.git

To launch the simulated arm and a controller for it, run(记得将models文件放在~/.gazebo文件夹下面):

roslaunch ur_gazebo ur5.launch
roslaunch ur5_moveit_config ur5_moveit_planning_execution.launch sim:=true
roslaunch ur5_moveit_config moveit_rviz.launch config:=true

  

安装ur_modern_driver驱动包

安装驱动包之前,需要先安装ur_msgs

sudo apt-get install ros-indigo-ur-msgs

然后进入工作空间的src中,git clone源码编译

cd ~/catkin_ws/src
git clone https://github.com/ThomasTimm/ur_modern_driver.git
cd ~/catkin_ws
catkin_make

 然后就可以连接真实机器人啦

roslaunch ur_modern_driver ur5_bringup.launch robot_ip:=192.168.1.111
roslaunch ur5_moveit_config ur5_moveit_planning_executing.launch
roslaunch ur5_moveit_config moveit_rviz.launch config:=true

 

完成上述步骤后,切记要更新update(不是升级upgrade)系统,因为这对后面安装完显卡驱动之后,能不能顺利开机进入系统有很大的影响。更新完之后,重启,接着安装kinect2的驱动。

 

5)、安装libfreenect2 (Kinect2驱动)

Download libfreenect2 source

git clone https://github.com/OpenKinect/libfreenect2.git
cd libfreenect2

(Ubuntu 14.04 only) Download upgrade deb files

cd depends; ./download_debs_trusty.sh

 Install build tools

sudo apt-get install build-essential cmake pkg-config

Install libusb. The version must be >= 1.0.20.

(Ubuntu 14.04 only) sudo dpkg -i debs/libusb*deb
Install TurboJPEG
(Ubuntu 14.04 to 16.04) sudo apt-get install libturbojpeg libjpeg-turbo8-dev
Install OpenGL
(Ubuntu 14.04 only) sudo dpkg -i debs/libglfw3*deb; sudo apt-get install -f
Install CUDA (optional, Nvidia only):

(Ubuntu 14.04 only) Download cuda-repo-ubuntu1404...*.deb ("deb(network)") from Nvidia website  developer.nvidia.com/cuda-downloads , follow their installation instructions,including apt-getinstall cuda which installs Nvidia graphics driver.(关于Nvidia显卡驱动的安装,访问官网,新建terminal,运行安装程序)

安装完成之后,接着运行如下命令:

OpenCL/CUDA with Nvidia

Also install nvidia-modprobe and opencl-headers.

sudo apt-get install nvidia-modprobe opencl-headers

 You also need to add CUDA paths to the system environment, add these lines to you ~/.bashrc:

export LD_LIBRARY_PATH="/usr/local/cuda/lib64:${LD_LIBRARY_PATH}"
export PATH="/usr/local/cuda/bin:${PATH}"

 A system-wide configuration of the libary path can be created with the following commands:

echo "/usr/local/cuda/lib64" | sudo tee /etc/ld.so.conf.d/cuda.conf
sudo ldconfig

 Install OpenNI2 (optional)

(Ubuntu 14.04 only) sudo apt-add-repository ppa:deb-rob/ros-trusty && sudo apt-get update (You don't need this if you have ROS repos), then sudo apt-get install libopenni2-dev
Build
cd .. (back to the libfreenect2 root directory first)
mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/freenect2 -DENABLE_CXX11=ON -DCUDA_PROPAGATE_HOST_FLAGS=off
make
make install
Set up udev rules for device access: 
sudo cp ../platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/

 then replug the Kinect.

·        Run the test programme

./bin/Protonect

·        Run OpenNI2 test (optional): 

sudoapt-get install openni2-utils && sudo make install-openni2 &&NiViewer2. Environment variable LIBFREENECT2_PIPELINE canbe set to clcuda, etc to specify the pipeline.

 

6)、安装IAI Kinect2 KinectROS中使用的配置包)

Clone this repository into catkin workspace, install the dependencies andbuild it:

cd ~/catkin_ws/src/
git clone https://github.com/code-iai/iai_kinect2.git
cd iai_kinect2
rosdep install -r --from-paths .
cd ~/catkin_ws
catkin_make -DCMAKE_BUILD_TYPE="Release"

 Note: rosdep willoutput errors on not being able to locate kinect2_bridge and  depth_registration.That is fine because they are all part of the iai_kinect2 package and rosdep doesnot know these packages.

Connect your sensor and run kinect2_bridge:

roslaunch kinect2_bridge kinect2_bridge.launch

 Calibrate your sensor using the kinect2_calibration

Add the calibration files to the kinect2_bridge/data/<serialnumber> folder. 

Restart kinect2_bridge and view the results using 

rosrun kinect2_viewer kinect2_viewer kinect2 sd cloud

 至此,Kinect2的驱动以及与ROS的依赖包安装完成。

完成之后,测试MoveIt可用

roslaunch ur5_moveit_config demo.launch

 如果没问题,就算安装成功了。

然后重启,应该可以立即进入Ubuntu系统桌面,而不会在启动界面停留十几分钟。在后续的使用过程中,轻易不要更新。

 


http://www.ppmy.cn/news/209084.html

相关文章

Ubuntu16.04、ROS Kinetic、ur_modern_driver等安装

电脑配置&#xff1a;型号&#xff1a;ThinkPad E470,220G固态硬盘&#xff0c;8G内存&#xff0c;双显卡&#xff1a;Intel HD Graphics 620和NVIDIA GeForce 940MX。 系统&#xff1a;Win10与Ubuntu16.04双系统。关于双系统的安装较为简单&#xff0c;首先是用rufus制作一个…

python nlp包_StanfordNLP,让你在 Python 里一手掌握 53 种自然语言分析

发表日期:2019-06-12 StanfordNLP,让你在 Python 里一手掌握 53 种自然语言分析 —— 不久之前,斯坦福大学公开了它最新的自然语言处理代码库—— StanfordNLP。它不但包含了完整的语义分析工具链,还带有 73 个不同的高精度神经网络模... 作者:Mohd Sanad Zaki Rizvi 不久…

Thinkpad E系列刷BIOS无法启动点亮或开机显示屏不亮解决办法

过年期间一个亲戚在把thinkpad e460改为Windows 7&#xff0c;在安装驱动的时候好奇的更新BIOS&#xff0c;也就是安装了如图的软件&#xff0c; 结果重启电脑后&#xff0c;点不亮电脑了&#xff0c;但电源灯还是亮的。由于是过年期间&#xff0c;联想thinkpad售后放假&…

kvm虚拟化技术

KVM虚拟化技术 Qemu-kvm kvm virt-manager VNC Qemu-kvm创建和管理虚拟机 一.KVM简介 KVM&#xff08;名称来自英语&#xff1a;Kernel-basedVirtual Machine的缩写&#xff0c;即基于内核的虚拟机&#xff09;&#xff0c;是一种用于Linux内核中的虚拟化基础设施&#xff…

七代处理器装win7_Intel7代处理器 win10重装win7后无法安装显卡声卡驱动的解决方案 | A小可私人狗窝...

如题所述,之前微软正式对外宣布Win7将会只更新维护至2020年,并且只会推送安全漏洞修复内容,不会有新功能更新。对于Intel 7代酷睿和AMD的第七代Bristol Ridge APU的针对性优化也只有Win10系统能够享受得到。 本文将直接明了的分两块内容讲一下intel第7代处理器电脑,在格式化…

e470换高分屏_ThinkPadE470笔电(8G内存 256G固态 高分屏 14英寸) 京东5499元

ThinkPadE470是一款14英寸高性能时尚轻薄本&#xff0c;22mm的厚度和1.92Kg重量非常便携&#xff0c;石墨黑硬朗外观极具游戏性&#xff0c;高性能双核心/四线程处理器与入门级独立显卡为玩家带来出色的游戏体验。目前这款笔记本电脑正在京东 ThinkPad东南授权专卖店火热销售中…

Think E470 外放没有声音,插耳机有声音

Think E470 外放没有声音&#xff0c;插耳机有声音 前言解决方案 前言 笔记本电脑默认情况下是有外放声音的&#xff0c;不过有用户遇到Thinkpad E470没有外放声音&#xff0c;但是插上耳机却有声音的问题。遇到问题通常做法是将声卡驱动卸载并重新安装&#xff0c;如果重装声…

【ThinkPad E470C 】基本完美 附带镜像EFI等工具-Mojave后续自己升级为10.14

配置信息&#xff1a;笔记本为thinkpad e470c PN:20H3A001CDCPU第六代智能英特尔酷睿™i5-6200U处理器(2.3GHz睿频至2.8GHz,3MB) 内存8GB DDR4 2133Mhz内存硬盘250G SSD 固态硬盘集成显卡530 1G显存 显示屏14英寸HD LED背光显示屏分辨率1920*1080无线网卡DW1820a 定位系统Tra…