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

Revision history [back]

tf::Transform has methods for obtaining rotations like getRotation().

Though, you can multiply Transforms directly to have angular and linear transformations. No need to separate them.

tf::Transform has methods for obtaining rotations like getRotation().

Though, you can multiply Transforms directly to have angular and linear transformations. No need to separate them.

Edit:

I'm not sure if I get you correct but you can transform your laser scan to map using TF like this;

tf::StampedTransform transform;
ros::Time t = ros::Time(0);
tf_->waitForTransform("map", "laser", t, ros::Duration(1.0));
tf_->lookupTransform("map", "laser", t, transform);

then, you can get x, y and theta like;

double x = transform.getOrigin().getX();
double y = transform.getOrigin().getY();
double th = tf::getYaw(transform.getRotation());

Is this what you ask for?