get_position function

Get the position of an object