ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Can I change the center of mass' position?

asked 2019-01-25 03:49:40 -0600

magole gravatar image

Hey there,

Sorry in advance, I know this is a gazebo question but I'm in a hurry and nobody has answered in Gazebo Answers to this question since the last week, I'll appreciate any help thanks. I've exported some meshes from Solid Works and in all of them the center of mass is not where it should be. The center of mass appears always on the corner. I'm quite sure it have to be a problem related to Solid Works, so I've been looking for how to change the center of mass' position in Gazebo but nothing I've found. Few days ago I applied a center of mass in a Solid Works part, then exported it again to Gazebo with the hope to see some changes but nothing, the center of mass continues being out of its logical point.


edit retag flag offensive close merge delete


I would recommend fixing this problem in Solid Works. Calculating physical properties and exporting the SDF definitely does work. It sounds like you haven't set the material properties or generated the physical properties before your export.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-01-25 05:23:14 -0600 )edit

You may change it dynamically by following the advice in here:

kosmastsk gravatar image kosmastsk  ( 2019-01-25 05:36:23 -0600 )edit

PeteBlackerThe3rd, I've tried what you say. I applied aluminum material to a part, the center of mass is still making no sense. Actually, when I exported to STL some windows appeared saying that some properties hadn't been exported. Might be that, I'll try again

magole gravatar image magole  ( 2019-01-25 06:11:12 -0600 )edit

Wait a second, STL doesn't support physical properties. Are you not using the solidworks to URDF exporter?

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-01-25 06:41:44 -0600 )edit

I knew about that but then i don't know how to open or edit an urdf file in Gazebo

magole gravatar image magole  ( 2019-01-25 08:27:10 -0600 )edit

A URDF file is just a text file, you can edit it any text editor. The URDF in gazebo tutorial should cover everything you need.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-01-25 08:42:25 -0600 )edit

Wow thanks, now I see it. However now I get another problem, I'll close this question and open another one.

magole gravatar image magole  ( 2019-01-25 10:47:24 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-01-28 04:32:11 -0600

magole gravatar image

So, the problem was that I was working with STL when as @PeteBlackerThe3rd said it doesn't support physical properties. To export from Solid Works to Gazebo I can do two things, exporting as STL file only recommended for static meshes and as URDF using SW2URDF exporter for models. Now all works correctly, thanks to @PeteBlackerThe3rd.

edit flag offensive delete link more


Great, glad you got this working.

PeteBlackerThe3rd gravatar image PeteBlackerThe3rd  ( 2019-01-28 05:21:32 -0600 )edit

Question Tools



Asked: 2019-01-25 03:49:40 -0600

Seen: 1,581 times

Last updated: Jan 28 '19