博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
TurtleBot3-ROS简化安装教程
阅读量:4873 次
发布时间:2019-06-11

本文共 4023 字,大约阅读时间需要 13 分钟。

  以下脚本将允许您简化ROS安装过程。在TurtleBot PC上的终端窗口中运行以下命令。终端应用程序可以通过屏幕左上角的Ubuntu搜索图标找到。终端的快捷键是Ctrl- Alt- T。安装ROS后,请重启TurtleBot PC。

sudo apt-get updatesudo apt-get upgradewget https://raw.githubusercontent.com/ROBOTIS-GIT/robotis_tools/master/install_ros_kinetic_rp3.sh && chmod 755 ./install_ros_kinetic_rp3.sh && bash ./install_ros_kinetic_rp3.sh

  注意:为了检查安装了哪些软件包,请查看install_ros_kinetic_rp3.sh

sudo apt-get install vimvim install_ros_kinetic_rp3.sh

  如下所示:

#!/bin/bash# Apache License 2.0# Copyright (c) 2017, ROBOTIS CO., LTD.echo ""echo "[Note] Target OS version  >>> Ubuntu Mate for the Raspberry Pi"echo "[Note] Target ROS version >>> ROS Kinetic Kame"echo "[Note] Catkin workspace   >>> $HOME/catkin_ws"echo ""echo "PRESS [ENTER] TO CONTINUE THE INSTALLATION"echo "IF YOU WANT TO CANCEL, PRESS [CTRL] + [C]"readecho "[Set the target OS, ROS version and name of catkin workspace]"name_os_version=${name_os_version:="xenial"}name_ros_version=${name_ros_version:="kinetic"}name_catkin_workspace=${name_catkin_workspace:="catkin_ws"}echo "[Update the package lists and upgrade them]"sudo apt-get update -ysudo apt-get upgrade -yecho "[Install build environment, the chrony, ntpdate and set the ntpdate]"sudo apt-get install -y chrony ntpdate build-essentialsudo ntpdate ntp.ubuntu.comecho "[Add the ROS repository]"if [ ! -e /etc/apt/sources.list.d/ros-latest.list ]; then  sudo sh -c "echo \"deb http://packages.ros.org/ros/ubuntu ${name_os_version} main\" > /etc/apt/sources.list.d/ros-latest.list"fiecho "[Download the ROS keys]"roskey=`apt-key list | grep "ROS Builder"`if [ -z "$roskey" ]; then  sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116fiecho "[Check the ROS keys]"roskey=`apt-key list | grep "ROS Builder"`if [ -n "$roskey" ]; then  echo "[ROS key exists in the list]"else  echo "[Failed to receive the ROS key, aborts the installation]"  exit 0fiecho "[Update the package lists and upgrade them]"sudo apt-get update -ysudo apt-get upgrade -yecho "[Install the ros-base]"sudo apt-get install -y ros-$name_ros_version-ros-baseecho "[Initialize rosdep]"sudo sh -c "rosdep init"rosdep updateecho "[Environment setup and getting rosinstall]"source /opt/ros/$name_ros_version/setup.shsudo apt-get install -y python-rosinstallecho "[Make the catkin workspace and test the catkin_make]"mkdir -p $HOME/$name_catkin_workspace/srccd $HOME/$name_catkin_workspace/srccatkin_init_workspacecd $HOME/$name_catkin_workspacecatkin_makeecho "[Set the ROS evironment]"sh -c "echo \"alias eb='nano ~/.bashrc'\" >> ~/.bashrc"sh -c "echo \"alias sb='source ~/.bashrc'\" >> ~/.bashrc"sh -c "echo \"alias gs='git status'\" >> ~/.bashrc"sh -c "echo \"alias gp='git pull'\" >> ~/.bashrc"sh -c "echo \"alias cw='cd ~/$name_catkin_workspace'\" >> ~/.bashrc"sh -c "echo \"alias cs='cd ~/$name_catkin_workspace/src'\" >> ~/.bashrc"sh -c "echo \"alias cm='cd ~/$name_catkin_workspace && catkin_make'\" >> ~/.bashrc"sh -c "echo \"source /opt/ros/$name_ros_version/setup.bash\" >> ~/.bashrc"sh -c "echo \"source ~/$name_catkin_workspace/devel/setup.bash\" >> ~/.bashrc"sh -c "echo \"export ROS_MASTER_URI=http://localhost:11311\" >> ~/.bashrc"sh -c "echo \"export ROS_HOSTNAME=localhost\" >> ~/.bashrc"source $HOME/.bashrcecho "[Complete!!!]"exit 0

  小技巧:这里可以将最后的网络配置localhost改一下,改成树莓派当前的IP地址:

sh -c "echo \"export ROS_MASTER_URI=http:192.168.43.11:11311\" >> ~/.bashrc"sh -c "echo \"export ROS_HOSTNAME=192.168.43.11\" >> ~/.bashrc"

  测试ROS安装是否成功:

  出现[/rosout],即成功。

源码下载:

cd ~/catkin_ws/srcgit clone https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver.gitgit clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.gitgit clone https://github.com/ROBOTIS-GIT/turtlebot3.git

删除TurtleBot PC中不需要的一些软件包

cd ~/catkin_ws/src/turtlebot3sudo rm -r turtlebot3_description/ turtlebot3_teleop/ turtlebot3_navigation/ turtlebot3_slam/ turtlebot3_example/

安装依赖包

sudo apt-get install ros-kinetic-rosserial-python ros-kinetic-tf ros-kinetic-urdf

  

 

转载于:https://www.cnblogs.com/kay2018/p/10783136.html

你可能感兴趣的文章
数据库基本语句大全
查看>>
模仿smarty迷你类代码
查看>>
Mysql单表查询
查看>>
ubuntu 12.04 不能关机
查看>>
检测某地方新闻小站
查看>>
SOAP=RPC+HTTP+XML
查看>>
【转】 Pro Android学习笔记(四五):Dialog(2):DialogFragment
查看>>
跑路(洛谷 1613)
查看>>
微软云平台媒体服务实践系列 2- 使用动态封装为iOS, Android , Windows 等多平台提供视频点播(VoD)方案...
查看>>
C#_数组
查看>>
art-template辅助函数和子模板
查看>>
整型数转字符串
查看>>
Fancytree Javascript Tree TreeTable 树介绍和使用
查看>>
python 基础
查看>>
理解Shadow DOM(一)
查看>>
C# 委托
查看>>
IOS开发之XML解析以及下拉刷新上拉加载更多的分享
查看>>
UVA136有关优先队列
查看>>
Unity5.6.0f3 VideoPlayer Android崩溃问题
查看>>
hdu 3046 Pleasant sheep and big big wolf 最小割
查看>>