Bake, then use the matrix world translation
As proposed here Is there any way to export the last frame of a physics simulation from command line?
bake the sim, then in this case instead of exporting, run thru the objects in the scene and print their global translation. in lieu of Formatting and writing data to a text file
Make the origin of the physics objects the center of mass when setting up.
import bpy
context = bpy.context
scene = context.scene
rbw = scene.rigidbody_world
pc = rbw.point_cache
# match bake to animation
print(pc.frame_start, pc.frame_end)
bpy.ops.ptcache.bake({"point_cache": pc}, bake=True)
scene.frame_set(250)
#bpy.ops.export_scene.obj(filepath="test.obj")
for ob in scene.objects:
print(ob.name, ob.matrix_world.translation)
Result on default file, cube made a default rigid and dropped
Cube <Vector (0.0000, 0.0000, -460.8643)>
Lamp <Vector (1.7122, 1.0489, 8.5606)>
Camera <Vector (5.1171, -6.4642, 8.0004)>