aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/argaze/ArUcoMarkers/ArUcoScene.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/argaze/ArUcoMarkers/ArUcoScene.py b/src/argaze/ArUcoMarkers/ArUcoScene.py
index e128e0f..3bbd3f4 100644
--- a/src/argaze/ArUcoMarkers/ArUcoScene.py
+++ b/src/argaze/ArUcoMarkers/ArUcoScene.py
@@ -65,11 +65,21 @@ class ArUcoScene(ArFeatures.ArScene):
# Check aruco_markers_group value type
aruco_markers_group_value = aruco_scene_data.pop('aruco_markers_group')
- # str: relative path to .obj file
+ # str: relative path to description file
if type(aruco_markers_group_value) == str:
- aruco_markers_group_value = os.path.join(working_directory, aruco_markers_group_value)
- new_aruco_markers_group = ArUcoMarkersGroup.ArUcoMarkersGroup.from_obj(aruco_markers_group_value)
+ filepath = os.path.join(working_directory, aruco_markers_group_value)
+ file_format = filepath.split('.')[-1]
+
+ # JSON file format
+ if file_format == 'json':
+
+ new_aruco_markers_group = ArUcoMarkersGroup.ArUcoMarkersGroup.from_json(filepath)
+
+ # OBJ file format
+ elif file_format == 'obj':
+
+ new_aruco_markers_group = ArUcoMarkersGroup.ArUcoMarkersGroup.from_obj(filepath)
# dict:
else: