syuntoku14 / fusion2urdf

A Fusion 360 Script to export URDF
MIT License
474 stars 160 forks source link

if joint.occurrenceTwo.component.name == 'base_link': AttributeError #51

Open ruk-shan opened 3 years ago

ruk-shan commented 3 years ago

Error- Failed: Traceback (most recent call last): File "C:/Users/rukshan/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Scripts/URDF_Exporter/URDF_Exporter.py", line 59, in run joints_dict, msg = Joint.make_joints_dict(root, msg) File "C:/Users/rukshan/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Scripts/URDF_Exporter\core\Joint.py", line 172, in make_joints_dict if joint.occurrenceTwo.component.name == 'base_link': AttributeError: 'NoneType' object has no attribute 'component' image

rohit-kumar-j commented 3 years ago

Your component name is "base_link (2)", while the body name is "base_link". Change the component name to "base_link" and the body name can be whatever you want

Close the issue if this solves the problem.

chasebrignac commented 2 years ago

What if there is a version number always appended to the body name?

rohit-kumar-j commented 2 years ago

What if there is a version number always appended to the body name?

@chasebrignac, good question. I had a doubt and checked it out.

When you copy-paste the component directly (ctrl +c, ctrl+v), it produces the name "link:1" and "link:2". @ruk-shan did a 'Paste New' instead of 'Paste',(presumably because he wanted to edit the "base_link" as a separate copy) fusion produces a copy with the same name but with a "base_link(2)" instance.

Note that you cannot remove the "(2)" from the name. And if you do copy-paste directly(ctrl +c, ctrl+v), the part and the copy are linked. Any changes to the initial part, affects the latter, but not the "(2)" component.

As you can see below, when I edit component:1, component:2 also shows the same changes, but not component(2):1

Due to these subtleties, I suggest you plan the way you import and work with the parts as explained in the README. I will create a PR in the README for this.

image

image

-Rohit

chasebrignac commented 2 years ago

@rohit-kumar-j Thank you so much!

sof-danny commented 1 year ago

Suppose anyone is still having this error. I found that the problem was that the joints were not well created. To check if your joints are well-designed, follow the steps below:

  1. Click on joints in your workspace
  2. Right-click on the individual joints
  3. Click on select components. It should highlight the two components that make up the joint. If only one component is highlighted, you need to edit the joints or delete and make a new one. It could be that you selected the wrong components, or you didn't select the base_link first
  4. Do this for all the joints
  5. Save this version and rerun the fusion2urdf script. It should work now
owenchen0408 commented 2 months ago

@rohit-kumar-j I am encountering the same isue, image I have everything defined and all component have only one body. I also have base link but it still doesn't work. Please help:) thanks!