Skip to content

Commit abfa97e

Browse files
committed
formatting changes
1 parent 84d922a commit abfa97e

File tree

11 files changed

+24
-35
lines changed

11 files changed

+24
-35
lines changed

src/rai_bench/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
The RAI Bench is a package including benchmarks and providing frame for creating new benchmarks
66

77
### Components
8+
89
- `Scenario` - class Defined by a Scene and Task
910
- `Benchamrk` - class responsible for running scenarios.
1011
- `Task` - abstract class for creating specific task. It introduces helper funtions that make it easier to calculate metrics/scores
12+
1113
### Example implementation
1214

1315
- `o3de_test_bench` - it's example of creating benchmark.

src/rai_bench/rai_bench/benchmark_model.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,22 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import time
1615
import logging
16+
import time
1717
from abc import ABC, abstractmethod
18-
from typing import TypeVar, Union, List
18+
from typing import List, TypeVar, Union
1919

20+
from langchain_core.messages import AIMessage, BaseMessage, HumanMessage
2021
from rclpy.impl.rcutils_logger import RcutilsLogger
2122

22-
from langchain_core.messages import BaseMessage, HumanMessage, AIMessage
23-
2423
from rai.messages import HumanMultimodalMessage
2524
from rai_sim.simulation_bridge import (
25+
PoseModel,
2626
SimulationBridge,
2727
SimulationConfig,
28-
PoseModel,
2928
SpawnedEntity,
3029
)
3130

32-
3331
SimulationBridgeT = TypeVar("SimulationBridgeT", bound=SimulationBridge)
3432
loggers_type = Union[RcutilsLogger, logging.Logger]
3533

@@ -167,7 +165,6 @@ def __init__(
167165
def create_scenarios(
168166
cls, tasks: List[Task], simulation_configs: List[SimulationConfig]
169167
):
170-
171168
scenarios = []
172169
for task in tasks:
173170
for sim_conf in simulation_configs:
@@ -191,7 +188,7 @@ def run_next(self, agent):
191188
"======================================================================================"
192189
)
193190
self._logger.info(
194-
f"RUNNING SCENARIO NUMBER {i+1}, TASK: {scenario.task.get_prompt()}"
191+
f"RUNNING SCENARIO NUMBER {i + 1}, TASK: {scenario.task.get_prompt()}"
195192
)
196193
initial_result = scenario.task.calculate_result(self.simulation_bridge)
197194
self._logger.info(f"RESULT OF THE INITIAL SETUP: {initial_result}")

src/rai_bench/rai_bench/main.py

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,29 @@
1313
# limitations under the License.
1414

1515
########### EXAMPLE USAGE ###########
16-
import rclpy
1716
import logging
1817
import time
19-
import rclpy.qos
18+
from pathlib import Path
2019

21-
from rai_bench.benchmark_model import (
22-
Benchmark,
23-
Scenario,
24-
)
20+
import rclpy
21+
import rclpy.qos
2522
from rai_open_set_vision.tools import GetGrabbingPointTool
2623

2724
from rai.agents.conversational_agent import create_conversational_agent
2825
from rai.communication.ros2.connectors import ROS2ARIConnector
2926
from rai.tools.ros.manipulation import GetObjectPositionsTool, MoveToPointTool
3027
from rai.tools.ros2.topics import GetROS2ImageTool, GetROS2TopicsNamesAndTypesTool
3128
from rai.utils.model_initialization import get_llm_model
32-
from rai_sim.simulation_bridge import Translation
29+
from rai_bench.benchmark_model import (
30+
Benchmark,
31+
)
32+
from rai_bench.o3de_test_bench.tasks import GrabCarrotTask, PlaceCubesTask
3333
from rai_sim.o3de.o3de_bridge import (
3434
O3DEngineArmManipulationBridge,
3535
O3DExROS2SimulationConfig,
3636
PoseModel,
3737
)
38-
from rai_bench.o3de_test_bench.tasks import GrabCarrotTask, PlaceCubesTask
39-
40-
from pathlib import Path
41-
38+
from rai_sim.simulation_bridge import Translation
4239

4340
if __name__ == "__main__":
4441
rclpy.init()
@@ -53,7 +50,7 @@
5350
You are a robotic arm with interfaces to detect and manipulate objects.
5451
Here are the coordinates information:
5552
x - front to back (positive is forward)
56-
y - left to right (positive is right)
53+
y - left to right (positive is right)
5754
z - up to down (positive is up)
5855
Before starting the task, make sure to grab the camera image to understand the environment.
5956
"""

src/rai_bench/rai_bench/o3de_test_bench/configs/scene1.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ entities:
2323
y: 0.0
2424
z: 0.0
2525
w: 1.0
26-

src/rai_bench/rai_bench/o3de_test_bench/configs/scene2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,4 @@ entities:
4848
x: 0.0
4949
y: 0.0
5050
z: 0.0
51-
w: 1.0
51+
w: 1.0

src/rai_bench/rai_bench/o3de_test_bench/configs/scene3.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ entities:
2222
x: 0.0
2323
y: 0.0
2424
z: 0.0
25-
w: 1.0
25+
w: 1.0

src/rai_bench/rai_bench/o3de_test_bench/configs/scene4.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ entities:
4747
x: 0.0
4848
y: 0.0
4949
z: 0.0
50-
w: 1.0
50+
w: 1.0

src/rai_bench/rai_bench/o3de_test_bench/tasks/grab_carrot_task.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
# limitations under the License.
1414

1515
from rai_bench.benchmark_model import (
16-
Task,
1716
EntitiesMismatchException,
17+
Task,
1818
)
19-
2019
from rai_sim.o3de.o3de_bridge import (
2120
SimulationBridge,
2221
)

src/rai_bench/rai_bench/o3de_test_bench/tasks/place_cubes_task.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
# limitations under the License.
1414

1515
from rai_bench.benchmark_model import (
16-
Task,
1716
EntitiesMismatchException,
17+
Task,
1818
)
19-
2019
from rai_sim.o3de.o3de_bridge import SimulationBridge, SimulationConfig
2120

2221

src/rai_core/rai/tools/ros/manipulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from typing import Literal, Type
16-
import time
16+
1717
import numpy as np
1818
from geometry_msgs.msg import Point, Pose, PoseStamped, Quaternion
1919
from langchain_core.tools import BaseTool

0 commit comments

Comments
 (0)