Files
Uni-Lab-OS/docs/developer_guide/add_action.md
Junhan Chang c78ac482d8 Initial commit
2025-04-17 15:19:47 +08:00

38 lines
1001 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 添加新动作指令Action
1.`unilabos_msgs/action` 中新建实验操作名和参数列表,如 `MyDeviceCmd.action`。一个 Action 定义由三个部分组成分别是目标Goal、结果Result和反馈Feedback之间使用 `---` 分隔:
```action
# 目标Goal
string command
---
# 结果Result
bool success
---
# 反馈Feedback
```
2.`unilabos_msgs/CMakeLists.txt` 中添加新定义的 action
```cmake
add_action_files(
FILES
MyDeviceCmd.action
)
```
3. 因为在指令集中新建了指令,因此调试时需要编译,并在终端环境中加载临时路径:
```bash
cd unilabos_msgs
colcon build
source ./install/local_setup.sh
cd ..
```
调试成功后,发起 pull requestUni-Lab 的 CI/CD 系统会自动将新的指令集编译打包mamba执行升级即可永久生效
```bash
mamba update ros-humble-unilabos-msgs -c http://quetz.dp.tech:8088/get/unilab -c robostack-humble -c robostack-staging
```