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

Revision history [back]

If covariance is not important:

geometry_msgs::PoseWithCovariance poseWithCovarianceMsg;
tf::Transform transform;
transform.setRotation(tf::Quaternion(poseWithCovarianceMsg.pose.orientation.x,
                                     poseWithCovarianceMsg.pose.orientation.y,
                                     poseWithCovarianceMsg.pose.orientation.z,
                                     poseWithCovarianceMsg.pose.orientation.w));
transform.setOrigin(tf::Vector3(poseWithCovarianceMsg.pose.position.x,
                                poseWithCovarianceMsg.pose.position.y,
                                poseWithCovarianceMsg.pose.position.z));

geometry_msgs::Transform transformMsg;
tf::transformTFToMsg(transform, transformMsg);