【1. ubuntu18.04安装ROS Melodic】

简介: 【1. ubuntu18.04安装ROS Melodic】

1. 前期准备

首先进入系统的软件和更新,选择清华源


1.png

2. 设置软件源:

清华匹配的ros_ubuntu版本




sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'

2.png


3. 设置最新的密钥:



sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654


3.png

4. 安装更新

sudo apt-get update

4.png


5. 安装ROS Melodic



sudo apt-get install ros-melodic-desktop-full

5.png

6.png


6. 安装 ros-melodic-rqt

sudo apt-get install ros-melodic-rqt*

7.png

8.png

7. 先安装ros-python

sudo apt-get install python-rosdep

9.png



8. 初始化rosdep:

sudo rosdep init

出现如下错误

10.png/

三种方法


8.1 第一种电脑连接手机热点

8.2 第二种修改系统访问地址

基本是网络问题,换个网络尝试下(PS:我用手机热点解决的):


访问 The Best IP Address, 查询 raw.githubusercontent.com 的ip地址


11.png

我的是111.4.135.201


打开




sudo gedit /etc/hosts


12.png



111.4.135.201 raw.githubusercontent.com


13.png

8.3 第三种通过访问其他地址仓库

我台式机第三种,采用如果报错请重启再试一是,非常谢谢阿杰:https://www.bilibili.com/video/BV1aP41137k9/?spm_id_from=333.788&vd_source=530bf85167de80ff1628de3bdb9da898




sudo apt-get install python3-pip

14.png




sudo pip3 install 6-rosdep

15.png

16.png




sudo 6-rosdep



17.png

18.png

sudo rosdep init 
rosdep update

19.png

20.png


9. 安装rosinstall

sudo apt-get install python-rosinstall

21.png

10. 加载环境设置文件



source /opt/ros/melodic/setup.bash

11. 创建并初始化工作目录

ROS使用一个名为catkin的ROS专用构建系统。为了使用它,用户需要创建并初始化
catkin工作目录,如下所示。除非用户创建新的工作目录,否则此设置只需设置一次。
 mkdir -p ~/catkin_ws/src
    cd ~/catkin_ws/src
    catkin_init_workspace

目前,只有src目录和CMakeLists.txt文件在catkin工作目录中,使用catkin_make命令来构建


ifconfig

22.png

ip地址是192.168.1.110
  cd ~/catkin_ws/
    catkin_make


设置环境变量:


sudo apt install net-tools
gedit ~/.bashrc
# Set ROS melodic
source /opt/ros/melodic/setup.bash
source ~/catkin_ws/devel/setup.bash
# Set ROS Network
#ifconfig查看你的电脑ip地址
export ROS_HOSTNAME=192.168.1.110
export ROS_MASTER_URI=http://${ROS_HOSTNAME}:11311
# Set ROS alias command 快捷指令
alias cw='cd ~/catkin_ws'
alias cs='cd ~/catkin_ws/src'
alias cm='cd ~/catkin_ws && catkin_make'

12. 超级终端Terminator ROS开发得力助手



sudo apt install terminator

23.png

24.png

ctr+alt+t快捷打开终端
Ctrl+Shift+O
    Split terminals Horizontally.(上下开新窗口)
Ctrl+Shift+E
    Split terminals Vertically.(垂直开新窗口)
Ctrl+Shift+Right
    Move parent dragbar Right.(放大当前窗口 向右)
Ctrl+Shift+Left
    Move parent dragbar Left.
Ctrl+Shift+Up
    Move parent dragbar Up.
Ctrl+Shift+Down
    Move parent dragbar Down.
Ctrl+Shift+W
    Close the current terminal.
Alt+Up
    Move to the terminal above the current one.(切换当前窗口)
Alt+Down
    Move to the terminal below the current one.
Alt+Left
    Move to the terminal left of the current one.
Alt+Right
    Move to the terminal right of the current one.
Ctrl+Shift+S
    Hide/Show Scrollbar.(隐藏滚动条)
Ctrl+Shift+F
    Search within terminal scrollback
Ctrl+Shift+N or Ctrl+Tab
    Move to next terminal within the same tab, use Ctrl+PageDown to move to the next tab. If cycle_term_tab is False, cycle within the same tab will be disabled
Ctrl+Shift+P or Ctrl+Shift+Tab
    Move to previous terminal within the same tab, use Ctrl+PageUp to move to the previous tab. If cycle_term_tab is False, cycle within the same tab will be disabled
Ctrl+Shift+C
    Copy selected text to clipboard
Ctrl+Shift+V
    Paste clipboard text
Ctrl+Shift+Q
    Quits Terminator
Ctrl+Shift+X (最大化当前窗口)
    Toggle between showing all terminals and only showing the current one (maximise).
Ctrl+Shift+Z
    Toggle between showing all terminals and only showing a scaled version of the current one (zoom).
Ctrl+Shift+T
    Open new tab
Ctrl+Shift+Alt+T
    Open new tab at root level, if using extreme_tabs.
