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

SeanAda's profile - activity

2016-11-02 20:44:28 -0500 received badge  Famous Question (source)
2016-08-12 02:25:56 -0500 received badge  Notable Question (source)
2016-08-11 15:44:57 -0500 received badge  Scholar (source)
2016-08-11 15:44:17 -0500 received badge  Supporter (source)
2016-08-11 15:43:50 -0500 received badge  Popular Question (source)
2016-08-10 12:59:20 -0500 asked a question Get robot position und orientation (in degree) from TF

Hi,

I want to get the Position (x, y) and the orientation from my robot. The position should be relative to the map TF. Therefore I used a TransformListener:

tf::StampedTransform transform_bot;
tf::TransformListener listener;

listener.lookupTransform("/map", "/base_footprint", ros::Time(0), transform_bot);

bot_x = transform_bot.getOrigin().x();
bot_y = transform_bot.getOrigin().y();

double roll, pitch, yaw;
transform_bot.getBasis().getRPY(roll, pitch, yaw);

bot_dir = yaw * 180.0 / PI;

ROS_INFO("Bot X: %f", bot_x);
ROS_INFO("Bot Y: %f", bot_y);
ROS_INFO("Bot Z: %f", bot_dir);

So far I was not able to get good result with this solution...

Do you have any ideas, how to solve the problem?

Thank you, Sebastian