-
-
Notifications
You must be signed in to change notification settings - Fork 178
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
Spine Yaw Compensation to keep spine trackers from drifting #1243
base: main
Are you sure you want to change the base?
Conversation
8cb2d68
to
99c15ec
Compare
Please rebase SolarXR, it was merged. |
I think this can be enabled for legs too since it only works when standing up! Ideally, the setting would be part of Drift compensation setting that's now with 3 selectors: Off, Static/Simple (Old one), Dynamic/Advanced (this one). Then for this to have a setting of compensation speed, maybe a slider in 0.05deg/min intervals, and a selector for which parts to apply it: Upper body, Legs, Arms, Feet. There also needs to be an infomation that Dynamic only works with HMD and Static can work without it. But this can be merged after review already, and settings can be added in the future. Very excited to RC this! |
99c15ec
to
4d632d3
Compare
@Eirenliel thanks taking a look! Definitely can look into putting this into the drift compensation setting later. (Or do you think I should just update it now?) If this works well, I was going to add alignment between upper leg and lower leg. Maybe even foot? But I'm not sure if upper leg can be aligned to the spine. For example, when I stand straight, I notice that my legs are twisted slightly away from my body. I was thinking maybe "balancing" the left and right legs so that they're at the same angle away from the spine... |
Upper and lower leg should have the same yaw, so they're already averaged.
It shouldn't matter if you reset the same way too. Also since it's a setting people can turn it off if it doesn't work for them and we can improve it in the future.
If you want, we're not merging util Monday anyway. Also pelase fix build errors (lint) |
This needs to be Beta'd before it can be merged. |
@Eirenliel How do I get the build system to rebuild, and how does the beta process work? Sorry, it's my first PR. Thanks! |
Since you're a first-time contributor, someone else needs to add their approval for the CI to run. |
Sigh oops I didn't realize there was a Java linter too |
For Beta you need to create a post in beta-testing-forum on Discord! If you can't, ask some contributors |
server/core/src/main/java/dev/slimevr/config/YawCorrectionConfig.kt
Outdated
Show resolved
Hide resolved
server/core/src/main/java/dev/slimevr/tracking/processor/skeleton/HumanSkeleton.kt
Outdated
Show resolved
Hide resolved
server/core/src/main/java/dev/slimevr/tracking/processor/skeleton/HumanSkeleton.kt
Outdated
Show resolved
Hide resolved
server/core/src/main/java/dev/slimevr/tracking/processor/skeleton/HumanSkeleton.kt
Outdated
Show resolved
Hide resolved
server/core/src/main/java/dev/slimevr/tracking/processor/skeleton/HumanSkeleton.kt
Outdated
Show resolved
Hide resolved
server/core/src/main/java/dev/slimevr/tracking/processor/skeleton/HumanSkeleton.kt
Outdated
Show resolved
Hide resolved
server/core/src/main/java/dev/slimevr/tracking/trackers/Tracker.kt
Outdated
Show resolved
Hide resolved
@ButterscotchV , I remember you said I should move the |
Probably should go there, yeah. The definitions of these things are kinda mangle together, but most of the drift corrective type stuff is around there. |
I realized in SolarXR I named it |
ec55b86
to
7f7da7e
Compare
Additional changes:
|
Freshly tested:
|
server/core/src/main/java/dev/slimevr/tracking/processor/skeleton/SpineYawCorrection.kt
Outdated
Show resolved
Hide resolved
c4d131b
to
69ac737
Compare
@Erimelowo , could you take another look? Thanks! @Eirenliel, it looks like the general sentiment of the beta is positive. Most people have been testing v2 and v3, which is a more sophisticated version of this change. Would it be reasonable to merge this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested with the recommended changes and it seems to work as intended. I had weird results from AutoBone, but I still don't really know whether it's this PR causing it.
} | ||
|
||
private fun updateTrackers(trackers: List<Tracker>) { | ||
for ((parentTracker, tracker) in trackers.zipWithNext()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zipWithNext()
initializes a list every time it's called, this should probably just be moved into the initialization of upperBodyTrackers
.
} | ||
|
||
companion object { | ||
private fun filterImuTrackers(vararg trackers: Tracker?): List<Tracker> = trackers.filterNotNull().filter { it.isImu() }.toList() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-IMU trackers should not be filtered, they should be used for reference but not adjusted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, this probably shouldn't filter null trackers either? I'm not sure you would want to correct a hip tracker with the head tracker when every other tracker is missing. If this is intended behaviour then that is fine.
const degreeFormat = new Intl.NumberFormat(currentLocales, { | ||
style: 'unit', | ||
unit: 'degree', | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should maybe use our translation framework? Idk about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ImUrX Can I get your feedback on this 🐱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its fine, i discovered a better integrated way on Fluent recently but for now this is how we been doing it, and if its per second you can do degree-per-second
for the unit
<NumberSelector | ||
control={control} | ||
name="yawCorrectionSettings.amountInDegPerSec" | ||
valueLabelFormat={(value) => degreeFormat.format(value)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This label should say in degrees per second, not just degrees. It is confusing as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #1243 (comment)
Prevents the spine trackers from drifting, by nudging them to stay aligned to the headset.
Players are usually standing facing forwards or walking forwards, where the spine trackers are aligned to the yaw of the headset. However due to yaw drift, the spine trackers will eventually rotate to the side, requiring a reset. This feature adds a small centering rotation to compensate for the yaw drift. (For now, this compensation only activates when your trackers are pointing "up", e.g. when you're standing or sitting straight up.)
The correction amount should be approximately the maximum yaw drift of your gyroscope (0.3 degrees/sec is a good default).