-
Notifications
You must be signed in to change notification settings - Fork 53
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
Fix head rotation #140
base: master
Are you sure you want to change the base?
Fix head rotation #140
Conversation
I don't have access to any head trackers, so I can't check myself, but having to add 90 degrees to each of them looks like there's a bug somewhere. There's currently a bug regarding loudspeakers (with a fix in 4c66c88, which is part of #131), probably there is another bug (that I introduced) related to the head? Regarding the GUI stuff, I think you have to add the values of |
Thanks Matthias! |
Thanks for the update. If you use "rotation" + "rotation offset" for displaying the head, you should probably also use "position" + "position offset", right? The "rotation offset" has now an error of 90 degrees, both in the display of the head and of the symbols for loudspeaker-based renderers. Probably in the audio-rendering, too, but I didn't check this. I'm sorry for the mess with the orientations, I've been changing the orientations of the "new stuff" to be 90 degrees rotated from the "legacy stuff". ssr/src/legacy_orientation.cpp Lines 58 to 66 in 9bb8eec
This works for "absolute" rotations/orientations, but sadly this is wrong for "relative" rotations, as used in the "reference orientation offset". Therefore I had to compensate this for the API functions that affect the "reference orientation offset", which you are trying to remove again in this PR. I didn't check this for the trackers (because I don't have access to any trackers), that's why there are still bugs in the tracker code. I've just added 6731ea6 to #131, which should make it easier to test the "reference orientation" separate from the "reference orientation offset" (without needing a head tracker). I'm still waiting for a review of #131, but I hope I can merge it some time next week. Then it would be great if you could rebase this PR onto that. |
PS: If you like, you can try to extend the Razor tracker to 3D at some point, see: Line 69 in 9bb8eec
IIRC, it should be possible to get quaternions from the Razor device, which can be passed directly to |
PPS: I've added a visualization for the "reference offset" to my 3D-GUI prototype in 6b52014. |
@chris-hld I've merged #131, can you please rebase this PR onto |
d2d0016
to
736f232
Compare
Thanks Matthias! The web interface is great! |
Thanks for the update! When using a loudspeaker-based renderer with the Qt GUI, I see this problem:
I'm not sure if there is a clear argument for whether or not to manipulate the "offset", but at least both left and right button should affect the same thing, right? I think it makes slightly more sense to manipulate the "reference rotation" with the mouse, but I'm not sure. Please note that the "reference rotation offset" is a property of the renderer, while the "reference rotation" is a property of the scene. When using the binaural renderer with the Qt GUI, I see this problem:
I don't know if you want to fix this in this PR or not. If I'm not mistaken, the binaural renderer actually takes the "reference position offset" into account when rendering.
Yeah, sorry, me too. It is very confusing to have both ways at the same time. I hope the new system on its own is less confusing than the old system
Yes, and no. I replaced the "absolute" Now there is no "absolute" orientation of the reference, just a "relative" rotation based on its "original" orientation. The implicit "original" orientation of things is "looking north", which means "along the positive y-axis". In the old system, we always had to explicitly add 90 degrees at some point when setting up stuff. Now we don't, because the "original" orientation is implicit.
Yes, this is because of the automatic conversion from However, I think it makes more sense to compensate it directly before or after the conversion. Now you have I think it would be simpler to use _controller.take_control()->reference_rotation_offset(
Orientation(-_current_azimuth + _az_corr + 90)) Once the trackers are upgraded to 3D (and to using quaternions), the conversion to I'm not sure if that would actually work, though. I didn't test it. |
In the meantime, there have been several changes (a.k.a. "fixes") to the GUI. The binaural GUI can now distinguish between "reference position/rotation" and "reference offset position/rotation", just as the loudspeaker GUI already did before. Dragging with the mouse now consistently affects only the "reference position/rotation", while the head trackers only affect "reference offset rotation". Furthermore, the Polhemus tracker code has been extended to support 3D rotations. A 90 degree rotation has been added there to compensate for the fact that the tracker is typically mounted sideways. If it would be mounted "correctly" (which would be a hassle), the 90 degree rotation would not be necessary. I think the only thing from this PR that has not yet been addressed are the Razor and VRPN trackers. Do they work correctly now? Either way, it would be very nice to extend both of them to 3D. Both already provide 3D rotations, so this should be easy to implement. The only problem is that whoever implements it needs access to the actual trackers in order to find out what their conventions are and what compensation is necessary. I don't have access to any tracker, but I can assist via video call. It can be tricky to get 3D rotations right ... @chris-hld, @JensAhrens: Do you currently have access to Razor or VRPN trackers? |
I have just realized that #146 is already trying to fix VRPN trackers, so we can continue the discussion there. |
This fixes #135
and also corrects the reference angle when using head trackers.
Calibrating the head tracker was turning the head to [1, 0, 0], e.g. to the right.