Exporting .urdf model from SolidWorks

2,823 views
Skip to first unread message

Tiago Pimentel

unread,
Jun 12, 2013, 10:32:40 AM6/12/13
to moveit...@googlegroups.com
Good morning everyone,

I've been trying to export a model from SolidWorks to MoveIt, but I haven't been successful. I have an industrial arm in an assembly file and was trying to use the sw_urdf_exporter.
I followed all the steps described here: http://www.ros.org/wiki/sw_urdf_exporter/Tutorials/Export%20an%20Assembly but it hasn't worked correctly so far. My issue is that, when I export the file with the joints corrdinate systems all in the origin of the base_link, the arm is imported correctly in MoveIt, but the parts, instead of rotating in their place, rotate around the whole robot body. On the other side, when I put the coordinate systems in the right place, in the joint, they rotate around the right point, but are expanded as if two times as far as they should be from the origin of base_link.
Has anyone tryed this or has any idea of what might be the problem?

In this dropbox folder I have 2 videos of what is happening:
https://www.dropbox.com/sh/slw1mz05lo919l5/d5RlhA1t6z

Feel free to ask any questions you might have!
Thank you,
Tiago Pimentel

Shaun Edwards

unread,
Jun 12, 2013, 11:01:22 AM6/12/13
to Tiago Pimentel, moveit-users
Not sure what the problem may be.  Have you tried to export the models manually.  This tutorial may help: http://ros.org/wiki/Industrial/Tutorials/Create%20a%20URDF%20for%20an%20Industrial%20Robot

jz...@swri.org

unread,
Jun 12, 2013, 11:06:50 AM6/12/13
to moveit...@googlegroups.com
Tiago,

This is almost certainly a URDF issue, and not a MoveIt issue.  If you don't get a good answer here, there's a good chance that someone at http://answers.ros.org will be able to help.

When generating the URDF, you definitely need to put the coordinate systems in the right location (at the joints).  Otherwise, ROS has no idea how your robot is constructed, kinematically.  I think the issue your seeing with the "exploded" robot has to do with which mesh files you're using.

Most robot assemblies that you download from manufacturer's websites are generated such that the origin for each individual part file is located at the assembly origin.  This makes the assembly model easy to create (mate all origins coincident), but means that those individual part meshes have origins well outside their mesh-boundaries.  When you reference a mesh file in a URDF, the syntax specifies both a filename and an offset from the link origin (a.k.a. Solidworks Joint Coordinate System) and the mesh-file origin.  The Solidworks URDF exporter tool creates the URDF with a zero offset between the mesh origin and link origins.  It also generates a new set of STL output files, that have been shifted so that their origins lie at the expected locations.

If you are using the original motoman STL files rather than the Solidworks-to-URDF generated STL files, then ROS is rendering each mesh such that its origin (typically located at the robot's base frame) is instead located at the joint frame.  This would cause the behavior you're seeing: correct motion, but "exploded" mesh visualizations.

Make sure you are using the correct mesh files and see if that fixes the problem.

If you'd like to use the original mesh files for some reason, you can either adjust the mesh-data offsets in the generated URDF file, or use a mesh-editing program (e.g. MeshLab) to shift the meshes so that the origins are in the expected location.

Finally, as Shaun pointed out, we have a fair amount of Motoman support available under the ROS-Industrial set of packages. Feel free to look around and see if any of this info would be helpful:
  http://ros.org/wiki/Industrial

Good luck!
  Jeremy Zoss
  Southwest Research Institute

Tiago Pimentel

unread,
Jun 13, 2013, 9:42:57 AM6/13/13
to moveit...@googlegroups.com
Hi Jeremy and Shaun,

I was exporting all the stl files at once using the sw_to_urdf exporter itself and I tried setting the origins of each part of the assembly to both the main origin of the whole assembly arm and the point where their coordinate system using for building the joint would be. But this has made no difference that I could notice.
I decided to just use the offset in each link to position all the meshes in the right position, by setting their visual and collision origins to the sum of all the joint origin values times -1 (because the position of 1 joint builds upon the other) I was able to put them in the right spot.

Does anyone here knows if that can be a problem with the inertial component, should I put the same offset there? And does anyone know if there can be any future issues caused by this fix?

Thank you for the help,
Tiago Pimentel
Reply all
Reply to author
Forward
0 new messages