Why does a marker still have roll, pitch and yaw when using tf::createQuaternionMsgFromYaw?
Hello,
From a downloaded project I have access to a marker in rviz which is defined by position and orientation(quaternion). However, I would like to create a marker at the same position and with only the yaw as orientation. This means that roll and pitch should be zero and even though the original marker were to have roll and pitch, the second marker should only rotate when there is a variation in yaw. In this way the marker I create should only move on a 2D plane. I used the following function to create the quaternion for my marker: q = tf::createQuaternionMsgFromYaw(yaw); where q is a geometry_msgs::qauternion. Then I pass q.x, q.y, q.z and q.w to my marker.
tf::Matrix3x3(transform.getRotation()).getRPY(pitch, yaw, roll);
geometry_msgs::Quaternion q;
q = tf::createQuaternionMsgFromYaw(yaw);
oPose_msg.orientation.x = q.x;
oPose_msg.orientation.y = q.y;
oPose_msg.orientation.z = q.z;
oPose_msg.orientation.w = q.w;
However when observing in Rviz my marker still tilts in roll and pitch as the original marker does. Why is this and what could I change to achieve the output I desire?
Note: I obtain roll, pitch and yaw from a rotation matrix. These are in this order to be consistent with the designated angles. I have the same problem when using q = tf::createQuaternionMsgFromRollPitchYaw(0.0,yaw,0.0); instead of q = tf::createQuaternionMsgFromYaw(yaw);