aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2023-04-05 14:18:21 +0200
committerThéo de la Hogue2023-04-05 14:18:21 +0200
commit6fbe2de7f5839ef875da3211a55f3a8007dcbd45 (patch)
tree5573e88c6b1dd510674638bbbe2a7696cb76eb4e /src
parent84a89d804180a816060fbd5b85bdb2342c6a1063 (diff)
downloadargaze-6fbe2de7f5839ef875da3211a55f3a8007dcbd45.zip
argaze-6fbe2de7f5839ef875da3211a55f3a8007dcbd45.tar.gz
argaze-6fbe2de7f5839ef875da3211a55f3a8007dcbd45.tar.bz2
argaze-6fbe2de7f5839ef875da3211a55f3a8007dcbd45.tar.xz
Fixing and testing multi ar scenes loading.
Diffstat (limited to 'src')
-rw-r--r--src/argaze.test/ArFeatures.py6
-rw-r--r--src/argaze.test/utils/environment.json17
-rw-r--r--src/argaze/ArFeatures.py6
3 files changed, 23 insertions, 6 deletions
diff --git a/src/argaze.test/ArFeatures.py b/src/argaze.test/ArFeatures.py
index af8cfa8..054416a 100644
--- a/src/argaze.test/ArFeatures.py
+++ b/src/argaze.test/ArFeatures.py
@@ -37,11 +37,11 @@ class TestArEnvironmentClass(unittest.TestCase):
self.assertIsNone(numpy.testing.assert_array_equal(ar_environment.aruco_detector.camera.D, [-1.0, -0.5, 0.0, 0.5, 1.0]))
# Check environment scenes
- self.assertEqual(len(ar_environment.scenes), 1)
- self.assertIsNone(numpy.testing.assert_array_equal(list(ar_environment.scenes.keys()), ["TestScene"]))
+ self.assertEqual(len(ar_environment.scenes), 2)
+ self.assertIsNone(numpy.testing.assert_array_equal(list(ar_environment.scenes.keys()), ["TestSceneA", "TestSceneB"]))
# Load test scene
- ar_scene = ar_environment.scenes["TestScene"]
+ ar_scene = ar_environment.scenes["TestSceneA"]
# Check Aruco scene
self.assertEqual(len(ar_scene.aruco_scene.places), 2)
diff --git a/src/argaze.test/utils/environment.json b/src/argaze.test/utils/environment.json
index e4cf43a..9476a0d 100644
--- a/src/argaze.test/utils/environment.json
+++ b/src/argaze.test/utils/environment.json
@@ -40,7 +40,22 @@
"aprilTagDeglitch": 1
}
},
- "TestScene" : {
+ "TestSceneA" : {
+ "aruco_scene": {
+ "0": {
+ "translation": [1, 0, 0],
+ "rotation": [0, 0, 0]
+ },
+ "1": {
+ "translation": [0, 1, 0],
+ "rotation": [0, 90, 0]
+ }
+ },
+ "aoi_scene": "aoi.obj",
+ "angle_tolerance": 1.0,
+ "distance_tolerance": 2.0
+ },
+ "TestSceneB" : {
"aruco_scene": {
"0": {
"translation": [1, 0, 0],
diff --git a/src/argaze/ArFeatures.py b/src/argaze/ArFeatures.py
index 6247482..2d5b62d 100644
--- a/src/argaze/ArFeatures.py
+++ b/src/argaze/ArFeatures.py
@@ -39,6 +39,8 @@ class ArEnvironment():
# Setup scenes environment after environment creation
for name, scene in self.scenes.items():
+
+ print(name)
scene.environment = self
@@ -74,12 +76,12 @@ class ArEnvironment():
new_aruco_detecor_parameters = ArUcoDetector.DetectorParameters(**new_detector_data.pop('parameters'))
new_aruco_detector = ArUcoDetector.ArUcoDetector(new_aruco_dictionary, new_marker_size, new_aruco_camera, new_aruco_detecor_parameters)
+ new_scenes = {}
for scene_name, scene_data in data.items():
new_aruco_scene = None
new_aoi_scene = None
- new_scenes = {}
-
+
# Check aruco_scene value type
aruco_scene_value = scene_data.pop('aruco_scene')