GithubHelp home page GithubHelp logo

Comments (20)

Gregwar avatar Gregwar commented on June 7, 2024 1

Hello,

The problem was that onshape internal partids can contain slash (here JF/ )
I fixed the code to escape those strange slashes, if you update to 0.3.6 it should work

from onshape-to-robot.

Gregwar avatar Gregwar commented on June 7, 2024

Hello,

I believe this issue happens because your assembly is referencing parts and you don't have edition access to it

In this case, the following URL is invoked:
https://cad.onshape.com/api/parts/d/c7f4343ab134d605156724b1/m/333ac268f2d757288de7bccb/e/b47021706b0771d8cc85e3a7/partid/JF//metadata?configuration=default

Which triggers an access denied.

I am not sure why there are privileges required since this should be a read-only API request, I will open an issue in OnShape tickets system itself to investigate. In the meantime, a solution for you would be to make a copy of this document and use it instead.

from onshape-to-robot.

Gregwar avatar Gregwar commented on June 7, 2024

I opened issue on OnShape bug tracking system and I will give updates here

It is weird that this works:
https://cad.onshape.com/api/parts/d/c7f4343ab134d605156724b1/m/333ac268f2d757288de7bccb/e/b47021706b0771d8cc85e3a7/

And this doesn't:
https://cad.onshape.com/api/parts/d/c7f4343ab134d605156724b1/m/333ac268f2d757288de7bccb/e/b47021706b0771d8cc85e3a7/partid/JF//metadata?configuration=default

Since they are both GET requests doing only read operations

from onshape-to-robot.

neoalejo avatar neoalejo commented on June 7, 2024

Thank you very much! the fix solved the problem! :D

from onshape-to-robot.

agillies8 avatar agillies8 commented on June 7, 2024

I am now seeing a similar issue with v 0.3.13:

https://cad.onshape.com/api/parts/d/......../partid/JF%2f/massproperties?configuration=default ! ERROR (404) while using OnShape API ! { "moreInfoUrl" : "", "message" : "Not found.", "status" : 404, "code" : 0 }
When I check the partid directly via the api, it appears as "JF/"

Could this bug be lingering somewhere still?

from onshape-to-robot.

Gregwar avatar Gregwar commented on June 7, 2024

Hello,
Maybe, that would be simplier if I had an example that I could reproduce myself, is it a project you can share with me?

from onshape-to-robot.

noelhwang avatar noelhwang commented on June 7, 2024

Unfortunately, I can't share my project, but I wanted to mention I also had a 404 error show up - when clicking through the URL generated by the error message, the partid portion of the url was malformed via the text implemented in this hotfix. i.e. "/" replaced by "%252f". To test, I manually replacing the malformed text in the partid with "/", and the link went through just fine. My workaround for the time being was to run from source on the commit just prior to the change.

from onshape-to-robot.

MrKeith99 avatar MrKeith99 commented on June 7, 2024

ive experienced the same problem

from onshape-to-robot.

MrKeith99 avatar MrKeith99 commented on June 7, 2024

Unfortunately, I can't share my project, but I wanted to mention I also had a 404 error show up - when clicking through the URL generated by the error message, the partid portion of the url was malformed via the text implemented in this hotfix. i.e. "/" replaced by "%252f". To test, I manually replacing the malformed text in the partid with "/", and the link went through just fine. My workaround for the time being was to run from source on the commit just prior to the change.

As @noelhwang informed, / is being exchanged to %252f.
You can try to reproduce the problem with my project. Here is the link to the project.

from onshape-to-robot.

Gregwar avatar Gregwar commented on June 7, 2024

Hello, indeed slash might be wrongly escaped
I am not sure why we currently double-escape them when getting parts metadata

from onshape-to-robot.

Gregwar avatar Gregwar commented on June 7, 2024

@MrKeith99 I can see your design but I can't import it because I am not allowed to copy it for instance
Maybe you can isolate the part that causes the problem and share that one specifically ?

I will try to create a document with a lot of parts to see if I can get one generated with a slash to add it to the tests/examples

from onshape-to-robot.

Gregwar avatar Gregwar commented on June 7, 2024

I could reproduce by adding 64 parts to a document and running the import to have a lot of partids
Looks like escaping the / only once in the metadata request does the trick.

I re-packaged 0.3.17, can you upgrade and tell me if it works now?

from onshape-to-robot.

