laboshinl / loam_velodyne

Laser Odometry and Mapping (Loam) is a realtime method for state estimation and mapping using a 3D lidar.
http://wiki.ros.org/loam_velodyne
Other
1.71k stars 952 forks source link

Before publish calculated TF, what is done for rotation? #145

Open narutojxl opened 5 years ago

narutojxl commented 5 years ago

Hi, everyone! Before publish calculated TF, author changes rotation as follows Link is here.

geometry_msgs::Quaternion geoQuat = tf::createQuaternionMsgFromRollPitchYaw(transformSum().rot_z.rad(), -transformSum().rot_x.rad(), -transformSum().rot_y.rad()); _laserOdometryMsg.pose.pose.orientation.x = -geoQuat.y; _laserOdometryMsg.pose.pose.orientation.y = -geoQuat.z; _laserOdometryMsg.pose.pose.orientation.z = geoQuat.x; _laserOdometryMsg.pose.pose.orientation.w = geoQuat.w;

I calculate the following rotation as follows to see the difference between the above one.

geometry_msgs::Quaternion geoQuat = tf::createQuaternionMsgFromRollPitchYaw(transformSum().rot_z.rad(), transformSum().rot_x.rad(), transformSum().rot_y.rad()); _laserOdometryMsg.pose.pose.orientation.x = geoQuat.x; _laserOdometryMsg.pose.pose.orientation.y = geoQuat.y; _laserOdometryMsg.pose.pose.orientation.z = geoQuat.z; _laserOdometryMsg.pose.pose.orientation.w = geoQuat.w;

The result is: the difference TF between them is not a statis TF, does somebody know the reason? BTW, which one is the laser frame(X-left, Y-up, Z-front in loam) 's pose in camera_init frame, or they both not? Thanks in advance.