Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions src/adam/model/std_factories/std_model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import os
import pathlib
from typing import List
import xml.etree.ElementTree as ET
import os
from typing import List

import urdf_parser_py.urdf

from adam.core.spatial_math import SpatialMath
Expand Down Expand Up @@ -36,9 +37,12 @@ def get_xml_string(path: str | pathlib.Path):

# Checking if it is a path or an urdf
if not isPath:
if len(path) <= MAX_PATH and os.path.exists(path):
path = pathlib.Path(path)
isPath = True
if len(path) <= MAX_PATH:
if os.path.exists(path):
path = pathlib.Path(path)
isPath = True
else:
raise FileExistsError(path)
else:
root = ET.fromstring(path)

Expand Down