Skip to content

Commit 28b2a5b

Browse files
committed
add note, delete old code
1 parent 0301f4e commit 28b2a5b

File tree

1 file changed

+6
-22
lines changed
  • src/rai_bench/o3de_test_bench

1 file changed

+6
-22
lines changed

Diff for: src/rai_bench/o3de_test_bench/main.py

+6-22
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ def calculate_result(
8383
if ini_carrot.name == final_carrot.name:
8484
initial_y = ini_carrot.pose.translation.y
8585
final_y = final_carrot.pose.translation.y
86+
# NOTE the specific coords that refer to for example
87+
# middle of the table can differ across simulations,
88+
# take that into consideration
8689
if (
8790
initial_y <= 0.0
8891
): # Carrot started in the incorrect place (right side)
@@ -144,7 +147,9 @@ def calculate_result(
144147
else:
145148
ini_poses = [cube.pose for cube in initial_cubes]
146149
final_poses = [cube.pose for cube in final_cubes]
147-
150+
# NOTE the specific coords that refer to for example
151+
# middle of the table can differ across simulations,
152+
# take that into consideration
148153
for ini_cube in initial_cubes:
149154
for final_cube in final_cubes:
150155
if ini_cube.name == final_cube.name:
@@ -175,26 +180,6 @@ def calculate_result(
175180
return (corrected_objects + unchanged_correct) / num_of_objects
176181

177182

178-
def request_to_base_position() -> ManipulatorMoveTo.Request:
179-
request = ManipulatorMoveTo.Request()
180-
request.initial_gripper_state = True
181-
request.final_gripper_state = False
182-
183-
request.target_pose = PoseStamped()
184-
request.target_pose.header = Header()
185-
request.target_pose.header.frame_id = "panda_link0"
186-
187-
request.target_pose.pose.position.x = 0.3
188-
request.target_pose.pose.position.y = 0.0
189-
request.target_pose.pose.position.z = 0.5
190-
191-
request.target_pose.pose.orientation.x = 1.0
192-
request.target_pose.pose.orientation.y = 0.0
193-
request.target_pose.pose.orientation.z = 0.0
194-
request.target_pose.pose.orientation.w = 0.0
195-
return request
196-
197-
198183
if __name__ == "__main__":
199184
rclpy.init()
200185
connector = ROS2ARIConnector()
@@ -292,7 +277,6 @@ def request_to_base_position() -> ManipulatorMoveTo.Request:
292277

293278
# custom request to arm
294279
base_arm_pose = PoseModel(translation=Translation(x=0.3, y=0.0, z=0.4))
295-
request = request_to_base_position()
296280

297281
# define benchamrk
298282
benchmark = Benchmark(

0 commit comments

Comments
 (0)