ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to get x,y coordinates of turtlebot

asked 2019-03-03 12:50:22 -0600

GroggyROS gravatar image

Hello, I'm trying to get the x and y coordinates of a turtlebot in the simulated world. Currently I have subscribed to the odom topic and have been able to get pose.pose.position.x and pose.pose.position.y. However when I get these values they are not x=0 and y=0 as I expect as the turtlebot has not yet moved. Is there something wrong with my assumption and/or am I not using the right rostopic to get desired x and y values?


edit retag flag offensive close merge delete


Why did you delete and close this question?

gvdhoorn gravatar image gvdhoorn  ( 2019-03-03 13:42:57 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-03-03 13:14:35 -0600

gvdhoorn gravatar image

updated 2019-03-03 13:22:16 -0600

So what are the values you see, instead of 0, 0? Keep in mind that a simulator typically uses numerical approximations that may result in drift even though the model should be at rest/idle.

edit flag offensive delete link more


When I run "roslaunch turtlebot_gazebo turtlebot_world.launch "

x: -1.05240047001e-06 y: 8.27266784267e-07

GroggyROS gravatar image GroggyROS  ( 2019-03-03 13:36:21 -0600 )edit

Question Tools

1 follower


Asked: 2019-03-03 12:50:22 -0600

Seen: 514 times

Last updated: Mar 03 '19