# How do I constantly make my robot the centre of the map

I am currently using Ubuntu 16.04 and turtlebot3. How do i ensure that the TurtleBot is always at the centre of the map image? My current code only allows the map to be rotated in the forward orientation, but doesnt make the turtlebot at the centre of the map image.

Below is my current code:

occ_bins = [-1, 0, 100, 101]

rotated = Image.fromarray(np.array(np.zeros((1,1))))

def callback(msg, tfBuffer):

global rotated

occdata = np.array([msg.data])
occ_counts = np.histogram(occdata,occ_bins)
total_bins = msg.info.width * msg.info.height
rospy.loginfo('Unmapped: %i Unoccupied: %i Occupied: %i Total: %i', occ_counts[0][0], occ_counts[0][1], occ_counts[0][2], total_bins)