You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# log.error("Both urdf_path and tree parameters cannot be None.")
196
194
raiseTreeException("Both urdf_path and tree parameters cannot be None.")
197
195
196
+
iftree_idisnotNone:
197
+
tree_id=str(tree_id).zfill(5)
198
+
198
199
ifurdf_pathisNone:
199
-
id_str=f"{namespace}_{tree_type}_tree{tree_id}"
200
+
id_str=f"{namespace}_{tree_type}_{tree_id}"
200
201
else:
201
202
id_str=Path(urdf_path).stem
202
-
id_str_components=id_str.split('_')
203
+
id_str_components=id_str.split("_")
203
204
self.tree_namespace=id_str_components[0]
204
205
self.tree_type=id_str_components[1]
205
-
self.tree_id=id_str_components[2]
206
+
self.tree_id=str(id_str_components[2]).zfill(5)
206
207
returnid_str
207
208
208
209
def_load_points_from_pickle(self, pkl_path):
@@ -448,10 +449,8 @@ def load_tree_urdf(
448
449
orientation: str="0.0 0.0 0.0",
449
450
save_urdf: bool=True,
450
451
regenerate_urdf: bool=False, # TODO: make save/regenerate work well together. Will need to add delete URDF function
451
-
) ->None:
452
-
"""Load a tree URDF from a given path or generate a tree URDF from a xacro file. Returns the URDF content.
453
-
If `tree_urdf_path` is not None, then load that URDF.
454
-
Otherwise, process an xacro file with given input parameters.
452
+
) ->str:
453
+
"""Load a tree URDF from a given path or generate a tree URDF from a xacro file. If content is generated, by default saves the content to /urdf/trees/<tree_type>/generated Returns the URDF content.
0 commit comments