MrKeith99 avatar MrKeith99 commented on June 7, 2024
pybullet build time: May 20 2022 19:44:17
* Checking OpenSCAD presence...
* Checking MeshLab presence...

* Retrieving workspace ID ...
+ Using workspace id: 88fc4f32ca2426ef06393394

* Retrieving elements in the document, searching for the assembly...
+ Found assembly, id: 294230932b42f016a12a1535, name: "SOBIT_PRO(MK-4)"
+ Found assembly, id: c6735a901ea2e1529c215af9, name: "arm_elbow_lower_pan"
+ Found assembly, id: 61c5dbf2e78867df6664c5de, name: "arm_elbow_lower_tilt"
+ Found assembly, id: 3a0f7d17aa2f274df5985e96, name: "platform_bottom"
+ Found assembly, id: bdb70e69e307e5054af63303, name: "platform_middle"
+ Found assembly, id: 3e15eb4f7e265186450c15c6, name: "platform_top"
+ Found assembly, id: c1ee2b20f8570e74b87b79f5, name: "urg"
+ Found assembly, id: a29412368500b01c0df2c4b3, name: "pole"
+ Found assembly, id: dbe54c2c550b203528d8f05e, name: "mic"
+ Found assembly, id: baecf1fcd422834977eda067, name: "emergency button"
+ Found assembly, id: 8809880f55ab8e040f597c43, name: "platform"
+ Found assembly, id: 8fa164ab5d61172304b415f1, name: "head_camera"
+ Found assembly, id: 431229acf4c8f72bf9609f27, name: "arm"
+ Found assembly, id: 1d05f411dc80d6cac0d8e13b, name: "wheel"

* Retrieving assembly "wheel" with id 1d05f411dc80d6cac0d8e13b

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

* Building robot tree
* Trunk is SOBIT_wheel v1 <1>
* Adding top-level instance [SOBIT_wheel v1 <1>]
+ Adding part X-430_IDLE <1>
WARNING: part X-430_IDLE <1> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <7>
WARNING: part X-430_SPACER_RING <7> has no mass, maybe you should assign a material to it ?
+ Adding part SOBIT_wheel v1 <8>
WARNING: part SOBIT_wheel v1 <8> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_CVR_CABLE <1>
WARNING: part X-430_CVR_CABLE <1> has no mass, maybe you should assign a material to it ?
+ Adding part SOBIT_wheel v1 <1>
WARNING: part SOBIT_wheel v1 <1> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <6>
WARNING: part X-430_SPACER_RING <6> has no mass, maybe you should assign a material to it ?
+ Adding part SOBIT_wheel v1 <3>
WARNING: part SOBIT_wheel v1 <3> has no mass, maybe you should assign a material to it ?
+ Adding part SOBIT_wheel v1 <4>
WARNING: part SOBIT_wheel v1 <4> has no mass, maybe you should assign a material to it ?
+ Adding part SOBIT_wheel v1 <5>
WARNING: part SOBIT_wheel v1 <5> has no mass, maybe you should assign a material to it ?
+ Adding part SOBIT_wheel v1 <9>
WARNING: part SOBIT_wheel v1 <9> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <4>
WARNING: part X-430_SPACER_RING <4> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <4>
WARNING: part X-430_SPACER_RING <4> has no mass, maybe you should assign a material to it ?
+ Adding part SOBIT_wheel v1 <7>
WARNING: part SOBIT_wheel v1 <7> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <5>
WARNING: part X-430_SPACER_RING <5> has no mass, maybe you should assign a material to it ?
+ Adding part SOBIT_wheel v1 <6>
WARNING: part SOBIT_wheel v1 <6> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <3>
WARNING: part X-430_SPACER_RING <3> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <3>
WARNING: part X-430_SPACER_RING <3> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <7>
WARNING: part X-430_SPACER_RING <7> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_IDLE <1>
WARNING: part X-430_IDLE <1> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <5>
WARNING: part X-430_SPACER_RING <5> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <6>
WARNING: part X-430_SPACER_RING <6> has no mass, maybe you should assign a material to it ?
+ Adding part SOBIT_wheel v1 <2>
WARNING: part SOBIT_wheel v1 <2> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <2>
WARNING: part X-430_SPACER_RING <2> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <2>
WARNING: part X-430_SPACER_RING <2> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <8>
WARNING: part X-430_SPACER_RING <8> has no mass, maybe you should assign a material to it ?
+ Adding part fr12_h101 v1 <1>
WARNING: part fr12_h101 v1 <1> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <8>
WARNING: part X-430_SPACER_RING <8> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <1>
WARNING: part X-430_SPACER_RING <1> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_CVR_CABLE <1>
WARNING: part X-430_CVR_CABLE <1> has no mass, maybe you should assign a material to it ?
+ Adding part X-430_SPACER_RING <1>
WARNING: part X-430_SPACER_RING <1> has no mass, maybe you should assign a material to it ?

