Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combine Accela Filter with Hamilton Filter #1843

Merged
merged 4 commits into from May 14, 2024

Conversation

DaWelter
Copy link
Contributor

@DaWelter DaWelter commented May 8, 2024

As promised a while ago, here is a filter which combines the Accela gain curves with the rotation-space based filtering from the Hamilton filter. I hope it could maybe replace both the Accela and Hamilton filters.

Basically it applies the accela gain to the rotation vector magnitude of the shortest rotation between the current orientation and the measured orientation.

The position calculation is like in the Accela Filter.

I also included a smoothing amplification depending on the z-position. In my version I add to the smoothing amount. In the Hamilton Filter, I think the gain curve was modified which I wouldn't know how to do in the Accela way.

Maybe I could delete some of the disabled code for a spline GUI. Then again, it might be useful for tweaking those gain curves to those who know what they are doing :-D

@GO63-samara
Copy link
Contributor

Great job!
It would be useful to have the s.max_z point found automatically from the Mapping Z spline.
But I have no idea how to do this, maybe @sthalik can tell about this?

@sthalik
Copy link
Member

sthalik commented May 8, 2024

Try explicitly clamping the position value to be between 1e-3 and 1e3.

Should I come up with a QQuaternion replacement that uses double precision?

@DaWelter
Copy link
Contributor Author

DaWelter commented May 9, 2024

Try explicitly clamping the position value to be between 1e-3 and 1e3.

What? Where?

Should I come up with a QQuaternion replacement that uses double precision?

Nah. we can get way with float, I think. The mixing of float and double was awkward though. So I changed everything to float.

@sthalik
Copy link
Member

sthalik commented May 9, 2024

What? Where?

Wasn't z_max an attempt at getting an upper bound on input Z values? You can just clamp them to a conservative range and remove the user-visible option.

@DaWelter
Copy link
Contributor Author

DaWelter commented May 10, 2024

What? Where?

Wasn't z_max an attempt at getting an upper bound on input Z values? You can just clamp them to a conservative range and remove the user-visible option.

Hmm .... its the distance where the smoothing assumes the maximum value.
Poorly named I guess ...

We can take our time here until you could test the filter yourself.

@dbaarda
Copy link
Contributor

dbaarda commented May 13, 2024

I see I'm added as a reviewer on this. I'm super rusty on this code and probably not the right person to review this.

I had a glance... It looks OK to me, but I didn't look very closely.

@DaWelter DaWelter merged commit 9f4bc14 into opentrack:master May 14, 2024
3 checks passed
@DaWelter
Copy link
Contributor Author

@dbaarda Thanks for taking a look even if superficial. sthalik and GO63-samara are available for reviews after all.

So let's just merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants