Return an object's moment of inertia

Requests or suggestions for new features
kubark42
Posts: 15
Joined: 10 Dec 2014, 18:34

Return an object's moment of inertia

Looking at http://www.coppeliarobotics.com/helpFil ... terIDs.htm, it's easy to get the mass for an object, but there doesn't seem to be support for getting the moment of inertia as well. It'd be nice to have it for getting the total moment of inertia of a rigid object composed of multiple elements (understanding of course that moments of inertia can't be simply summed without taking into account the relative location of each element relative to the CG).

coppelia
Posts: 8206
Joined: 14 Dec 2012, 00:25

Re: Return an object's moment of inertia

Hello,

for a shape, you can retrieve the mass and moment of inertia with simGetShapeMassAndInertia.

Added note on 20/08/2020: From CoppeliaSim version > 4.1.0 rev1, sim.setShapeMassAndInertia and sim.getShapeMassAndInertia are deprecated. Use instead sim.setShapeMass, sim.getShapeMass, sim.setShapeInertia and sim.getShapeInertia.

Cheers

kubark42
Posts: 15
Joined: 10 Dec 2014, 18:34

Re: Return an object's moment of inertia

Hah, another case where V-REP has thought of everything. I looked at parameter IDs because that's where I was already getting the object's mass, and didn't think at all to look in the API.

There seems to be some duplication between methods that access the model via parameter IDs and API methods that access model directly. Is one an older way that is moving toward depreciation?

coppelia