ROS Resources: Documentation | Support | Discussion Forum | Service Status | Q&A answers.ros.org
Ask Your Question
0

How to get Position of turtlebot?

asked 2015-12-14 09:56:27 -0500

volleybug gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2015-12-14 14:11:52 -0500

updated 2015-12-14 14:12:03 -0500

Note that the odom topic contains the pose of the turtlebot in the /odom frame. This pose will drift relative to the ground truth pose as the turtlebot drives around. This is due to a variety of factors such as error in the kinematic model and wheel slippage. Due to this drift, if you are trying to control your turtlebot to a fixed location in a static environment (such as a room), the odom topic is not enough.

Are you using a map? If so, you are also likely using AMCL to "localize" your robot. In this case, you should be either transforming the pose information in the odom topic into the /map frame, or you should be looking up the transform from the /map frame to the /base frame.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2015-12-14 09:56:27 -0500

Seen: 1,355 times

Last updated: Dec 14 '15