ros-drivers / mocap_optitrack

ROS nodes for working with the NaturalPoint Optitrack motion capture setup
99 stars 141 forks source link

Improper quaternion transformation when swapping y & z axes #4

Closed anuppari closed 3 years ago

anuppari commented 10 years ago

Lines 28-31 in mocap_datapackets.cpp incorrectly transform the quaternion. In order to swap the y & z axes, it should be something like this:

factor = sqrt(2)/2; //quaternion for swapping y & z axes is [w,x,y,z]=[sqrt(2)/2,sqrt(2)/2,0,0]

ros_pose.orientation.x = factor*(pose.orientation.x+pose.orientation.w); ros_pose.orientation.y = factor*(pose.orientation.y-pose.orientation.z); ros_pose.orientation.z = factor*(pose.orientation.z+pose.orientation.y); ros_pose.orientation.w = factor*(pose.orientation.w-pose.orientation.x);

tonybaltovski commented 3 years ago

Closing due to inactivity. Please feel free to re-open if issue persists.