0
$\begingroup$

Rosanswers logo

I'm trying to get position and orientation of the robot calculated by gmapping.
I used this question link text and tutorial link text as a reference.

I can get the robot position using tf::Transform::getOrigin() which is /map -> /base_link transform.
However the robot angle obtained from tf::Transform::getRotation()::getAngle() is only from 0 to π.
To determine the angle of the robot from 0 to 2π, What should I do?


Originally posted by s-kawakami on ROS Answers with karma: 1 on 2012-07-19

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Use tf::getYaw:

tf::getYaw(transform.getRotation());

Originally posted by Lorenz with karma: 22731 on 2012-07-19

This answer was ACCEPTED on the original site

Post score: 11

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.