ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I had to post this as an answer -
As per suggestion in this post. I modified the source code of the package (in reference to sample code in my post above) - Modified the following - btQuaternion q_orig(t.quat[0], t.quat[1], t.quat[2], t.quat[3]); to -
btQuaternion q_orig(t.quat[0], t.quat[1], -t.quat[2], t.quat[3]);
Also, I (as already mentioned) added the following to the code to get the RPY values.
Note Unlike what I mentioned in my Question above, the following code is added to if (fresh_data == true) loop inside int main() -
btQuaternion q(target_state->target.transform.rotation.x, target_state->target.transform.rotation.y, target_state->target.transform.rotation.z, target_state->target.transform.rotation.w);
double roll, pitch, yaw;
tf::Matrix3x3(q).getRPY(roll, pitch, yaw);
This is giving me the correct values as per the Optitrack Tracking Tools display.
Thanks everyone for their help!
2 | No.2 Revision |
I had to post this as an answer -
As per suggestion in this post. I modified the source code of the package (in reference to sample code in my post above) - Modified the following -
btQuaternion q_orig(t.quat[0], t.quat[1], t.quat[2], t.quat[3]);
to - btQuaternion q_orig(t.quat[0], t.quat[1], -t.quat[2], t.quat[3]);
Also, I (as already mentioned) added the following to the code to get the RPY values.
Note Unlike what I mentioned in my Question above, the following code is added to if (fresh_data == true) loop inside int main() -
btQuaternion q(target_state->target.transform.rotation.x, target_state->target.transform.rotation.y, target_state->target.transform.rotation.z, target_state->target.transform.rotation.w);
double roll, pitch, yaw;
tf::Matrix3x3(q).getRPY(roll, pitch, yaw);
This is giving me the correct values as per the Optitrack Tracking Tools display.
Thanks everyone for their help!