如果您对Ubuntu16.04/18.04安装及卸载ROSKinetic和ubuntu如何卸载ros感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解Ubuntu16.04/18.04安装及卸载R
如果您对Ubuntu 16.04/18.04 安装及卸载 ROS Kinetic和ubuntu如何卸载ros感兴趣,那么这篇文章一定是您不可错过的。我们将详细讲解Ubuntu 16.04/18.04 安装及卸载 ROS Kinetic的各种细节,并对ubuntu如何卸载ros进行深入的分析,此外还有关于Airsim 动态 | 安装 ROS 包装器(AirSim ROS Wrapper)、E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-kinetic-gazebo-dev/ros-kine...、install ros-indigo-pcl-ros、Intel Realsense D435 在 ROS:Kinetic + Ubuntu16.04 中安装使用的实用技巧。
本文目录一览:- Ubuntu 16.04/18.04 安装及卸载 ROS Kinetic(ubuntu如何卸载ros)
- Airsim 动态 | 安装 ROS 包装器(AirSim ROS Wrapper)
- E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-kinetic-gazebo-dev/ros-kine...
- install ros-indigo-pcl-ros
- Intel Realsense D435 在 ROS:Kinetic + Ubuntu16.04 中安装使用
Ubuntu 16.04/18.04 安装及卸载 ROS Kinetic(ubuntu如何卸载ros)
一、检查下Ubuntu初始环境
在正式的安装前,先检查下Ubuntu初始环境是否配置正确。
打开Ubuntu的设置->软件与更新->Ubuntu软件->勾选关键字universe,restricted,multiverse三项。 如图所示
二、添加sources.list
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $disTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
三、添加keys
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
四、系统更新
sudo apt update && sudo apt-get upgrade
五、安装ROS
ROS中有很多函数库和工具,官网提供了四种默认的安装方式,当然也可以单独安装某个特定的软件包。这四种方式包括桌面完整版安装、桌面版安装,基础版安装、单独软件包安装。推荐安装桌面完整版安装(包含ROS、rqt、rviz、通用机器人函数库、2D/3D仿真器、导航以及2D/3D感知功能),如下:
//16.04// sudo apt-get install ros-kinetic-desktop-full //18.04// sudo apt-get install ros-melodic-desktop-full
六、安装依赖项
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential ros-melodic-ros //(根据自己实际的ROS版本确定中间的名字)
七、配置ROS
配置ROS是安装完ROS之后必须的工作。
@H_301_36@1、初始化rosdepsudo rosdep init && rosdep update
这一步初始化rosdep,是使用ROS之前的必要一步。rosdep可以方便在你需要编译某些源码的时候为其安装一些系统依赖,同时也是某些ROS核心功能组件所必需用到的工具。
如果报错:
ERROR: cannot download default sources list from: https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list Website may be down.
1.1 解决办法1(18.04) 是网络问题,切换网络。
1.2 改参数(16.04)
sudo gedit /etc/hosts 在打开的文件末尾一行添加: 151.101.84.133 raw.githubusercontent.com sudo rosdep init && rosdep update@H_301_36@2、ROS环境配置
注意: ROS的环境配置,使得你每次打开一个新的终端,ROS的环境变量都能够自动配置好,也就是添加到bash会话中,因为命令source /opt/ros/kinetic/setup.bash 只在当前终端有作用,即具有单一时效性,要想每次新开一个终端都不用重新配置环境,就用echo语句将命令添加到bash会话中。
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
至此,ROS的安装就结束了,重启电脑,下面测试ROS能否正常运行。
八、测试ROS
首先启动ROS,输入代码运行roscore:
roscore
如果出现下图所示,那么说明ROS正常启动了!
九、测试小乌龟
接着我们测试ROS的吉祥物--小海龟,来简单的测试ROS运行是否正常,同时也来体验一下ROS的神奇与精彩!
启动roscore后,重新打开一个终端窗口,输入:
rosrun turtlesim turtlesim_node
你还看到一只萌萌的海龟出现在屏幕上,那么该怎么样来操纵这只小海龟呢?重新打开新的一个终端,输入:
rosrun turtlesim turtle_teleop_key
将鼠标聚焦在第三个终端窗口上,然后通过键盘上的方向键,进行操作小海龟,如果小海龟正常移动,并且在屏幕上留下自己的移动轨迹,如下图。恭喜你,ROS已经成功的安装、配置并且运行!
十、卸载ROS
sudo apt remove ros-*
Airsim 动态 | 安装 ROS 包装器(AirSim ROS Wrapper)
本期内容我们将带来在 Airsim 环境下使用 ROS Wrapper 的相关教程,以下是 AirSim 客户端库上的一些 ROS Wrapper 相关配置。
一、启动
以下步骤适用于 Linux 系统。如果是在 Windows 上运行 AirSim,可以使用 Windows Subsystem for Linux (WSL) 来运行 ROS 包装器,如果不想在主机上安装 ROS 相关工具,也可以使用 Docker 容器进行安装。请检查下方内容并按照需求安装,具体内容可以参照最后网址。
如果您的默认 GCC 版本不是 8 或更高版本(检查使用命令 gcc --version)
a) 安装 gcc >= 8.0.0:sudo apt-get install gcc-8 g++-8 b) 验证安装 gcc-8 --version
如果是 Ubuntu 18.04 版本 a) 安装 ROS melodic 版本 b) 安装 tf2 传感器和 mavros 包: sudo apt-get install ros-kinetic-tf2-sensor-msgs ros-kinetic-tf2-geometry-msgs ros-kinetic-mavros*
如果是 Ubuntu 16.04 版本 a) 安装 ROS Kinetic 版本 b) 安装 tf2 传感器和 mavros 包: sudo apt-get install ros-melodic-tf2-sensor-msgs ros-melodic-tf2-geometry-msgs ros-melodic-mavros*
如果是 Ubuntu 20.04 版本 a) 安装 ROS noetic 版本 b) 安装 tf2 传感器和 mavros 包: sudo apt-get install ros-melodic-tf2-sensor-msgs ros-melodic-tf2-geometry-msgs ros-melodic-mavros*
安装 catkin_tools: sudo apt-get install python-catkin-tools 或 pip install catkin_tools. 如果使用的 Ubuntu 是 20.04 版本,请使用以下安装命令: pip install "git+https://github.com/catkin/catkin_tools.git#egg=catkin_tools"
网址推荐: 1.WSL 在 Win10 上构建环境: https://microsoft.github.io/AirSim/airsim_ros_pkgs/#setting-up-the-build-environment-on-windows10-using-wsl1-or-wsl2
2. 使用 Docker: https://microsoft.github.io/AirSim/airsim_ros_pkgs/#using-docker-for-ros
二、构建环境
构建 AirSim: git clone https://github.com/Microsoft/AirSim.git; cd AirSim; ./setup.sh; ./build.sh; 确定已按照上述界面安装好并为 ROS 设置了环境变量。方便起见,将 “source” 命令添加到自己的【.bashrc】上(替换 melodic 为特定版本名称)。 echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc source ~/.bashrc
构建 ROS 包 cd ros; catkin build; # or catkin_make
请注意,如果自己默认 GCC 版本不是 8 以上的版本,则会导致编译失败,在这种情况下,可以使用【gcc-8】明确这一点: catkin build -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8
三、运行 source devel/setup.bash; roslaunch airsim_ros_pkgs airsim_node.launch; roslaunch airsim_ros_pkgs rviz.launch; 注意:如果运行时出现错误:
注意:如果运行时出现错误: roslaunch airsim_ros_pkgs airsim_node.launch 则可以使用命令 catkin clean 清除并重新运行。
四、使用 AirSim ROS wrapper 功能包 ROS wrapper 由两个 ROS 节点组成 —— 第一个是 AirSim 的多旋翼 C++ 客户端库的包装器,第二个是一个简单的 PD 位置控制器。
关于订阅和发布节点,参数与 service 可以参考网址: https://microsoft.github.io/AirSim/airsim_ros_pkgs/#airsim-ros-wrapper-node
PID 位置控制器节点可以参考: https://microsoft.github.io/AirSim/airsim_ros_pkgs/#simple-pid-position-controller-node
- End -
技术发展的日新月异,阿木实验室将紧跟技术的脚步,不断把机器人行业最新的技术和硬件推荐给大家。看到经过我们培训的学员在技术上突飞猛进,是我们培训最大的价值。如果你在机器人行业,就请关注我们的公众号,我们将持续发布机器人行业最有价值的信息和技术。 阿木实验室致力于前沿 IT 科技的教育和智能装备,让机器人研发更高效!
E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-kinetic-gazebo-dev/ros-kine...
参考:http://answers.ros.org/question/325039/apt-update-fails-cannot-install-pkgs-key-not-working/
在安装一些东西时,会出现上述错误(比如,我是安装gazebo-ros包时出现)其他的有关ros的包也会出现。
原因:密钥已更新,旧密钥不再有效,导致apt update和apt install出现问题。
old key: 421C365BD9FF1F717815A3895523BAEEB01FA116
new key: C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
1.删除旧密钥
Ubuntu 16.04和更新版本(使用ROS Kinetic,Melodic等):
sudo apt-key del 421C365BD9FF1F717815A3895523BAEEB01FA116
在Ubuntu 15.10和更早版本(即:14.04):
sudo apt-key del B01FA116
2.导入新密钥
此命令应适用于所有版本的Ubuntu:
sudo -E apt-key adv --keyserver ''hkp://keyserver.ubuntu.com:80'' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
3.最后一步
此时确保运行sudo apt update。您应该没有收到任何错误,随后sudo apt install命令现在也应该可以正常工作。
install ros-indigo-pcl-ros
CMake Warning at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:76 (find_package):
Could not find a package configuration file provided by "pcl_ros" with any
of the following names:
pcl_rosConfig.cmake
pcl_ros-config.cmake
Add the installation prefix of "pcl_ros" to CMAKE_PREFIX_PATH or set
"pcl_ros_DIR" to a directory containing one of the above files. If
"pcl_ros" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
bp_costmap/CMakeLists.txt:4 (find_package)
-- Could not find the required component ''pcl_ros''. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found.
CMake Error at /opt/ros/indigo/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
Could not find a package configuration file provided by "pcl_ros" with any
of the following names:
pcl_rosConfig.cmake
pcl_ros-config.cmake
Add the installation prefix of "pcl_ros" to CMAKE_PREFIX_PATH or set
"pcl_ros_DIR" to a directory containing one of the above files. If
"pcl_ros" provides a separate development package or SDK, be sure it has
been installed.
Call Stack (most recent call first):
bp_costmap/CMakeLists.txt:4 (find_package)
解决:
sudo apt-get install ros-indigo-pcl-ros
Intel Realsense D435 在 ROS:Kinetic + Ubuntu16.04 中安装使用
Intel Realsense D435 是 Intel 生产的一款 RGBD 相机,可以在 ROS 系统中安装和使用,本文使用的软件配置如下:
- Ubuntu 16.04
- 内核版本:4.15.0
- ROS kinetic
1. 前期准备
a. 首先更新 Ubuntu 及内核:
sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade
b. 升级程序包
sudo apt-get install --install-recommends linux-generic-lts-xenial xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial
c. 升级 OS Boot 并重启使用正确的内核
sudo update-grub && sudo reboot
d. 查看内核版本
uname -r
确定系统内核版本是 4.[4,8,10,13,15,16]
e. 下载源程序
ROS 源程序地址: https://github.com/IntelRealSense/realsense-ros/releases
根据 ROS 版本下载支持该版本的 SDK
SDK 源程序地址: https://github.com/IntelRealSense/librealsense/releases/tag/v2.25.0
f. 解压文件到 ~/librealsense/ 文件夹下
g. 在路径~/librealsense/ 下打开终端安装依赖项,不要连接 D435 相机。
sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev
h. 安装对应 Ubuntu 版本的依赖项
Ubuntu 16.04 版本:
sudo apt-get install libglfw3-dev
i. 运行脚本
./scripts/setup_udev_rules.sh
j. 建立并应用 patched 内核模块
这步有点儿慢
./scripts/patch-realsense-ubuntu-lts.sh
2. 安装 SDK
a. 运行 CMake
mkdir build && cd build
cmake ../
cmake ../ -DBUILD_EXAMPLES=true
b. 重编译和安装
sudo make uninstall && make clean && make && sudo make install
c. 运行 viewer 查看相机
realsense-viewer
d. 可在 realsense viewer 中更新 Firmware
3. 安装 ROS 包
将代码放于 catkin_ws/src/
catkin_init_workspace
cd ..
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc
参考资料:
ROS: https://github.com/IntelRealSense/realsense-ros
SDK: https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md
https://blog.csdn.net/sinat_23853639/article/details/88044019
我们今天的关于Ubuntu 16.04/18.04 安装及卸载 ROS Kinetic和ubuntu如何卸载ros的分享已经告一段落,感谢您的关注,如果您想了解更多关于Airsim 动态 | 安装 ROS 包装器(AirSim ROS Wrapper)、E: Failed to fetch http://packages.ros.org/ros/ubuntu/pool/main/r/ros-kinetic-gazebo-dev/ros-kine...、install ros-indigo-pcl-ros、Intel Realsense D435 在 ROS:Kinetic + Ubuntu16.04 中安装使用的相关信息,请在本站查询。
本文标签: