8 tf::quaternionMsgToTF(pose.orientation, tf_q);
9 Eigen::Vector3d t(pose.position.x, pose.position.y, pose.position.z);
10 Eigen::Quaternion<double> q(tf_q.getW(), tf_q.getX(), tf_q.getY(), tf_q.getZ());
12 T.block<3, 3>(0, 0) = q.matrix();
13 T.block<3, 1>(0, 3) = t;
20void odomMsgToEigen(
const nav_msgs::Odometry& odomLidar, Eigen::Matrix4d& T) {
22 tf::quaternionMsgToTF(odomLidar.pose.pose.orientation, tf_q);
23 Eigen::Vector3d t(odomLidar.pose.pose.position.x, odomLidar.pose.pose.position.y, odomLidar.pose.pose.position.z);
24 Eigen::Quaternion<double> q(tf_q.getW(), tf_q.getX(), tf_q.getY(), tf_q.getZ());
26 T.block<3, 3>(0, 0) = q.matrix();
27 T.block<3, 1>(0, 3) = t;
30void odomMsgToTf(
const nav_msgs::Odometry& odomLidar, tf::Transform& T) {
32 tf::quaternionMsgToTF(odomLidar.pose.pose.orientation, tf_q);
33 tf::Vector3 tf_t(odomLidar.pose.pose.position.x, odomLidar.pose.pose.position.y, odomLidar.pose.pose.position.z);
34 T = tf::Transform(tf_q, tf_t);
38 Eigen::Quaterniond q(R);
40 tf_R.setRotation(tf::Quaternion(q.x(), q.y(), q.z(), q.w()));
41 tf_R.setOrigin(tf::Vector3(0.0, 0.0, 0.0));
46 Eigen::Quaterniond q(T.block<3, 3>(0, 0));
48 tf_T.setRotation(tf::Quaternion(q.x(), q.y(), q.z(), q.w()));
49 tf_T.setOrigin(tf::Vector3(T(0, 3), T(1, 3), T(2, 3)));
54 Eigen::Quaterniond q(T.rotation());
56 tf_T.setRotation(tf::Quaternion(q.x(), q.y(), q.z(), q.w()));
57 tf_T.setOrigin(tf::Vector3(T(0, 3), T(1, 3), T(2, 3)));
61void tfToMatrix4(
const tf::Transform& tf_T, Eigen::Matrix4d& T) {
62 tf::Quaternion tf_q = tf_T.getRotation();
63 Eigen::Quaternion<double> q(tf_q.getW(), tf_q.getX(), tf_q.getY(), tf_q.getZ());
64 Eigen::Vector3d t(tf_T.getOrigin().getX(), tf_T.getOrigin().getY(), tf_T.getOrigin().getZ());
66 T.block<3, 3>(0, 0) = q.matrix();
67 T.block<3, 1>(0, 3) = t;
71 tf::Quaternion tf_q = tf_T.getRotation();
72 Eigen::Quaternion<double> q(tf_q.getW(), tf_q.getX(), tf_q.getY(), tf_q.getZ());
73 Eigen::Vector3d t(tf_T.getOrigin().getX(), tf_T.getOrigin().getY(), tf_T.getOrigin().getZ());
80 Eigen::Quaterniond q(T);
82 tf_T.setRotation(tf::Quaternion(q.x(), q.y(), q.z(), q.w()));
83 tf_T.setOrigin(tf::Vector3(T(0, 3), T(1, 3), T(2, 3)));
tf::Transform pose3ToTf(const Eigen::Matrix3d &T)
tf::Transform isometry3ToTf(const Eigen::Isometry3d &T)
void odomMsgToEigen(const nav_msgs::Odometry &odomLidar, Eigen::Matrix4d &T)
void geometryPoseToEigen(const geometry_msgs::Pose &pose, Eigen::Matrix4d &T)
void odomMsgToTf(const nav_msgs::Odometry &odomLidar, tf::Transform &T)
tf::Transform matrix3ToTf(const Eigen::Matrix3d &R)
void tfToMatrix4(const tf::Transform &tf_T, Eigen::Matrix4d &T)
void tfToIsometry3(const tf::Transform &tf_T, Eigen::Isometry3d &T)
tf::Transform matrix4ToTf(const Eigen::Matrix4d &T)