Ctrl+PageDown
    Move to next Tab
Ctrl+PageUp
    Move to previous Tab
Ctrl+Shift+PageDown
    Swap tab position with next Tab
Ctrl+Shift+PageUp
    Swap tab position with previous Tab
Ctrl+Shift+F
    Open buffer search bar to find substrings in the scrollback buffer. Hit Escape to cancel.
Ctrl+Plus (+)
    Increase font size. Note: this may require you to press shift, depending on your keyboard
Ctrl+Minus (-)
    Decrease font size. Note: this may require you to press shift, depending on your keyboard
Ctrl+Zero (0)
    Restore font size to original setting.
F11
    Toggle fullscreen(放大当前窗口)
Ctrl+Shift+R
    Reset terminal state
Ctrl+Shift+G
    Reset terminal state and clear window

25.png

此时,我们可以对终端进行“水平分割”或“垂直分割”等命令:


26.png


13. 小海龟测试

打开三个终端:


27.png

roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key


总结:行则将至,作则必成

相关实践学习
使用ROS创建VPC和VSwitch
本场景主要介绍如何利用阿里云资源编排服务,定义资源编排模板,实现自动化创建阿里云专有网络和交换机。
ROS入门实践
本课程将基于基础设施即代码 IaC 的理念,介绍阿里云自动化编排服务ROS的概念、功能和使用方式,并通过实际应用场景介绍如何借助ROS实现云资源的自动化部署,使得云上资源部署和运维工作更为高效。
目录
相关文章
|
Ubuntu 机器人 Shell
在Jetson TX2的Ubuntu18.04系统中安装ROS的教程
所有这些步骤并不复杂,但确实需要仔细一点。如果遇到问题,不要灰心,问题是解决问题的开始。保持耐心,细心阅读错误信息,通常情况下,问题的答案就藏在其中。祝ROS旅程顺利!
541 18
|
存储 Ubuntu 安全
ROS2教程02 ROS2的安装、配置和测试
本文是关于ROS2(机器人操作系统2)的安装、配置和测试的教程。内容包括使用一键安装脚本快速安装ROS2 Humble版,手动安装步骤,设置语言环境、添加软件源、更新软件包、安装ROS2桌面版和开发工具,配置ROS2环境,创建工作空间,配置ROS2领域以避免网络冲突,以及如何删除ROS2。此外,还包括了测试ROS2是否安装成功的两个案例:基本的Topic通信测试和使用Turtlesim演示程序。适用于Ubuntu 22.04操作系统。
5236 1
ROS2教程02 ROS2的安装、配置和测试
|
Ubuntu Shell C++
在Ubuntu18.04上安装ros2的环境,ros2的常用命令:播放包、录制包等
在Ubuntu18.04上安装ros2的环境,ros2的常用命令:播放包、录制包等
1783 1
|
Ubuntu Apache
Ubuntu20.04下一键安装ROS1 Noetic
本文提供了一个简化在Ubuntu 20.04系统上安装ROS1 Noetic过程的一键安装脚本工具,该脚本通过优化配置和使用清华大学镜像源,加速了国内用户的下载速度,并自动完成环境设置和依赖安装,同时提供了详细的使用说明和源码。
1969 0
Ubuntu20.04下一键安装ROS1 Noetic
|
Ubuntu 机器人 Linux
|
传感器 人工智能 算法
ROS机器人操作系统
ROS机器人操作系统
818 1
|
自动驾驶 安全 机器人
ROS2:从初识到深入,探索机器人操作系统的进化之路
前言 最近开始接触到基于DDS的这个系统,是在稚晖君的机器人项目中了解和认识到。于是便开始自己买书学习起来,感觉挺有意思的,但是只是单纯的看书籍,总会显得枯燥无味,于是自己又开始在网上找了一些视频教程结合书籍一起来看,便让我对ROS系统有了更深的认识和理解。 ROS的发展历程 ROS诞生于2007年的斯坦福大学,这是早期PR2机器人的原型,这个项目很快被一家商业公司Willow Garage看中,类似现在的风险投资一样,他们投了一大笔钱给这群年轻人,PR2机器人在资本的助推下成功诞生。 2010年,随着PR2机器人的发布,其中的软件正式确定了名称,就叫做机器人操作系统,Robot Op
926 14
|
XML 算法 自动驾驶
ROS进阶:使用URDF和Xacro构建差速轮式机器人模型
【11月更文挑战第7天】本篇文章介绍的是ROS高效进阶内容,使用URDF 语言(xml格式)做一个差速轮式机器人模型,并使用URDF的增强版xacro,对机器人模型文件进行二次优化。
916 6
|
自动驾驶 安全 机器人
ROS2:从初识到深入,探索机器人操作系统的进化之路
【11月更文挑战第4天】ROS2的学习过程和应用,介绍DDS系统的框架和知识。
1941 1
|
传感器 数据可视化 机器人
【ROS速成】半小时入门机器人ROS系统简明教程之可视化系统(三)
半小时入门机器人ROS系统简明教程之可视化系统
1333 0