How to get Position of turtlebot?
my question is: how do i get the position of my turtlebot in the room? I followed the instuctions from the website lear.turtlebot. I modified the code for my own issues but now my question is: when i am sending a new goal to my turtlebot (initialized as a SimpleActionClient from actionlib), using a MoveBaseGoal: where do i get the precise position of my turtlebot during the driving from?
I tried for example:
rospy.Subscriber("odom", Odometry, self.Position)
def Position(self, msg):
print msg.pose.pose
the problem here is, that the values of position.x and position.y are not the right ones, because the turtlebot ends up in the right place where i wanted it to be, but the printed information is totally wrong.
The right information is existent in rviz: a client that I use to set the initial position of my turtlebot.
Another way that i found is using a TransformListener but every tutorial i found did not work in my place. In my opinion the prblem here is that i have no idea how the topics or frames are called.
Does anyone can help me please?