Skip to content

Commit 4c31d5d

Browse files
authored
fix: manipulaiton bench fixes (#653)
1 parent c26026a commit 4c31d5d

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

src/rai_bench/rai_bench/manipulation_o3de/benchmark.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,7 @@ def run_next(self, agent: CompiledStateGraph, experiment_id: uuid.UUID) -> None:
308308
self.logger.error(msg=f"Task timeout: {e}")
309309
except GraphRecursionError as e:
310310
self.logger.error(msg=f"Reached recursion limit {e}")
311-
except Exception as e:
312-
self.logger.error(msg=f"Unexpected errot occured: {e}")
311+
313312
te = time.perf_counter()
314313
try:
315314
score = scenario.task.calculate_score(self.simulation_bridge)

src/rai_bench/rai_bench/test_models.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,12 @@ def test_models(
250250
bench_logger=bench_logger,
251251
)
252252
except Exception as e:
253-
bench_logger.critical(f"BENCHMARK RUN FAILED: {e}")
253+
import traceback
254+
254255
bench_logger.critical(
255-
f"{bench_conf.name} benchmark for {model_name}, vendor: {vendors[i]}, execution number: {u + 1}"
256+
f"{bench_conf.name} benchmark for {model_name}, vendor: {vendors[i]}, repeat number: {u + 1}"
256257
)
258+
bench_logger.critical(f"BENCHMARK RUN FAILED: {e}")
259+
error_msg = traceback.format_exc()
260+
bench_logger.critical(error_msg)
261+
print(error_msg)

src/rai_bench/rai_bench/tool_calling_agent/benchmark.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,7 @@ def run_next(self, agent: CompiledStateGraph, experiment_id: uuid.UUID) -> None:
148148
self.logger.error(msg=f"Task timeout: {e}")
149149
except GraphRecursionError as e:
150150
self.logger.error(msg=f"Reached recursion limit {e}")
151-
except Exception as e:
152-
self.logger.error(msg=f"Unexpected error occured: {e}")
151+
153152
tool_calls = task.get_tool_calls_from_messages(messages=messages)
154153
score = task.validate(tool_calls=tool_calls)
155154
te = time.perf_counter()

src/rai_core/rai/tools/ros2/manipulation/custom.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,12 @@ def _run(
245245
response = get_future_result(future, timeout_sec=20.0)
246246

247247
if response is None:
248-
return f"Service call failed for point ({x:.2f}, {y:.2f}, {z:.2f})."
248+
return f"Service call failed for point ({x1:.2f}, {y1:.2f}, {z1:.2f})."
249249

250250
if response.success:
251-
return f"End effector successfully positioned at coordinates ({x:.2f}, {y:.2f}, {z:.2f}). Note: The status of object interaction (grab/drop) is not confirmed by this movement."
251+
return f"End effector successfully positioned at coordinates ({x1:.2f}, {y1:.2f}, {z1:.2f}). Note: The status of object interaction (grab/drop) is not confirmed by this movement."
252252
else:
253-
return f"Failed to position end effector at coordinates ({x:.2f}, {y:.2f}, {z:.2f})."
253+
return f"Failed to position end effector at coordinates ({x1:.2f}, {y1:.2f}, {z1:.2f})."
254254

255255

256256
class GetObjectPositionsToolInput(BaseModel):

0 commit comments

Comments
 (0)