the reason rostopic echo was not giving right values was because i had declared the centroid_rung1 and centroid_rung2 would publish over Point message. Changed Point to PointStamped to fix the error