文档更新

This commit is contained in:
yewuya 2023-05-16 20:39:30 +08:00
parent 5d69fbe3f2
commit 69766a0098
3 changed files with 47 additions and 26 deletions

29
ROS.md
View File

@ -1,26 +1,3 @@
## 参数服务器
### 设置参数
```c++
ros::NodeHandle n;
n.setParam("camera/session", to_string(session));
```
### 获取参数
```c++
ros::NodeHandle n;
string session_s;
n.getParam("camera/session", session_s);
```
[[ros 命令]]
[[ros c++]]
[[ros python]]

19
ros c++.md Normal file
View File

@ -0,0 +1,19 @@
## 参数服务器
### 设置参数
```c++
ros::NodeHandle n;
n.setParam("camera/session", to_string(session));
```
### 获取参数
```c++
ros::NodeHandle n;
string session_s;
n.getParam("camera/session", session_s);
```

25
ros python.md Normal file
View File

@ -0,0 +1,25 @@
python文件头内容
```python
#!/usr/bin/env python3 #指定运行环境
# coding:utf-8 #指定文件编码
import rospy
```
python 文件需要存储在ros 功能包 scripts 路径下
```shell
mkdir scripts #创建scripts路径
```
需要先设置python 文件为可执行文件
```shell
chmod +x sample.py
```
编译运行python代码
```shell
cd ros_workspace #回到工作空间
catkin_make #编译代码
source devel/setup.bash #编译后要source刷新环境
rosrun ros_workspace sample.py #运行python代码
```