Skip to content

Commit

Permalink
Chang eback to path name for back compatibilty, port modifications to…
Browse files Browse the repository at this point in the history
… parmatetrci
  • Loading branch information
CarlottaSartore committed Jun 10, 2024
1 parent ccf061e commit c2a8fc2
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/adam/casadi/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/adam/jax/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/adam/model/std_factories/std_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/adam/numpy/computations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c2a8fc2

Please sign in to comment.