For quite some time now, I have been trying to find a way and create a frame from the Center of Mass (CoM) of a multiple body mechanism (e.g. a humanoid robot). The reason for this is that I want to apply 3D external forces to the robot's CoM, which is expected to be changing. Applying these forces directly on a robot part close to where the CoM is expected to move around is creating unwanted torques and the simulation fails. Changing the force resolution frame from attached to world creates different results but still ends up failing.
To amend this, I have extracted the robot CoM via the Intertial Sensor, but it gives the (x,y,z) coordinates and not a frame. I tried to use a Cartesian Joint and displace a robot frame by (px,py,pz) = (CoM exported by the Inertial Sensor, under custom frame coordinates and mechanism sensor extent with excluded ground components), for tricking into using the resulting frame to apply the external forces, but as expected it creates an algebraic loop and the simulation cannot run.
There must be a simpler way to do this, I just cannot see it. Your help will be greatly appreciated!