【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使用教程
资源编排(Resource Orchestration)是一种简单易用的云计算资源管理和自动化运维服务。用户通过模板描述多个云计算资源的依赖关系、配置等,并自动完成所有资源的创建和配置,以达到自动化部署、运维等目的。编排模板同时也是一种标准化的资源和应用交付方式,并且可以随时编辑修改,使基础设施即代码(Infrastructure as Code)成为可能。 产品详情:https://www.aliyun.com/product/ros/
目录
相关文章
|
4月前
|
并行计算 Ubuntu Linux
Ubuntu学习笔记(五):18.04安装多版本CUDA
这篇博客文章介绍了在Ubuntu 18.04系统上如何安装和切换不同版本的CUDA,以及如何安装不同版本的cuDNN。
316 2
|
5天前
|
缓存 Ubuntu Linux
Linux中yum、rpm、apt-get、wget的区别,yum、rpm、apt-get常用命令,CentOS、Ubuntu中安装wget
通过本文,我们详细了解了 `yum`、`rpm`、`apt-get`和 `wget`的区别、常用命令以及在CentOS和Ubuntu中安装 `wget`的方法。`yum`和 `apt-get`是高层次的包管理器,分别用于RPM系和Debian系发行版,能够自动解决依赖问题;而 `rpm`是低层次的包管理工具,适合处理单个包;`wget`则是一个功能强大的下载工具,适用于各种下载任务。在实际使用中,根据系统类型和任务需求选择合适的工具,可以大大提高工作效率和系统管理的便利性。
54 25
|
4月前
|
并行计算 PyTorch TensorFlow
Ubuntu安装笔记(一):安装显卡驱动、cuda/cudnn、Anaconda、Pytorch、Tensorflow、Opencv、Visdom、FFMPEG、卸载一些不必要的预装软件
这篇文章是关于如何在Ubuntu操作系统上安装显卡驱动、CUDA、CUDNN、Anaconda、PyTorch、TensorFlow、OpenCV、FFMPEG以及卸载不必要的预装软件的详细指南。
6872 3
|
15天前
|
Ubuntu API 网络虚拟化
ubuntu22 编译安装docker,和docker容器方式安装 deepseek
本脚本适用于Ubuntu 22.04,主要功能包括编译安装Docker和安装DeepSeek模型。首先通过Apt源配置安装Docker,确保网络稳定(建议使用VPN)。接着下载并配置Docker二进制文件,创建Docker用户组并设置守护进程。随后拉取Debian 12镜像,安装系统必备工具,配置Ollama模型管理器,并最终部署和运行DeepSeek模型,提供API接口进行交互测试。
241 15
|
1月前
|
弹性计算 Ubuntu Java
OS-Copilot-ubuntu镜像版本的具体测试使用(安装方式有单独注明)
作为一名个人开发者,我主要负责云资源的运维和管理。在使用OS Copilot的过程中,我遇到了一些配置问题,特别是在ECS实例中设置AccessKey时,但最终成功解决了。通过使用OS Copilot的-t/-f/管道功能,我大大提升了效率,减少了命令编写的工作量,特别是在搭建Java运行环境时效果显著。此外,| 功能帮助我快速理解文档,整体体验非常流畅,推荐给其他开发者使用。
43 6
|
2月前
|
JSON Ubuntu 开发者
ubuntu 22安装lua环境&&编译lua cjson模块
通过上述步骤,可以在 Ubuntu 22.04 系统上成功安装 Lua 环境,并使用 LuaRocks 或手动编译的方式安装 lua-cjson 模块。本文详细介绍了每一步的命令和操作,确保每一步都能顺利完成,适合需要在 Ubuntu 系统上配置 Lua 开发环境的开发者参考和使用。
219 13
|
2月前
|
监控 关系型数据库 MySQL
Ubuntu24.04安装Librenms
此指南介绍了在Linux系统上安装和配置LibreNMS网络监控系统的步骤。主要内容包括:安装所需软件包、创建用户、克隆LibreNMS仓库、设置文件权限、安装PHP依赖、配置时区、设置MariaDB数据库、调整PHP-FPM与Nginx配置、配置SNMP及防火墙、启用命令补全、设置Cron任务和日志配置,最后通过网页完成安装。整个过程确保LibreNMS能稳定运行并提供有效的网络监控功能。
|
3月前
|
Ubuntu 开发工具 git
Ubuntu安装homebrew的完整教程
本文介绍了如何在没有公网的情况下安装 Homebrew。首先访问 Homebrew 官网,然后通过阿里云的镜像克隆安装脚本,并创建普通用户进行安装。接着修改 `install.sh` 文件指向国内镜像,执行安装命令。最后配置环境变量并更换 Homebrew 源为国内镜像,确保安装顺利。
808 50
|
2月前
|
Ubuntu Linux Docker
Ubuntu22.04上Docker的安装
通过以上详细的安装步骤和命令,您可以在Ubuntu 22.04系统上顺利安装
1413 12
|
3月前
|
Ubuntu
ubuntu和debian 的安装包dpkg管理命令对安装包进行安装,查询,卸载
Ubuntu dpkg 软件包管理命令概览:安装、卸载、查看和配置软件包。包括解决依赖、强制卸载、列出及过滤已安装包、查看包详情等操作。
147 10