how to print the centroid/origin of an object?
Are you trying to place object in center of grid?

import bpy

bpy.ops.object.location_clear(clear_delta=False)


or something like this.

import bpy

ACT_OBJ  = bpy.context.active_object

ACT_OBJ.location = (0.0, 0.0, 0.0)