Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ruk-shan opened this issue Jul 14, 2021 · 5 comments
Open

Comments

@ruk-shan
Copy link

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
Copy link
Contributor

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
Copy link

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

@rohit-kumar-j
Copy link
Contributor

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

rohit-kumar-j added a commit to rohit-kumar-j/fusion2urdf that referenced this issue Feb 27, 2022
Precautions about certain workflows while assembling and generating urdf added to the readme. Also referenced in Issue syuntoku14#51
@chasebrignac
Copy link

@rohit-kumar-j Thank you so much!

@sof-danny
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants