Repository: cyberbotics/webots

Issue #4684: CoM and Inertia matrix is not computed correctly until reload
Created: 2022-06-17T18:05:08Z
Hello,
CoM and Intertia matrix is not computed correctly until reload
To reproduce :
Load the following world : (not that the Shape, look like à box, but, it's actually a IndexedFaceSet)
The bug doesn't appear if the shape is a regular Box (not tested with others types of shapes)

World
#VRML_SIM R2022b utf8
WorldInfo {
}
Viewpoint {
  orientation -0.027788337355049333 0.03381763434421385 0.9990416287194458 0.7555422126100662
  position 116.74824686377895 135.81333526873226 1.3837473743471866
}
TexturedBackground {
}
TexturedBackgroundLight {
}
Solid {
  translation 120.518 138.54 1.14327
  rotation 0.12600000613053045 0.9475610461035838 0.293687014289342 -0.8503153071795859
  children [
    DEF t Transform {
      translation -0.045 0.652 0.005
      rotation 0 0 -1 4.712389
      children [
        Shape {
          geometry IndexedFaceSet {
            coord Coordinate {
              point [
                0.351 0.369 0.05
                -0.239 0.369 0
                -0.239 0.369 0.05
                0.351 0.369 0
                0.351 -0.385 0
                0.351 -0.385 0.05
                -0.239 -0.385 0.05
                -0.239 -0.385 0
              ]
            }
            coordIndex [
              0, 1, 2, -1, 0, 2, 6, -1, 0, 3, 1, -1, 0, 4, 3, -1, 0, 5, 4, -1, 0, 6, 5, -1, 1, 3, 7, -1, 1, 6, 2, -1, 1, 7, 6, -1, 3, 4, 7, -1, 4, 5, 6, -1, 4, 6, 7, -1
            ]
          }
        }
      ]
    }
  ]
  physics Physics {
    density -1
    mass 1
  }
}


Select the solid, and the tab "Mass", see :

That's ok, the Solid have no bounding object
In the bounding object, "USE t" (to use the shape of the box)
Select the solid, and the tab "Mass", see :

The CoM and matrix are wrong
Save the world, reload, select the solid, and the tab "Mass", see :

Now the CoM and matrix are correct.
Expected behavior :
CoM and matrix should get the right value since we change to bounding object, without needing to reload.

Duplicate issue #4906: Wrong "Bounding Object Based" MoI
Created: 2022-07-18T11:40:19Z
Describe the Bug
Using a "Bounding object based" MoI give values that are different from the default MoI values.

World
#VRML_SIM R2022a utf8
WorldInfo {
  lineScale 10
}
Viewpoint {
  orientation 0.18483272608525197 0.34484097093526966 -0.9202834172863895 1.2065546190350083
  position -8.08416062735125 16.7740818030343 8.768359541015466
}
TexturedBackground {
}
TexturedBackgroundLight {
}
Robot {
  children [
    DEF s Shape {
      appearance PBRAppearance {
      }
      geometry Sphere {
      }
    }
  ]
  boundingObject USE s
  physics Physics {
    density -1
    mass 1
  }
}


Steps to Reproduce

Open the world, note that in the "Mass" tab of the Solid the MoI is [0.4,0.4,0.4, 0,0,0]
That is correct
RIght click on "physic/inertiaMatrix" -> Add New -> Bounding Object Based -> Add
Observe that the MoI in the "Mass" tab of the Solid change to [1675.52,1675.52,1675.52, 0,0,0]
That change should not occurs, the object haven't changed. This is because the inserted matrix is [1675.52,1675.52,1675.52, 0,0,0]

Expected behavior
The MoI inserted into the field inertiaMatrix should be [0.4,0.4,0.4, 0,0,0], to stay consistent with the MoI initially displayed in the "Mass" tab
System

Operating System: Debian 11
Webots: 2022a

Closing comment (2022-07-18T11:49:43Z): This seems the exact same issue as reported in #4684 .