Try to make your robot assembly mostly based on sub pre-assembled components (avoid to have a lot of constraints that are not relevant for the export). In this main assembly, do not use features such as sub-assemblies network.
Specifying degrees of freedom
Degree of freedoms should be slider, cylindrical or revolute mate connectors named
somethingwill be used to name the joint in the final document
If the mate connector is cylindrical or revolute, a
revolutejoint will be issued by default
To make a
wheelin the name of the joint. For instance, a revolute mate named
dof_front_left_wheelwill result in a
front_left_wheelin the resulting URDF.
If the mate connector is a slider, a
prismaticjoint will be issued
If the mate connector is fastened, a
fixedjoint will be issued
When doing this connection, click the children joint first. This will be used to find the trunk of the robot (part with children but no parent)
Inverting axis orientation
It is possible to invert the axis for convenience by adding
_inv at the end of the name. For instance
dof_head_pitch_inv will result in a joint named
head_pitch having the axis inverted with the one
from the OnShape assembly.
Adding custom frames in your model
If you want to track some frames on your robot, you can do the following:
Connect any part to your robot using mate relations in OnShape
Name one of these relations
somethingwill be the name of the frame (a link) in the resulting
If you want to give it a try, you can use the
urdf mode, it will output the
frames on standard output.
Here is a link of a document that can be used as a frame (note: the center cube is 5mm side, so you might need 2.5mm offset to center it).
If your robot includes closing loop, those can’t be handled in the URDF file directly since the robot has to have a kinematics structure that is a tree.
However, it is possible to add multiple frames, and to make constraints out of them during your simulation.
If you add a relation with
closing_something as name, two frames will be added to your URDF
closing_something_2) that will be attached to the two parts mated.
It’s up to you to handle it further by adding proper constraints.
Joint frames are the ones you see in OnShape when you click on the joint in the tree on the left.
Thus, they are always revolving around the z axis, or translating along the z axis, even if the
_inv suffix is added.