Ask Your Question

quaternion filter

asked 2015-03-17 05:22:44 -0500

gpldecha gravatar image

updated 2015-03-17 05:24:36 -0500

I am currently using optitrack to track a rigid body which has both position and orientation. I have the position and orientation of my rigid object published in a ros topic, all is good there.

What I would want is a filter for the orientation (at least) and position. The orientation is described in quaternions. A quick google search has shown that a kalman filter for this exists. In general I have found that optitrack can easily flip the orientation completely when the tracking of some of the markers is suboptimal. This is why I would need a filter.

Is there a ros pakage (solution) already out there,... before I go ahead and implement my own.


edit retag flag offensive close merge delete



I will implement : kalman filter, unless anybody has an alternative already done and tested piece of code for this.

gpldecha gravatar image gpldecha  ( 2015-03-17 06:57:18 -0500 )edit

The link you post filters orientation in Euler angles, so if I read it correctly, you might still experience discrete jumps in the orientation values. The Euler angle representation is subject to singularities, aka gimball lock.

Adolfo Rodriguez T gravatar image Adolfo Rodriguez T  ( 2015-03-17 07:33:18 -0500 )edit

Yea.. I have just noticed.. thanks.

gpldecha gravatar image gpldecha  ( 2015-03-17 07:51:10 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2015-03-17 08:52:53 -0500

gpldecha gravatar image

updated 2015-03-17 08:53:35 -0500

I have decided for now to use spherical linear interpolation (slerp) instead of a QKF. I just noticed the tf package of ros provides an implementation of slerp. I am note sure, as of yet the, what are the pros/cons of slerp vs QKF. One of the advantages of slerp is no doubt it's simplicity.

void update(){

tf_listener.lookupTransform(fixed_frame,target_frame_vision, ros::Time(0), tf_transform);

q1 = tf_transform.getRotation();
q0 = q0.slerp(q1,0.1);
edit flag offensive delete link more



I just want to note that a Kalman filter is an estimator, while slerp is an interpolator. Strictly speaking, they are not alternative solutions to the same problem.

Adolfo Rodriguez T gravatar image Adolfo Rodriguez T  ( 2015-03-17 09:35:43 -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: 2015-03-17 05:22:44 -0500

Seen: 506 times

Last updated: Mar 17 '15