|Note: This tutorial assumes that you have completed the previous tutorials: This tutorial assumes you have successfully installed the SolidWorks to Exporter.|
|Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.|
Export a SolidWorks part to URDFDescription: This tutorial describes the very simple process for exporting a SolidWorks part to a URDF.
Tutorial Level: BEGINNER
Next Tutorial: Exporting an Assembly to URDF
Exporting a part
Open your part in SolidWorks.
Click "File>Export to URDF" (sometimes its "Extras>File>Export to URDF")
This will bring up a single page form that loads the material property, color property and mass property information into the form. If you desire, you can change any items you like, but the part will be loadable into Gazebo or RVIZ without any modifications.
The default save path is a package named after the part in your home folder, click browse to change this.
You can add a texture to the link by selecting the texture from your computer. This file will be copied into your URDF package.
Click finish to create the package. It will export the meshes, copy the textures and create a URDF that specifies the locations of these files with a 'package://PackageName' relative location. If you do not have rospack installed on your target computer, you will have to edit these locations manually.
The built package
The package will contain directories for meshes, textures and robots. It will also contain a ROS package.xml (manifest) file so you can use this as a ROS package by just copying it to your ROS system. The path locations in the URDF are relative to the package itself. If you do not have rospack, you will need to change the paths manually so that they refer to locations on the machine using the URDF files. If you do use rospack, you will need to add the package to a location in your $ROS_PACKAGE_PATH. To simplify complicated meshes, you may like to use a program like MeshLab or Blender.