# quaternion filter

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.

Thanks

edit retag close merge delete

1

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

( 2015-03-17 06:57:18 -0600 )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.

( 2015-03-17 07:33:18 -0600 )edit

Yea.. I have just noticed.. thanks.

( 2015-03-17 07:51:10 -0600 )edit

Sort by ยป oldest newest most voted

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);
}

more

1

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.

( 2015-03-17 09:35:43 -0600 )edit