I followed the tutorial regarding how to set up an assembly for a simpler mesh and in the export process I noticed the mass of some links does not match that shown in the Solidworks Mass Properties window. Additionally no links seem to have the same Moments of Inertia as shown by the Solidworks Mass Properties window. Is this a known issue, and if so how can we work around this to have both simplified meshes and accurate mass and moments of inertia?
I am not certain as to the steps of pointing the exporter to both the skin mesh and the actual massive parts. At first I was only including the skin parts, but it occurred to me that the URDF exporter would have no way to know which actual parts correspond to which skin parts with regard to mass and moments of inertia, so I suppose it is implied that one must select all the actual parts at some point. I'm still unsure of the correct steps to get both the skin part mesh with the actual mass and moments of inertia though. Here is as close as I've come thus far:
- Start with skin parts and actual parts as per the tutorial with Display States DS_Skin and DS_Actual.
- Create custom coordinate system (CoordSys) corresponding to the center of the wheels axis (two wheel balancer robot) and an axis RotationalCenter that passes through the rotational axis of both wheels.
- Make a Selection Set for each Link using all actual parts and all skin parts associated with a given Link.
- Stay on DS_Actual and open the URDF Exporter.
- Use the Selection Set for all actual and skin parts associated with the base Link base_link. Use CoordSys as Reference Coordinate System.
- Use the Selection Set for all actual and skin parts associated with each of my two child Links corresponding to each wheel (Link_WheelLeft and Link_WheelRight). Use CoordSys as Reference Coordinate System and RotationalCenter as the Reference Axis.
- Preview and Export..
- Ensure Coordinates set to CoordSys and Axis set to RotationalCenter
- Origin set to (0,0,0) (0,0,0) I assume this to be relative to CoordSys?
- Axis looks to be a unit vector along the RotationalCenter axis as expected.
- Next
- base_link: Although the same errors appear here, I'll ignore and move to the Link_WheelLeft as it has less components and easier to show the errors here. I should note that the Mass is also a little off between the Exporter and Mass Properties window.
- Link_WheelLeft: The Inertial Origin matches the Center of mass as calculated by Solidworks Mass Properties as does the Mass (0.045216 kg). The Moment of Inertia in the Exporter looks nothing like any of the matricies given in the Mass Properties of Solidworks. Why could this be? I don't have enough Karma to post a photo, but here is a shared Dropbox folder with some screenshots showing this. I also note the units in the Exporter to be (kg * m ^ -2). Is this minus sign a typo or is this some metric I have never seen that does not correspond to the units of the Solidworks Moments of Inertia (kg * m ^ 2)
- At this point I'm not sure if I should just switch the Display State to DS_Skin, or if this actually even does anything?
- Export URDF and Meshes...
I've also included a Pack and Go zip file of my full assembly so you can recreate the steps above if so desired. Let me know if you require any further information.
System details:
Solidworks 2019 SP 5.0
URDF Exporter 1.5.1
###Edit 1:
After receiving enough Karma, here are the screenshots I have in the Dropbox folder. From step 13.) see below:
The remaining images are just other steps, that may or not be useful:
###Edit 2: Adding another screenshot showing the difference in Mass Properties vs the Exporter for the base_link (everything but the wheels). Note the small differences in the Mass and Center of mass on the Mass Properties vs the Inertial Origin in the Exporter. (e.g. mass = 0.54812303 vs 0.54821, and x = -0.00412774 vs -0.0041336). I'm thinking it makes more sense to figure out the differences in mass and center of mass prior to trying to solve the Moments of Inertia :
The steps I took to produce this screenshot were:
- Run through the Exporter as per steps above
- When on the GUI showing Inertial Origin properties in the Exporter, I simply click the Mass Properties in the main Solidworks window. With everything already selected (thanks to the Exporter) this calculates the Mass Properties, of what I'd assume to be the same components the Exporter is using. I've also tried removing all items from the Mass Properties list and using my Selection Set that I used to define the base_link in the Exporter. Same results. Slight differences in mass and center of mass, which then compound the error in the Moments of Inertia, making them unrecognizable.
###Edit 3:
I narrowed this down quite a bit via the following steps:
- Starting from my Pack and Go Assembly with three distinct Assemblies corresponding to three distinct Links (base_link, wheelL, and wheelR). Although there may be separate issues with the wheel Links, here I am focusing on the base_link.
- Suppress all parts in my base_link assembly other than one.
- Run the Exporter until reaching the Inertial Origin window and note the Mass of the base_link.
- Open the Mass Properties window and note the Mass to be the same as shown in the Exporter
- Unsuppress a different part and suppress all others repeat steps 2-4 until I note a difference in the two reported mass values.
- After finding a part that results in a mismatch, roll back its feature tree to suppress all but the first feature. Rerun steps 2 and 3. Repeat this process until finding a feature that results in a mismatching mass.
I did this until I found my first feature that is causing an issue. It is a Thicken feature on the back cover plate. I haven't confirmed if this issue exists for other features as well, but I am curious how this could be happening.
I note the Mass Properties -> Options -> Accuracy Level and wonder if these two calculations of mass are using a different accuracy level? I tested out all three levels in the Mass Properties options, but nothing changed, so I suspect this is not the case. Any ideas?
Originally posted by topherbuckley on ROS Answers with karma: 21 on 2020-06-10
Post score: 1
Original comments
Comment by gvdhoorn on 2020-06-10:\
I don't have enough Karma to post a photo
please attach your screenshots directly to this post. I've given you sufficient karma.
Comment by topherbuckley on 2020-06-10:
Done. See edits. Doesn't look like I can upload the full Assembly zip here (I received no error message, it just stop trying to upload after some time). So if you want to take a look at it, it is still in the Dropbox folder. If there is a more appropriate place to share such a large file, please let me know and I'm happy to reupload.