diff --git a/src/adam/casadi/computations.py b/src/adam/casadi/computations.py index ca7a9e8d..58ff04a1 100644 --- a/src/adam/casadi/computations.py +++ b/src/adam/casadi/computations.py @@ -32,7 +32,7 @@ def __init__( root_link (str, optional): the first link. Defaults to 'root_link'. """ math = SpatialMath() - factory = URDFModelFactory(urdf_string=urdfstring, math=math) + factory = URDFModelFactory(path=urdfstring, math=math) model = Model.build(factory=factory, joints_name_list=joints_name_list) self.rbdalgos = RBDAlgorithms(model=model, math=math) self.NDoF = self.rbdalgos.NDoF diff --git a/src/adam/jax/computations.py b/src/adam/jax/computations.py index e49aa8cb..dd374e43 100644 --- a/src/adam/jax/computations.py +++ b/src/adam/jax/computations.py @@ -30,7 +30,7 @@ def __init__( root_link (str, optional): the first link. Defaults to 'root_link'. """ math = SpatialMath() - factory = URDFModelFactory(urdf_string=urdfstring, math=math) + factory = URDFModelFactory(path=urdfstring, math=math) model = Model.build(factory=factory, joints_name_list=joints_name_list) self.rbdalgos = RBDAlgorithms(model=model, math=math) self.NDoF = self.rbdalgos.NDoF diff --git a/src/adam/model/std_factories/std_model.py b/src/adam/model/std_factories/std_model.py index 11f81e55..b849b450 100644 --- a/src/adam/model/std_factories/std_model.py +++ b/src/adam/model/std_factories/std_model.py @@ -29,8 +29,8 @@ class URDFModelFactory(ModelFactory): Args: ModelFactory: the Model factory """ - - def __init__(self, urdf_string: str, math: SpatialMath): + #TODO: path can be either a path and an urdf-string, leaving path for back compatibility, to be changed to meaningfull name + def __init__(self, path: str, math: SpatialMath): self.math = math isPath = False isUrdf = False @@ -46,7 +46,6 @@ def __init__(self, urdf_string: str, math: SpatialMath): if elem.tag == "robot": xml_string = urdf_string isUrdf = True - # raise ValueError(f"Invalid urdf string: {urdf_string}. It is neither a path nor a urdf string") elif urdf_string.exists(): isPath = True diff --git a/src/adam/numpy/computations.py b/src/adam/numpy/computations.py index 9893bb60..ad531f08 100644 --- a/src/adam/numpy/computations.py +++ b/src/adam/numpy/computations.py @@ -29,7 +29,7 @@ def __init__( root_link (str, optional): the first link. Defaults to 'root_link'. """ math = SpatialMath() - factory = URDFModelFactory(urdf_string=urdfstring, math=math) + factory = URDFModelFactory(path=urdfstring, math=math) model = Model.build(factory=factory, joints_name_list=joints_name_list) self.rbdalgos = RBDAlgorithms(model=model, math=math) self.NDoF = model.NDoF