SolidWorks to URDF Exporter
The SolidWorks to URDF exporter is a SolidWorks add-in that allows for the convenient export of SW Parts and Assemblies into a URDF file. The exporter will create a ROS-like package that contains a directory for meshes, textures and robots (urdf files). For single SolidWorks parts, the part exporter will pull the material properties and create a single link in the URDF. For assemblies, the exporter will build the links and create a tree based on the SW assembly hierarchy. The exporter can automatically determine the proper joint type, joint transforms, and axes.
!SolidWorks Version Compatibility
There is a known STL export bug with SolidWorks 2018 that exists up to Service Pack 4 that renders this add-in unusable. If you are using 2018, please update to service pack 5 or use SolidWorks 2019 or later. 2017 and below may also work
Some Important Items
Development on this plugin as of recently has come from the generous donations of several ROS community members. Without this support or from pull requests from communities members, development would not be able to continue. We also appreciate any bugs or feature requests so that we can work on them when the resources become available.
This project is not dependent on ROS and can be used for exporting SolidWorks files for any URDF needs. The URDF will include rospack URI file locations ('package://'), so you will need to change those for non-ROS systems (some Gazebo systems can handle 'package' URIs).
This add-in has been tested on Windows 10 64bit with SolidWorks 2018 SP 5 64bit. It currently does not install on 32bit machines. The add-in makes use of the most up-to-date SW API so it may not work with versions earlier than SolidWorks 2018 (but this hasn't been confirmed).
To learn more about URDF, please review its documentation.
If you have questions about the SolidWorks to URDF Exporter after reading this documentation please check ROS Answers for possible answers. If you don't find your answer, please submit a question with the tag 'sw_urdf_exporter'.
The code has been migrated to Github from its original BitBucket page. Use Github's
Details of bug fixes and new features are put in the Change Log.
The download is available as a pre-compiled installer or as source as a Visual Studio C# project.
This sounds made up, but you cannot install the files into a directory labeled "SW2URDF". For some reason, Windows struggles to find the supporting plug-ins, and will throw an unhandled exception error. If anyone has some suggestion as to why, I'd love to know.
This installs the most current stable release.
Upgrade to at least .NET Framework V4.7.2 if you don't have it already.
- Download the installer linked above.
Run the installer. It will ask for permission to make changes to your computer. Your Windows account will need to have sufficient privileges to make these changes. It should install into the SolidWorks directory in program files.
Open SolidWorks, under "Tools>Add-ins" you will see a SW2URDF item at the very bottom. If this setup file doesn't work, try installing manually as described below.
These are the most up-to-date source files. Because this is checked in regularly, there may be bugs or un-finished code in the source files. If you need a stable version of the source, check-out the revision tied to the installer.
To build the source, you'll need to download Visual Studio Community.
Checkout the source with git.
- Run Visual Studio as administrator. Your Windows account needs to have these privileges to register the .dll. To do this, right click on Visual C# in your start menu and click, 'run as administrator'.
Click on "Debug>Start Debugging" or press F5. It will compile and run SolidWorks together. After doing this once, you only need to run from Visual Studio to re-compile. Otherwise, to just use the tool, you can start SW normally.
When SolidWorks is open, under "Tools>Add-ins" you will see a SW2URDF item at the very bottom. If this setup file doesn't work try installing manually as described below.
The exporter has two separate forms, one for exporting single SW parts as a single link and the second for exporting assemblies as a set of links and joints.