Hello all,
I have a Duro inertial and I am trying to get the orientation data (
MSG ORIENT QUAT) in ROS using
this ROS driver. According to the Swiftnav manual
''This message reports the quaternion vector describing the vehicle body frame’s orientation with respect to a local-level NED frame. The components of the vector should sum to a unit vector assuming that the LSB of each component as a value of 2ˆ-31"
Since I get
the quaternion in NED frame and I have to use this orientation in ROS, I
had to convert to ENU frame, which I did by swapping x and y values and
negating the z value, while keeping the w same. The way I am getting the orientation data is the following :
def cb_sbp_orientation(self,msg_raw,**metadata):
msg = MsgOrientQuat(msg_raw)
imu_msg = Imu()
imu_msg.header.frame_id = 'imu_link'
imu_msg.orientation.w = msg.w *(2**-31)
imu_msg.orientation.x = msg.y *(2**-31) imu_msg.orientation.y = msg.x *(2*1)
imu_msg.orientation.z = -msg.z *(2**-31)
Now this is where I start to run into issues :
1. Even after converting from NED frame to ENU frame, there seems to an offset in the ENU frame i.e. when my robot is facing north, its x axis (small red) must be aligned with the ROS north (long green)
The output from a different IMU which has ENU frame is like this :
Ideally, the output from my Duro inertial should be this like this.
2. There seems to be a drift, although gradual, around the z axis.
Is there anything I am doing incorrectly? Did I misunderstand the following :
" The components of the vector should sum to a unit vector assuming that the LSB of each component as a value of 2ˆ-31" ?
Any help is appreciated