ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Equivalent of checking quaternion is valid in tf2

asked 2021-09-18 22:59:49 -0500

jn42 gravatar image

updated 2021-09-20 10:01:56 -0500

Mike Scheutzow gravatar image

Is there an equivalent function to assertQuaternionValid()in tf2? I suppose I could just re-implement the source code for the function using tf2 equivalents?

edit retag flag offensive close merge delete


There is a thread that may be interesting to you:

osilva gravatar image osilva  ( 2021-09-19 04:51:00 -0500 )edit

I'm having trouble understanding this idea that a calculation should be refused because the quaternion is slightly un-normalized. It seems reasonable to log a warning if you think that characteristic is important, but by my thinking you should proceed with the calculation anyway.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-09-19 07:55:32 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2021-09-20 00:18:06 -0500

tfoote gravatar image

In general with tf2 it's recommended to use a native linear math library which has an internal representation of the quaternion and as such should have logic for normalizing and checking the normalization of the quaternion. The API of tf2 is specifically scoped down to be specific to the buffer etc and not random linear math problem.

Re: why normalized. @Mike Scheutzow the reason to rejecting storing non-normalized quaterions into the storage is because they can effect future computations in ways that are untraceable to users. You can find more info at

edit flag offensive delete link more


Ah ok the separation of concerns makes sense for why tf2 didn't port over an equivalent function. Thank you!

jn42 gravatar image jn42  ( 2021-09-20 08:04:44 -0500 )edit

@tfoote Thank you for the interesting link. I learned some new things about quaternions.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-09-20 09:58:44 -0500 )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

1 follower


Asked: 2021-09-18 22:59:01 -0500

Seen: 188 times

Last updated: Sep 20 '21