add test examples

This commit is contained in:
shalenikol 2024-12-11 23:22:57 +03:00
parent a8a9fc0e5e
commit 6ca5bbe646
5 changed files with 92 additions and 0 deletions

32
test_examples/README.md Normal file
View file

@ -0,0 +1,32 @@
## Пример запуска симуляции (runtime) сцены с роботом
Запустить последовательно четыре терминала и выполнить запуск 3-х launch-файлов и симулятора Gazebo:
Во всех терминалах выполнить предварительную настройку:
```sh
# ROS2
source /opt/ros/humble/setup.bash
# Robossembler
cd ~/robossembler-ws
source install/setup.bash
```
* 1 - запуск интерфейсной ноды с серверами навыков
```bash
ros2 launch rbs_bt_executor interface.launch.py bt_path:=src/robossembler-ros2/test_examples/bt_default
```
* 2 - запуск runtime с роботом в сцене
```bash
ros2 launch rbs_bringup rbs_bringup.launch.py
```
* 3 - запуск Gazebo (для визуализации процесса)
```bash
ign gazebo -g
```
* 4 - запуск дерева поведения
```bash
ros2 launch rbs_bt_executor rbs_bt_web.launch.py bt_path:=src/robossembler-ros2/test_examples/bt_default
```
Чтобы наблюдать сцену с движением робота, нужно перейти в окно Gazebo.
![gazebo_rbs_arm](gazebo_rbs_arm.png)
*визуализация сцены с роботом*

View file

@ -0,0 +1,7 @@
<root BTCPP_format="4">
<BehaviorTree ID="Main">
<Sequence>
<Action ID="RbsAction" do="MoveToPose" command="move" sid="a"></Action>
</Sequence>
</BehaviorTree>
</root>

View file

@ -0,0 +1,49 @@
{
"skills": [
{
"sid": "a",
"SkillPackage": { "name": "Robossembler", "version": "1.0", "format": "1" },
"Module": { "node_name": "skill_mtp", "name": "MoveToPose", "description": "Move to Pose skill" },
"Launch": { "executable": "skill_movetopose.py", "package": "rbss_movetopose" },
"BTAction": [
{
"name": "move",
"type": "action",
"param": [
{
"type": "move_to_pose",
"dependency": { "robot_name": "rbs_arm",
"pose": { "position": {"x": -0.3, "y": -0.2, "z": 0.2}, "orientation": {"x":0.0, "y":1.0, "z":0.0, "w": 0.0} } }
}
],
"typeAction": "ACTION"
}
],
"topicsOut": [],
"Settings": {
"output": {
"params": [
{
"name": "server_name",
"value3": "mtp_jtc",
"value2": "mtp_moveit",
"value": "mtp_cart"
},
{
"name": "duration",
"value": "5.0"
},
{
"name": "end_effector_velocity",
"value": "1.0"
},
{
"name": "end_effector_acceleration",
"value": "1.0"
}
]
}
}
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB