问题
运行程序出现:
Error: TF_DENORMALIZED_QUATERNION: Ignoring transform for
child_frame_id “odom” from authority “unknown_publisher” because of an
invalid quaternion in the transform (0.0 0.0 0.0 0.707)
主要是四元数没有归一化
Eigen::Quaternionf qq(this->extrinsics.baselink2lidar.R);
transformStamped.transform.rotation.w = qq.w();
transformStamped.transform.rotation.x = qq.x();
transformStamped.transform.rotation.y = qq.y();
transformStamped.transform.rotation.z = qq.z();
解决方法
将上述四元素qq归一化
Eigen::Quaternionf qq(this->extrinsics.baselink2lidar.R);
qq.normalize();
transformStamped.transform.rotation.w = qq.w();
transformStamped.transform.rotation.x = qq.x();
transformStamped.transform.rotation.y = qq.y();
transformStamped.transform.rotation.z = qq.z();