Skip to content

Commit 6c9861c

Browse files
committed
Add integration test for lab_sim
Signed-off-by: Paul Gesel <[email protected]>
1 parent 1ca20ce commit 6c9861c

File tree

3 files changed

+60
-0
lines changed

3 files changed

+60
-0
lines changed

src/lab_sim/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,13 @@ install(
4141
)
4242

4343
if(BUILD_TESTING)
44+
find_package(ament_cmake_pytest REQUIRED)
4445
find_package(ament_lint_auto REQUIRED)
4546
ament_lint_auto_find_test_dependencies()
47+
ament_add_pytest_test(
48+
test_objective_server_node_integration test/test_core_objectives.py
49+
TIMEOUT 600
50+
ENV STUDIO_CONFIG_PACKAGE=lab_sim STUDIO_HOST_USER_WORKSPACE=${CMAKE_SOURCE_DIR})
4651
endif()
4752

4853
ament_package()
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
DetectAprilTags:
2+
apriltag_family_name: 36h11
3+
apriltag_size: 0.04
4+
max_hamming: 0
5+
n_threads: 1
6+
quad_decimate: 2
7+
quad_sigma: 0.0
8+
refine_edges: true
9+
z_up: false
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import time
2+
3+
import pytest
4+
from moveit_pro_test_utils.objective_test_fixture import (
5+
ExecuteObjectiveResource,
6+
execute_objective_resource as execute_objective_resource,
7+
get_objective_pytest_params,
8+
run_objective,
9+
)
10+
11+
cancel_objectives = {
12+
"3 Waypoints Pick and Place",
13+
"Cycle Between Waypoints",
14+
"Grasp Object from Text Prompt",
15+
"Grasp Planning",
16+
"Grasp Pose Tuning With April Tag",
17+
"Grasp Pose Using Yaml",
18+
"Joint Diagnostic",
19+
"Loop Detect AprilTag",
20+
"Pick And Place Example",
21+
"Pick April Tag Labeled Object With Approval",
22+
"Place Object",
23+
"Plan and Save Trajectory",
24+
"Record and Replay Scanning Motion",
25+
}
26+
skip_objectives = {
27+
"Grasp Planning",
28+
"Joint Diagnostic",
29+
"ML Segment Image from Text Prompt",
30+
"ML Segment Point Cloud from Clicked Point",
31+
"Pick up Cube",
32+
"Place Object",
33+
"Teleoperate",
34+
}
35+
36+
37+
@pytest.mark.parametrize(
38+
"objective_id, should_cancel",
39+
get_objective_pytest_params("lab_sim", cancel_objectives, skip_objectives),
40+
)
41+
def test_all_objectives(
42+
objective_id: str,
43+
should_cancel: bool,
44+
execute_objective_resource: ExecuteObjectiveResource,
45+
):
46+
run_objective(objective_id, should_cancel, execute_objective_resource)

0 commit comments

Comments
 (0)