# quaternion from IMU interpreted incorrectly by ROS

I have a new CH Robotics UM6 IMU that outputs Quaternion which the datasheet labels as [a,b,c,d]. When I pass the Quaternion to ROS the X and Z axes are swapped, also pointing the IMU *UP* points the quat *DOWN* in rviz. I thought Quaternions didn't have "handedness"?

Here is a video of the behavior.

Anyhow, how do I swap axes without converting to Euler angles and introducing singularities?

From the datasheet:

All UM6 angle measurements are made with respect to a North-East-Down (NED) inertial frame. The inertial frame x-axis is aligned with magnetic north, the y-axis is aligned with magnetic east, and the z-axis points down toward the center of the Earth. The "pitch" angle represents positive rotation about the x-axis, "roll" represents positive rotation about the y-axis, and "yaw" represents positive rotation about the z-axis.rotation about the z-axis.

PS I'm using python so numpy code would be great!