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

KeyError: 'suppressed' #100

Open
JHPHELAN opened this issue Apr 11, 2023 · 2 comments
Open

KeyError: 'suppressed' #100

JHPHELAN opened this issue Apr 11, 2023 · 2 comments

Comments

@JHPHELAN
Copy link

JHPHELAN commented Apr 11, 2023

Recently installed OnShape-to-robot plus accessories on a Dell laptop / Ubuntu 22.04 successfully.
my config.json points with appropriate access and secret keys to MY COPY the JPL Open Source Rover:
https://cad.onshape.com/documents/5c358484057fc4c01d5e5803/w/bdf583acdf29d75695be5fbc/e/e3eb7193ecdec5b0a710978b
ubuntu@LinuxBox:~$ onshape-to-robot OnShape-OSR

* Checking OpenSCAD presence...
* Checking MeshLab presence...

* Retrieving workspace ID ...
+ Using workspace id: ec57fc1702d5177d685a86c9

* Retrieving elements in the document, searching for the assembly...
+ Found assembly, id: ccf42f743a831a145aea7c8a, name: "Rover"

* Retrieving assembly "Rover" with id ccf42f743a831a145aea7c8a

* Getting assembly features, scanning for DOFs...
* Found total 0 DOFs

* Building robot tree
* Trunk is Mechanical Integration <1>
Traceback (most recent call last):
  File "/home/ubuntu/.local/bin/onshape-to-robot", line 8, in <module>
    sys.exit(onshape_to_robot.main())
  File "/home/ubuntu/.local/lib/python3.10/site-packages/onshape_to_robot/onshape_to_robot.py", line 17, in main
    from .load_robot import \
  File "/home/ubuntu/.local/lib/python3.10/site-packages/onshape_to_robot/load_robot.py", line 336, in <module>
    if not occurrence['instance']['suppressed']:
**KeyError: 'suppressed'`**

The 'KeyError: 'suppressed' error apparently refers to 'suppressed' not being in the 'defaultdict' referred to in 'load_robot.py'.
I can't find the actual dictionary despite considerable digging.
I'll see what happens if I 'comment out' that block of code....

When I do, it gets farther until it complains about a screw with no mass, then a missing resource:

WARNING: part Socket button head cap screw #6-32 x 0.75 <3> has no mass, maybe you should assign a material to it ?
+ Adding part Pad 2 <1>
https://cad.onshape.com/api/parts/d/4e80c35d6ce2977369966f00/m/7ac9aca0c476e9242713b6a1/e/13c617a504fd8cb4616fc014/partid/JjH/stl?mode=binary&units=meter&configuration=default
! ERROR (403) while using OnShape API
! {
  "message" : "Resource does not exist, or you do not have permission to access it.",
  "moreInfoUrl" : "",
  "status" : 403,
  "code" : 0
}
@Gregwar
Copy link
Contributor

Gregwar commented Apr 11, 2023

Hello,

Maybe we can consider something like:

if 'suppressed' not in occurrence['instance'] or not occurrence['instance']['suppressed']:

About the access problem, unfortunately there is little I can do about that, permissions in onshape are sometime hard to understand. Did you make a copy of the document you are importing to be sure you have all the permissions?

@JHPHELAN
Copy link
Author

JHPHELAN commented Apr 14, 2023

@Gregwar
It seems from what I gather it's not that we're not testing correctly for ['suppressed'],
but rather that 'suppressed' needs to be added to some dictionary.

I did make a cc of the document. I suspect it's more that the part isn't there than I'm lacking permission. I can find a reference to it, but it lacks detail. Seems to be a solder pad on an Arduino.

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

2 participants