I have created a robot model in solidworks and exported in solidworks to urdf plug-in. When exporting the co-ordinates of the model is misaligned which is causing problem while using in ROS.

enter image description here

As you could see in picture the Z-axis is horizontal in assembly whereas vertical in solidworks. How to align these co-ordinates. The generated co-ordinate system must be similar to solidworks' co-ordinates

PS: I have mated the assembly origin and base_link origin


I did a little step-by-step tutorial with images, but if my other answer regarding aligning frames didn't work well for you, or the definition of "Front Plane" or "Top Plane" is confusing in Solidworks (spoiler: it is), then consider making your own axes.

From the assembly tab, go to reference geometry -> axis, then select the assembly planes to make an axis. There are three possible combinations of planes, giving you three unique axes (1-2, 1-3, 2-3).

Then, compare the axes to the global axes, and rename them to the same for clarity later.

Then, delete the old mates that are keeping the assembly grounded, then re-mate whatever lines you have that determine a particular frame to your newly-named axes you just made.

This should fix the problem for you.

Step 1

Step 2

Step 3

Step 4

Step 5

Step 6

| improve this answer | |
  • $\begingroup$ Should i create line sketch in the base plate to align it with the created axis (To make the selection as shown in 5th image). I manually created a line sketch but i am getting "overdefine" error $\endgroup$ – user3725099 Feb 17 '16 at 18:20
  • $\begingroup$ While following the other answer i was able to create an URDF with correct co-ordinates. But when i launch and navigation stack in rviz and provide initial pose the robot appears in side ways Ref Fig. My robot localization is poor, does this pose error has anything to do with localization. $\endgroup$ – user3725099 Feb 17 '16 at 18:39
  • $\begingroup$ @user3725099 - How are you setting the initial pose? Is it with a quaternion or Euler angles? Are you sure you're entering the initial pose correctly? What values are you using? With a 3D rotation matrix and Euler angles, order of rotation matters, and you won't get to the correct ending pose if you don't transform in the correct sequence. Without more information I can't really comment any more, but maybe this should be a new question. $\endgroup$ – Chuck Feb 17 '16 at 20:56
  • $\begingroup$ Regarding the line sketch, I based my pictures on your pictures; I thought you already had labeled axes in the base plate of your drawing. $\endgroup$ – Chuck Feb 17 '16 at 20:57
  • $\begingroup$ That was URDF reference angle created after executing preview in solidworks to URDF plug-in. Can't we use the default axis of the part, How to view and use the part axis in solidworks? Ref files here $\endgroup$ – user3725099 Feb 18 '16 at 13:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.