Is TF2 setRPY(0, 0, th) the same as tf::createQuaternionMsgFromYaw(th)
Good Day all,
I am trying writing an odometry script and am I using TF2 vs TF. My question is in my TF version I used tf::createQuaternionMsgFromYaw(th) to get the odom transform Quaternion for my rotation and pose oretientation. Now that I am using TF2 will this "tf2::Quaternion odomquat;" followed by "odomquat.setRPY(0, 0, th);" give the same result ? Please advise.
Basically is
tf::createQuaternionMsgFromYaw(th)
geometry_msgs::TransformStamped odom_trans
geometry_msgs::Quaternion odom_quat
odom_trans.transform.rotation = odom_quat
The same as :
tf2::Quaternion odomquat;
odomquat.setRPY(0, 0, th)
odom_trans.transform.rotation.x = odomquat.x();
odom_trans.transform.rotation.y = odomquat.y();
odom_trans.transform.rotation.z = odomquat.z();
odom_trans.transform.rotation.w = odomquat.w();
Or are they different and I am taking the wrong approach?