* Writing URDF file

I have been able to pass the path problem but unfortunately it seems to stop in the "wheel" assembly, so the other parts are not retrieved

from onshape-to-robot.

MrKeith99 avatar MrKeith99 commented on June 7, 2024

btw, this is the correct link to the project

from onshape-to-robot.

Gregwar avatar Gregwar commented on June 7, 2024

You can specify which assembly you want to export using assemblyName in the config.json file, see:
https://onshape-to-robot.readthedocs.io/en/latest/config.html#assemblyname

from onshape-to-robot.

RyotaYoneyama avatar RyotaYoneyama commented on June 7, 2024

Hello, I also encountered with same problem saying
! ERROR (404) while using OnShape API ! { "message" : "Not found.", "moreInfoUrl" : "", "status" : 404, "code" : 0 }

My cad link is :
link

And the version of onshape-to-robot 0.3.17.

I had not have a problem last week but now I got it.

from onshape-to-robot.

Gregwar avatar Gregwar commented on June 7, 2024

Looks like API for metadata changed.
I switched to using /metadata/... instead, and released 0.3.18@RyotaYoneyama can you give it a try?

from onshape-to-robot.

Gregwar avatar Gregwar commented on June 7, 2024

image

Works for me

from onshape-to-robot.

RyotaYoneyama avatar RyotaYoneyama commented on June 7, 2024

Hi, thank you for your response @Gregwar .
It worked almost perfectly!
However, I got an error while using mergeSTLs and simplifySTLs simultaneously, which might be not important.
The error message was

+ joint_0_visual.stl is 6.56 M, running mesh simplification
Traceback (most recent call last):
  File "/home/ryota/.local/bin/onshape-to-robot", line 8, in <module>
    sys.exit(onshape_to_robot.main())
  File "/home/ryota/.local/lib/python3.10/site-packages/onshape_to_robot/onshape_to_robot.py", line 242, in main
    buildRobot(tree, np.matrix(np.identity(4)))
  File "/home/ryota/.local/lib/python3.10/site-packages/onshape_to_robot/onshape_to_robot.py", line 207, in buildRobot
    robot.endLink()
  File "/home/ryota/.local/lib/python3.10/site-packages/onshape_to_robot/robot_description.py", line 221, in endLink
    stl_combine.simplify_stl(self.meshDir+'/'+filename, self.maxSTLSize)
  File "/home/ryota/.local/lib/python3.10/site-packages/onshape_to_robot/stl_combine.py", line 93, in simplify_stl
    reduce_faces('/tmp/simplify.stl', stl_file, max_size / size_M)
  File "/home/ryota/.local/lib/python3.10/site-packages/onshape_to_robot/stl_combine.py", line 80, in reduce_faces
    output = subprocess.check_output(command, shell=True)
  File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.10/subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'meshlabserver -i /tmp/simplify.stl -s /tmp/filter_file_tmp.mlx -o wormy_arm_description/urdf/raw/joint_0_visual.stl -om vn fn > /tmp/meshlab.log 2>&1' returned non-zero exit status 255.
onshape-to-robot wormy_arm_description/urdf/raw  7.55s user 5.75s system 302% cpu 4.401 total

from onshape-to-robot.

pib-rocks avatar pib-rocks commented on June 7, 2024

Hello all,

we experienced a similar problem, our URL ist the following:

https://cad.onshape.com/api/metadata/d/775cd57fa655e34e0a8b6d93/m/696481022d812e591e7847a7/e/696fbec0e94bcefd06890692/p/R+FD?configuration=Print_helpers%3Dfalse

Here, the partID is "R+FD", which make it neccessary to escape the "+" in our URL. What I did to solve this: we extended the escape_slash(s) in client.py by changing return s.replace('/', '%2f') to return s.replace('/', '%2f').replace('+', '%2b')

What more characters can appear? Maybe its better to make this more generic? Hope this helps...

from onshape-to-robot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.