Rhoban / onshape-to-robot

Converting OnShape assembly to robot definition (SDF or URDF) through OnShape API
MIT License
231 stars 49 forks source link

Suppressed parts in Onshape version are not ignored by onshape-to-robot command #88

Open maxwellkm opened 1 year ago

maxwellkm commented 1 year ago

TL;DR: Expected behavior is that suppressed parts in Onshape should not be encountered by onshape-to-robot

Vendors will often only provide surface models for components, rather than a solid model, in an effort to protect IP. We have no option but to use these models in our CAD for certain components. It seems onshape-to-robot has difficulty and will fail to execute when it encounters such models, which may have varying degrees of "validity" (e.g., non-watertight, discontinuous, etc)

As a user, I'd expect that simply suppressing these problem surface models in the assembly prior to creating a version for URDF export should be enough to keep them away from onshape-to-robot. In practice, the function still attempts to load these models, and ultimately fails, preventing the rest of the URDF from being generated.

My only workaround for this has been to create a new branch of the assembly, in which I explicitly delete all surface models (and traces of them) from the assembly, and then export the URDF from there. This has several obvious issues: 1) these are important components and really do belong in the assembly; 2) it may not always be possible to delete these models if they are critical for mates involved in certain joints; 3) it's an overall clunky and human error prone workflow.

Gregwar commented 1 year ago

Hello, suppressed items should indeed not be loaded. Can you make the smallest possible example reproducing the problem and share the output and the Onshape document ?

maxwellkm commented 1 year ago

Hi Gregwar,

Thanks for getting back to me! I made a quick example reproducing the problem by showing three versions with unsuppressed/suppressed/deleted states, respectively. Quick descriptive context:

-Belt Linear Stage HRC Assembly is an assembly included in subassembly, and Belt Linear Stage HRC Assembly is the only aspect that changes state between the three versions. -A slider joint is defined between subassembly and 7917N22_High-Cycle Low-Profile Ball Bearing Carriage in main_assembly.

The only version which outputs a URDF is the one in which Belt Linear Stage HRC Assembly is completely deleted from the document. Suppressing it does not seem to function properly.

Unsuppressed: https://cad.onshape.com/documents/79f9cef2a762738541f04969/v/f2a80da0e483dfbc26340bfb/e/a0617a7c4c7659ba84a086e9 Suppressed: https://cad.onshape.com/documents/79f9cef2a762738541f04969/v/f2efb59723ff2e9588be1076/e/a0617a7c4c7659ba84a086e9 Deleted: https://cad.onshape.com/documents/79f9cef2a762738541f04969/v/d63292a537b17ea5ad5e1b29/e/a0617a7c4c7659ba84a086e9

Niklas-Mulsow commented 10 months ago

Hello, I got the same problem like Maxwell, is there any solution in the pipeline?

Best Niklas