galou / freecad.cross

CROSS CAD and ROS, an Open-Source Synergy; ROS workbench for FreeCAD
GNU Lesser General Public License v2.1
85 stars 22 forks source link

Error when trying to export to urdf #3

Closed KianBahrami closed 9 months ago

KianBahrami commented 9 months ago

Hi, when trying to export a .step file from FreeCAD 0.21.1 to urdf using this framework I get the following error:

12:35:50  Running the Python command 'UrdfExport' failed:
Traceback (most recent call last):
  File "/home/hiwi/.local/share/FreeCAD/Mod/freecad.cross/freecad/cross/ui/command_urdf_export.py", line 142, in Activated
    txt += et.tostring(xml).decode('utf-8')
  File "/tmp/.mount_FreeCAOelecY/usr/lib/python3.10/xml/etree/ElementTree.py", line 1102, in tostring
    ElementTree(element).write(stream, encoding,
  File "/tmp/.mount_FreeCAOelecY/usr/lib/python3.10/xml/etree/ElementTree.py", line 741, in write
    qnames, namespaces = _namespaces(self._root, default_namespace)
  File "/tmp/.mount_FreeCAOelecY/usr/lib/python3.10/xml/etree/ElementTree.py", line 842, in _namespaces
    for elem in elem.iter():

'XmlForExport' object has no attribute 'iter'

I have exactly followed the installation guide. Any ideas on how to solve this issue? Thanks in advance!

galou commented 9 months ago

Should be fixed with 0b4b64f.

Note that it's better to create a CROSS::Link and setting the Visual or Collision properties, so that the mesh files are generated by CROSS.