完善描述文档
This commit is contained in:
parent
2ebfbb4c94
commit
84c38f206e
95
README.md
95
README.md
@ -1,10 +1,11 @@
|
|||||||
# ROS-noetic安装,应用于Ubuntu20.04lts
|
# <p align="center">ROS_Learn</p>
|
||||||
## 注:最好全程使用root权限
|
## 实验一
|
||||||
|
### ROS-noetic安装,应用于Ubuntu20.04lts<br>注:最好全程使用root权限
|
||||||
|
#### 1.切换ubuntu软件源,访问清华源来提升下载速度。
|
||||||
```c
|
```c
|
||||||
sudo vim /etc/apt/sources.list # 进入apt下载源文件
|
sudo vim /etc/apt/sources.list # 进入apt下载源文件
|
||||||
```
|
```
|
||||||
|
删除所有ubuntu官方源(最好提前备份以下文件避免操作失误无法恢复),添加清华源
|
||||||
删除所有ubuntu官方源,添加清华源
|
|
||||||
```c
|
```c
|
||||||
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
|
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
|
||||||
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
|
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
|
||||||
@ -22,8 +23,8 @@ deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restric
|
|||||||
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
|
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
|
||||||
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
|
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
|
||||||
```
|
```
|
||||||
|
vim中按`Esc`退出编辑模式,按`Shift+;`进入命令输入模式输入`wq`保存退出。<br>
|
||||||
添加ROS源地址
|
在命令行中输入下列命令添加ROS源地址。
|
||||||
```c
|
```c
|
||||||
sudo sh -c 'echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros-latest.list'
|
sudo sh -c 'echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros-latest.list'
|
||||||
```
|
```
|
||||||
@ -31,11 +32,11 @@ sudo sh -c 'echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu focal main"
|
|||||||
```c
|
```c
|
||||||
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-keys 6A030B21B4D2B67B
|
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-keys 6A030B21B4D2B67B
|
||||||
```
|
```
|
||||||
更新源
|
更新软件源
|
||||||
```c
|
```c
|
||||||
sudo apt update
|
sudo apt update
|
||||||
```
|
```
|
||||||
安装ROS-noetic
|
安装ROS-noetic(适用于Ubuntu20.04Lts)
|
||||||
```c
|
```c
|
||||||
sudo apt install ros-noetic-desktop-full
|
sudo apt install ros-noetic-desktop-full
|
||||||
```
|
```
|
||||||
@ -66,8 +67,12 @@ sudo apt install --reinstall ros-noetic-desktop-full
|
|||||||
dpkg -l | grep ros-noetic-roslaunch
|
dpkg -l | grep ros-noetic-roslaunch
|
||||||
# 若roslaunch以安装则无需执行下条命令
|
# 若roslaunch以安装则无需执行下条命令
|
||||||
sudo apt install ros-noetic-roslaunch
|
sudo apt install ros-noetic-roslaunch
|
||||||
|
# 将路径换为文件/文件夹路径,赋予文件/文件夹可执行权限
|
||||||
|
chmod -x /路径
|
||||||
|
# 将文件/文件夹可编辑权限赋予某用户
|
||||||
|
sudo chown -R 用户名:用户名 /路径
|
||||||
```
|
```
|
||||||
启动roscore
|
#### 2.启动roscore
|
||||||
```c
|
```c
|
||||||
roscore
|
roscore
|
||||||
```
|
```
|
||||||
@ -80,12 +85,42 @@ rosrun turtlesim turtlesim_node
|
|||||||
rosrun turtlesim turtle_teleop_key
|
rosrun turtlesim turtle_teleop_key
|
||||||
```
|
```
|
||||||
|
|
||||||
# 二
|
## 实验二
|
||||||
|
### ROS中话题通信
|
||||||
编译工作空间
|
编译工作空间
|
||||||
```c
|
```c
|
||||||
catkin_make
|
catkin_make
|
||||||
```
|
```
|
||||||
启动roscore
|
启动roscore(终端A)
|
||||||
|
```c
|
||||||
|
roscore
|
||||||
|
```
|
||||||
|
添加环境变量(所有新终端窗口要执行下列命令)
|
||||||
|
```c
|
||||||
|
source /home/zmn/Gitea/ROS_Learn/devel/setup.bash
|
||||||
|
```
|
||||||
|
启动发送端(终端B)
|
||||||
|
```c
|
||||||
|
rosrun position_demo publisher_node.py
|
||||||
|
```
|
||||||
|
启动订阅端(终端C)
|
||||||
|
```c
|
||||||
|
rosrun position_demo subscriber_node.py
|
||||||
|
```
|
||||||
|
启动RViz(终端D)
|
||||||
|
```c
|
||||||
|
rviz
|
||||||
|
```
|
||||||
|
注:将RViz左侧 Global Options 面板中 Fixed Frame 改为程序中的 world 。
|
||||||
|
在 Displays 面板中,点击 Add,添加 Marker 类型。
|
||||||
|
|
||||||
|
## 实验三
|
||||||
|
### ROS中服务和客户
|
||||||
|
编译工作空间
|
||||||
|
```c
|
||||||
|
catkin_make
|
||||||
|
```
|
||||||
|
启动roscore(终端A)
|
||||||
```c
|
```c
|
||||||
roscore
|
roscore
|
||||||
```
|
```
|
||||||
@ -93,45 +128,19 @@ roscore
|
|||||||
```c
|
```c
|
||||||
source /home/zmn/Gitea/ROS_Learn/devel/setup.bash
|
source /home/zmn/Gitea/ROS_Learn/devel/setup.bash
|
||||||
```
|
```
|
||||||
启动发送端
|
启动发送端(终端B)
|
||||||
```c
|
```c
|
||||||
rosrun position_demo publisher_node.py
|
rosrun position_demo publisher_node_three.py
|
||||||
```
|
```
|
||||||
启动客户端
|
启动订阅端(也是客户端)(终端C)
|
||||||
```c
|
```c
|
||||||
rosrun position_demo subscriber_node.py
|
rosrun position_demo subscriber_node_three.py
|
||||||
```
|
```
|
||||||
启动RViz
|
启动RViz(终端F)
|
||||||
```c
|
```c
|
||||||
rviz
|
rviz
|
||||||
```
|
```
|
||||||
将RViz左侧 Global Options 面板中 Fixed Frame 改为程序中的 world 。
|
将RViz左侧 Global Options 面板中 Fixed Frame 改为程序中的 world 。
|
||||||
在 Displays 面板中,点击 Add,添加 Marker 类型。
|
在 Displays 面板中,点击 Add,添加 Marker 类型。
|
||||||
|
|
||||||
# 三
|
### 注:服务端(节点C)提供FFT服务暂未完成。
|
||||||
编译工作空间
|
|
||||||
```c
|
|
||||||
catkin_make
|
|
||||||
```
|
|
||||||
启动roscore
|
|
||||||
```c
|
|
||||||
roscore
|
|
||||||
```
|
|
||||||
添加环境变量
|
|
||||||
```c
|
|
||||||
source /home/zmn/Gitea/ROS_Learn/devel/setup.bash
|
|
||||||
```
|
|
||||||
启动发送端
|
|
||||||
```c
|
|
||||||
rosrun position_demo publisher_node_three.py
|
|
||||||
```
|
|
||||||
启动客户端
|
|
||||||
```c
|
|
||||||
rosrun position_demo subscriber_node_three.py
|
|
||||||
```
|
|
||||||
启动RViz
|
|
||||||
```c
|
|
||||||
rviz
|
|
||||||
```
|
|
||||||
将RViz左侧 Global Options 面板中 Fixed Frame 改为程序中的 world 。
|
|
||||||
在 Displays 面板中,点击 Add,添加 Marker 类型。
|
|
Loading…
x
Reference in New Issue
Block a user