jupyterlab-urdf icon indicating copy to clipboard operation
jupyterlab-urdf copied to clipboard

Suggestions: Mesh loading and URDF export

Open stephane-caron opened this issue 2 years ago • 6 comments

This is a nice project :smiley: Here are my two cents. (This is a discussion thread rather than an issue, feel free to close any time.)

Context: I'm writing a note on building URDF models (in the context of refreshing this description) and this tool could simplify the tutorial a great deal. Currently the process is:

With two tabs in JupyterLite and seeing the updates immediatly, this loop would accelerate nicely!

Adoption brake: I read in the docs that mesh loading relies on ROS, which assumes ROS (an adoption brake in itself :smile:). Meshes change along the edition process, so it would reduce friction further to be able to load/upload them in the interface directly (e.g. by drag-and-dropping STL files?).

Suggestion: Exporting a description package once the model is ready could be convenient too. Or maybe assume the notebook is started from the directory of the description package, and interpret file paths from there?

Hoping this is helpful feedback. All the best for this project!

stephane-caron avatar Aug 18 '23 09:08 stephane-caron

Hi @stephane-caron!

Thank you so much for your input. And you're right, relying on ROS to load mesh files really limits the use. But, I've recently changed that so that instead of relying on a ROS connection, mesh files can be loaded directly. For now, this only works with JupyterLab. The idea is that the description folders will be in the directory where JupyterLab is launched from. Plus there is an option to modify the path to search for the description files. So from the file manager in JupyterLab, you should be able to modify mesh files on the go. I'm currently working on updating the documentation to reflect this, and all the new changes should be available in the next release.

Hopefully, this also works with JupyterLite. But I'm waiting until JupyterLite completes the transition to JupyterLab 4 to make sure.

A question for you, we've been considering some sort of integration with JupyterCAD maybe to modify the mesh files directly. Would that be something you would consider useful?

Thanks!

IsabelParedes avatar Aug 22 '23 15:08 IsabelParedes

JupyterCAD looks very cool! I'm a beginner at CAD, many parts in Upkie were done in Blender :see_no_evil: Recently new contributors have designed or redesigned parts in FreeCAD, so I've started to learn it. Next time I do CAD I'll try JupyterCAD.

I guess what would be great overall would be to do the whole mechanical design in one software (e.g. JupyterCAD) that exports a proper URDF. From what I've seen the URDF exporter from SolidWorks is not there yet (some post-processing to do to get a decent URDF). Onshape to Robot is an alternative, but I'd rather use open source tools rather than depend on commercial products for this.

stephane-caron avatar Aug 24 '23 09:08 stephane-caron

I think it should be possible to export URDFs from JupyterCAD and continue editing them with this extension. To make exporting possible, JupyterCAD would need some sort of joint property manager such as the one in SolidWorks, but it's doable.

Do you have examples or could you describe a bit more the post-processing needed when using SolidWorks? I haven't used SolidWorks in a long time, but I'm just curious.

IsabelParedes avatar Aug 25 '23 15:08 IsabelParedes

This is just anecdotal evidence, but the post-processing I did once after receiving a SW-exported URDF for a variant of Upkie involved turning joint frames around (some leg copy-pasting gone wrong I assume), along with some meshes that were not exported properly. I have no idea which version of the SolidWorks to URDF Exporter or SolidWorks were used to produce that imperfect URDF :sweat_smile:

stephane-caron avatar Sep 05 '23 12:09 stephane-caron

Just a little update...

@Yahiewi has been working on https://github.com/jupytercad/JupyterCAD-urdf/, a JupyterLab extension which exports JupyterCAD files into URDF along with its associated mesh files 🤖

IsabelParedes avatar Aug 19 '25 10:08 IsabelParedes

Looks nice 😃 I opened a PR to propose adding it to awesome-urdf.

stephane-caron avatar Sep 03 '25 10:09 stephane-caron