diff --git a/rbss_movetopose/scripts/skill_movetopose.py b/rbss_movetopose/scripts/skill_movetopose.py index 8f3a125..af1656d 100755 --- a/rbss_movetopose/scripts/skill_movetopose.py +++ b/rbss_movetopose/scripts/skill_movetopose.py @@ -32,6 +32,8 @@ class MoveToPoseCartesianSkill(Node): val = prop["value"] if nam == "server_name": self.server_name = val + elif nam == "duration": + self.duration = float(val) elif nam == "end_effector_velocity": self.end_effector_velocity = float(val) elif nam == "end_effector_acceleration": @@ -42,6 +44,7 @@ class MoveToPoseCartesianSkill(Node): self._completion = False self.end_effector_velocity = 1.0 self.end_effector_acceleration = 1.0 + self.duration = 5.0 # for other nodes kwargs["allow_undeclared_parameters"] = True kwargs["automatically_declare_parameters_from_overrides"] = True @@ -126,6 +129,7 @@ class MoveToPoseCartesianSkill(Node): goal_msg.target_pose.orientation.w = pose["orientation"]["w"] goal_msg.robot_name = dep["robot_name"] + goal_msg.duration = self.duration goal_msg.end_effector_velocity = self.end_effector_velocity goal_msg.end_effector_acceleration = self.end_effector_acceleration return goal_msg diff --git a/test_examples/README.md b/test_examples/README.md new file mode 100644 index 0000000..2ff21e7 --- /dev/null +++ b/test_examples/README.md @@ -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) +*визуализация сцены с роботом* diff --git a/test_examples/bt_default/bt.xml b/test_examples/bt_default/bt.xml new file mode 100644 index 0000000..bf2584d --- /dev/null +++ b/test_examples/bt_default/bt.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/test_examples/bt_default/skills.json b/test_examples/bt_default/skills.json new file mode 100644 index 0000000..d85cf6b --- /dev/null +++ b/test_examples/bt_default/skills.json @@ -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" + } + ] + } + } + } + ] +} \ No newline at end of file diff --git a/test_examples/gazebo_rbs_arm.png b/test_examples/gazebo_rbs_arm.png new file mode 100644 index 0000000..6de96f6 Binary files /dev/null and b/test_examples/gazebo_rbs_arm.png differ