RVIZ error - tf contained unnormalized quaternion
Hi all,
Hopefully this is a quick fix that I'm too tired to see. I have a node broadcasting a transformation from a global frame 'gps' to a local frame 'ant' from the information in an odometry message,
void localClass::baseCallback(const nav_msgs::Odometry::ConstPtr& msg) {
static tf::TransformBroadcaster br;
tf::Transform transformBase;
tf::Quaternion qBase;
qBase.setRPY(0,0,0);
transformBase.setOrigin(tf::Vector3(msg->pose.pose.position.x,msg->pose.pose.position.y,msg->pose.pose.position.z));
transformBase.setRotation(qBase);
br.sendTransform(tf::StampedTransform(transformBase, msg->header.stamp, "gps", "ant"));
The tfMessage looks like this,
---
transforms:
-
header:
seq: 0
stamp:
secs: 1502926197
nsecs: 819865990
frame_id: gps
child_frame_id: ant
transform:
translation:
x: 8.434
y: 115.857
z: 1.022
rotation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
---
However, RVIZ seems to have an issue with this super simple transformation. The error message is,
Message contained unnormalized quaternion (squares of values don't add to 1)
but a 0,0,0,1 quaternion is normalized.
I suspect that this is not a simple fix but I would appreciate any suggestions or recommendations.
Thanks.