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

Adding the ability to offset the reference from the target device pose. #37

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

sidequestlegend
Copy link

@sidequestlegend sidequestlegend commented Nov 13, 2020

This is not tested or complete yet, please don't merge this!

I have added a new UI button that allows you to enable "reference calibration" which is where it uses the target pose to update the tracking space translation/rotation. The hope is that I can use the grip on the target controller to achieve this but for now this is using a UI button to toggle the reference tracking. It is intended to save the pose when you enable reference tracking and then set the tracking position to be the delta from that until disabled, or until the grip is released when I implement that bit.

@sidequestlegend
Copy link
Author

An update on this, I have the edit screen showing the button to enable the reference calibration, and clicking it will start updating the calibration values and in turn the ui input fields. I'm aware of the fact that i'm using the incorrect values to the start offset position/rotation so i need to fix that, i had attempted to do so but it stopped updating the calibrated values then. This still needs work but its a good start.

…ip event somehow and how to rotate. I figure it could work with rotation offset, but it needs to rotate the tracking space wth a different origin, the position of the reference controller essentially
@sidequestlegend
Copy link
Author

sidequestlegend commented Nov 14, 2020

Another update on this, I got the translation working so it is now possible to grip using the reference controller to be able to drag the target tracking space around. I have not completed the rotation offset since I think it need to rotate the target tracking space around the origin point of the reference controller relative position in the target tracking space, either that or around the position of the target controller position already in the target tracking space.

The grip detection is working but it only works when the dashboard overlay is closed. Im using

vr::VRSystem()->PollNextEvent(pEvent, sizeof(vr::VREvent_t));

to grab the controller buttonpress events, but that doesn't work when the overlay is open. From what I can see you need to use

vr::VROverlay()->PollNextOverlayEvent(ulOverlayHandle, pEvent, sizeof(vr::VREvent_t));

when inside the dashboard overlay but that does not seem to fire events for the grip or other buttons. My assumption on how this works comes from this example found in the code of the OpenVR Advanced Settings:

bool OverlayController::pollNextEvent(vr::VROverlayHandle_t ulOverlayHandle, vr::VREvent_t* pEvent) {
	if (isDesktopMode()) {
		return vr::VRSystem()->PollNextEvent(pEvent, sizeof(vr::VREvent_t));
	} else {
		return vr::VROverlay()->PollNextOverlayEvent(ulOverlayHandle, pEvent, sizeof(vr::VREvent_t));
	}
}

https://github.com/matzman666/OpenVR-AdvancedSettings/blob/e57a4880dfdd7b7d5643e842e0ccca82ba076acd/src/overlaycontroller.cpp#L323-L329

This might be workable but maybe there is a better solution to be able to access the controller buttons inside the overlay.

TL;DR; Translation is working on the reference controller, rotation needs more thought. The grip interaction works to grab the space but only when the dashboard overlay is not open. My current workflow is to open the overlay, click edit calibration and then close the overlay again so i can grab/move the target tracking space.

I really need some input at this stage from someone who knows more about this. @pushrax could we chat on discord sometime about the best way forward? I'm Shane from SideQuest#7777

@sidequestlegend
Copy link
Author

On the suggestion from Ykeara:
You can force close and open the dasbhoard via the API if that suits your use-case.

This could be useful for starting the fine adjust from the dashboard and auto closing the dashboard, or maybe having a button to close the dashboard

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

Successfully merging this pull request may close these issues.

2 participants