Commit 5e038b51 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[python] Simplify buildGeomFromUrdf and allow to build from string.

parent 364f5734
Pipeline #16584 passed with stage
in 27 minutes and 43 seconds
This diff is collapsed.
...@@ -104,7 +104,7 @@ def se3ToXYZQUAT(M): ...@@ -104,7 +104,7 @@ def se3ToXYZQUAT(M):
def XYZQUATToSe3(x): def XYZQUATToSe3(x):
return pin.XYZQUATToSE3(x) return pin.XYZQUATToSE3(x)
def buildGeomFromUrdf(model, filename, *args): def buildGeomFromUrdf(model, filename, *args, **kwargs):
arg3 = args[0] arg3 = args[0]
if isinstance(arg3,(str,list,pin.StdVec_StdString)): if isinstance(arg3,(str,list,pin.StdVec_StdString)):
...@@ -116,14 +116,14 @@ def buildGeomFromUrdf(model, filename, *args): ...@@ -116,14 +116,14 @@ def buildGeomFromUrdf(model, filename, *args):
message = ("This function signature is now deprecated and will be removed in future releases of Pinocchio. " message = ("This function signature is now deprecated and will be removed in future releases of Pinocchio. "
"Please change for the new signature buildGeomFromUrdf(model,filename,type,package_dirs,mesh_loader).") "Please change for the new signature buildGeomFromUrdf(model,filename,type,package_dirs,mesh_loader).")
_warnings.warn(message, category=DeprecatedWarning, stacklevel=2) _warnings.warn(message, category=DeprecatedWarning, stacklevel=2)
return pin.buildGeomFromUrdf(model,filename,geom_type,package_dir,mesh_loader) return pin.buildGeomFromUrdf(model,filename,geom_type,package_dir,mesh_loader, **kwargs)
else: else:
message = ("This function signature is now deprecated and will be removed in future releases of Pinocchio. " message = ("This function signature is now deprecated and will be removed in future releases of Pinocchio. "
"Please change for the new signature buildGeomFromUrdf(model,filename,type,package_dirs).") "Please change for the new signature buildGeomFromUrdf(model,filename,type,package_dirs).")
_warnings.warn(message, category=DeprecatedWarning, stacklevel=2) _warnings.warn(message, category=DeprecatedWarning, stacklevel=2)
return pin.buildGeomFromUrdf(model,filename,geom_type,package_dir) return pin.buildGeomFromUrdf(model,filename,geom_type,package_dir, **kwargs)
else: else:
return pin.buildGeomFromUrdf(model, filename, *args) return pin.buildGeomFromUrdf(model, filename, *args, **kwargs)
buildGeomFromUrdf.__doc__ = ( buildGeomFromUrdf.__doc__ = (
pin.buildGeomFromUrdf.__doc__ pin.buildGeomFromUrdf.__doc__
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment