完善描述文档

This commit is contained in:
张梦南 2025-07-02 21:06:06 +08:00
parent 164c74260e
commit 928f878d77
5 changed files with 18 additions and 8 deletions

BIN
Pictures/Service_one.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

BIN
Pictures/Service_two.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

View File

@ -1,7 +1,7 @@
# <p align="center">ROS_Learn</p>
## 实验一
### ROS-noetic安装应用于Ubuntu20.04lts<br>最好全程使用root权限
#### 1.切换ubuntu软件源访问清华源来提升下载速度。
切换ubuntu软件源访问清华源来提升下载速度。
```c
sudo vim /etc/apt/sources.list # 进入apt下载源文件
```
@ -24,6 +24,7 @@ deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
```
vim中按`Esc`退出编辑模式,按`Shift+`进入命令输入模式输入`wq`保存退出。<br>
<br>
在命令行中输入下列命令添加ROS源地址。
```c
sudo sh -c 'echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu focal main" > /etc/apt/sources.list.d/ros-latest.list'
@ -73,7 +74,7 @@ chmod +x /路径
# 将文件/文件夹可编辑权限赋予某用户
sudo chown -R 用户名:用户名 /路径
```
#### 2.启动roscore
#### 启动roscore
```c
roscore
```
@ -115,7 +116,7 @@ catkin_make
```
设置文件可执行权限
```c
chmod +x scripts/程序名.py
chmod +x /文件路径/程序名.py
```
添加环境变量(所有新终端窗口要执行下列命令)
```c
@ -137,9 +138,13 @@ rosrun Topic_Newsletter Publisher_TN.py
```c
rviz
```
将RViz左侧 Global Options 面板中 Fixed Frame 设为 map (默认无需修改)。
将RViz左侧 Global Options 面板中 Fixed Frame 设为 map (默认无需修改)。<br>
在 Displays 面板中,点击 Add添加 Marker 类型。
### 结果图
终端运行数据结果:<br>
![话题通讯1](/Pictures/Topic_Newsletter_one.png#pic_center)
RViz图像<br>
![话题通讯2](/Pictures/Topic_Newsletter_two.png#pic_center)
## 实验三
### ROS中服务端和客户端
编译工作空间
@ -148,7 +153,7 @@ catkin_make
```
设置文件可执行权限
```c
chmod +x scripts/程序名.py
chmod +x /文件路径/程序名.py
```
添加环境变量
```c
@ -168,11 +173,16 @@ rosrun Service Subscriber_Client_S.py
```
启动发送端终端D
```c
rosrun Service Publister_S.py
rosrun Service Publisher_S.py
```
启动RViz终端F
```c
rviz
```
将RViz左侧 Global Options 面板中 Fixed Frame 改为程序中的 world 。
将RViz左侧 Global Options 面板中 Fixed Frame 改为程序中的 world 。<br>
在 Displays 面板中,点击 Add添加 Marker 类型。
### 结果图
终端运行数据结果:<br>
![服务和客户1](/Pictures/Service_one.png#pic_center)
RViz图像<br>
![服务和客户2](/Pictures/Service_two.png#pic_center)