ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

RVIZ error - tf contained unnormalized quaternion

asked 2017-10-11 08:16:05 -0600

Tyrone Nowell gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2017-10-11 22:18:34 -0600

kmhallen gravatar image

Try running roswtf. It should print a message with the offending transform parent and child frame_id.
http://wiki.ros.org/roswtf
https://github.com/ros/geometry/blob/...

edit flag offensive delete link more

Comments

Thanks, roswtf helped. The problem seemed to be an issue with the 'tf' package. I reinstalled it and it came right.

Tyrone Nowell gravatar image Tyrone Nowell  ( 2017-10-26 06:17:14 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-10-11 08:16:05 -0600

Seen: 2,225 times

Last updated: Oct 11 '17