|
| 1 | +# Copyright (C) 2025 Robotec.AI |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +from typing import Sequence |
| 16 | + |
| 17 | +from rai_bench.tool_calling_agent_bench.agent_tasks_interfaces import ( |
| 18 | + ToolCallingAgentTask, |
| 19 | +) |
| 20 | +from rai_bench.tool_calling_agent_bench.ros2_agent_tasks import ( |
| 21 | + GetAllROS2RGBCamerasTask, |
| 22 | + GetObjectPositionsTask, |
| 23 | + GetROS2DepthCameraTask, |
| 24 | + GetROS2MessageTask, |
| 25 | + GetROS2RGBCameraTask, |
| 26 | + GetROS2TopicsTask, |
| 27 | + GetROS2TopicsTask2, |
| 28 | + GrabExistingObjectTask, |
| 29 | + GrabNotExistingObjectTask, |
| 30 | + MoveExistingObjectFrontTask, |
| 31 | + MoveExistingObjectLeftTask, |
| 32 | + MoveToPointTask, |
| 33 | + SwapObjectsTask, |
| 34 | +) |
| 35 | + |
| 36 | +tasks: Sequence[ToolCallingAgentTask] = [ |
| 37 | + GetROS2RGBCameraTask(), |
| 38 | + GetROS2TopicsTask(), |
| 39 | + GetROS2DepthCameraTask(), |
| 40 | + GetAllROS2RGBCamerasTask(), |
| 41 | + GetROS2TopicsTask2(), |
| 42 | + GetROS2MessageTask(), |
| 43 | + MoveToPointTask(args={"x": 1.0, "y": 2.0, "z": 3.0, "task": "grab"}), |
| 44 | + MoveToPointTask(args={"x": 1.2, "y": 2.3, "z": 3.4, "task": "drop"}), |
| 45 | + GetObjectPositionsTask( |
| 46 | + objects={ |
| 47 | + "carrot": [{"x": 1.0, "y": 2.0, "z": 3.0}], |
| 48 | + "apple": [{"x": 4.0, "y": 5.0, "z": 6.0}], |
| 49 | + "banana": [ |
| 50 | + {"x": 7.0, "y": 8.0, "z": 9.0}, |
| 51 | + {"x": 10.0, "y": 11.0, "z": 12.0}, |
| 52 | + ], |
| 53 | + }, |
| 54 | + ), |
| 55 | + GrabExistingObjectTask( |
| 56 | + object_to_grab="banana", |
| 57 | + objects={ |
| 58 | + "banana": [{"x": 7.0, "y": 8.0, "z": 9.0}], |
| 59 | + "apple": [ |
| 60 | + {"x": 4.0, "y": 5.0, "z": 6.0}, |
| 61 | + {"x": 10.0, "y": 11.0, "z": 12.0}, |
| 62 | + ], |
| 63 | + }, |
| 64 | + ), |
| 65 | + GrabNotExistingObjectTask( |
| 66 | + object_to_grab="apple", |
| 67 | + objects={ |
| 68 | + "banana": [{"x": 7.0, "y": 8.0, "z": 9.0}], |
| 69 | + "cube": [ |
| 70 | + {"x": 4.0, "y": 5.0, "z": 6.0}, |
| 71 | + {"x": 10.0, "y": 11.0, "z": 12.0}, |
| 72 | + ], |
| 73 | + }, |
| 74 | + ), |
| 75 | + MoveExistingObjectLeftTask( |
| 76 | + object_to_grab="banana", |
| 77 | + objects={ |
| 78 | + "banana": [{"x": 7.0, "y": 8.0, "z": 9.0}], |
| 79 | + "apple": [ |
| 80 | + {"x": 4.0, "y": 5.0, "z": 6.0}, |
| 81 | + {"x": 10.0, "y": 11.0, "z": 12.0}, |
| 82 | + ], |
| 83 | + }, |
| 84 | + ), |
| 85 | + MoveExistingObjectFrontTask( |
| 86 | + object_to_grab="banana", |
| 87 | + objects={ |
| 88 | + "banana": [{"x": 7.0, "y": 8.0, "z": 9.0}], |
| 89 | + "apple": [ |
| 90 | + {"x": 4.0, "y": 5.0, "z": 6.0}, |
| 91 | + {"x": 10.0, "y": 11.0, "z": 12.0}, |
| 92 | + ], |
| 93 | + }, |
| 94 | + ), |
| 95 | + SwapObjectsTask( |
| 96 | + objects={ |
| 97 | + "banana": [{"x": 1.0, "y": 2.0, "z": 3.0}], |
| 98 | + "apple": [{"x": 4.0, "y": 5.0, "z": 6.0}], |
| 99 | + }, |
| 100 | + objects_to_swap=["banana", "apple"], |
| 101 | + ), |
| 102 | +] |
0 commit comments