-
Notifications
You must be signed in to change notification settings - Fork 2
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
Added first basic version. #1
Conversation
It simply prints the screen half green and half blue. Added configuration phase and first set of methods of the OpenXr interface. Finished preparation phase. Finished the rendering and closing part of OpenXr. Initial debug. Finished first skeleton. Cleanup before PR.
I just force pushed to remove some commented code. |
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.
Minor comment.
In general, the idea is to have a separate repo from https://github.com/robotology/yarp-device-ovrheadset and eventually copy parts that may be useful? |
Yes. I will try to port most of the structure. On the other hand, some options will be probably different. For example, as mentioned above, I am thinking to not open any window. Hence, I need to figure out another way to adjust the views. Unfortunately, almost all the code in https://github.com/robotology/yarp-device-ovrheadset is entangled with Oculus-specific calls, so I did not have much of a choice. Also, considering that we are not the sole users of that device I was a bit afraid of introducing too many modifications. |
Let me know if you are ok with me (squash) merging! |
Ok for me. |
@S-Dafarra If you do not have any rush for merging, I would like to review the code next week. Let me know if it is OK to you. |
Ok, I guess can wait. In any case, this is just the first PR with the CMake structure and a first use of OpenXr. It is pretty useless per-se. I will probably open other PRs in a couple of days or so 😉 |
That's exactly why I want to review it also :') otherwise, for the future PRs, I am lost with the codes! So, I can incrementally follow this. |
CMakeLists.txt
Outdated
find_package(YCM REQUIRED) | ||
find_package(YARP 3.4 COMPONENTS os sig dev math REQUIRED) | ||
find_package(Threads REQUIRED) | ||
find_package(OpenXR REQUIRED) |
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.
Minor: Tracking the exact driver version used, along with some reference to an issue that points to the driver installation will be helpful
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.
Done in 34fd50d. The installation instructions will be added in a README when most of the functionalities are there. In the meanwhile, most of the installation instructions are the following
# Install monado packages with monado ppa ( https://monado.freedesktop.org/packages-ubuntu.html )
sudo add-apt-repository ppa:monado-xr/monado
sudo apt-get update
sudo apt install libopenxr1-monado build-essential meson libvulkan-dev libopenxr-dev libvulkan1 libopenxr-loader1 xxd libglm-dev glslang-tools libglfw3-dev
Then, in separate terminals run the yarpserver
and monado-service
. Clone, compile and install this repo. Then, launch yarpdev --device openxrheadset
from the install/share/yarp
folder.
Let me know if I missed something.
} | ||
|
||
// the instance handle can be thought of as the basic connection to the OpenXR runtime | ||
XrInstance instance = XR_NULL_HANDLE; |
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.
Minor: Adding a space between lines here will be easy for readability
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 am continuosly refactoring this file. This will be done in future releases. For example, see https://github.com/dic-iit/yarp-device-openxrheadset/blob/4ff81d4b1f956ea3ed1632219c8bfa1d44bee4ab/src/devices/openxrheadset/impl/OpenXrInterfaceImpl.h#L149-L263
char resultString[XR_MAX_RESULT_STRING_SIZE]; | ||
xrResultToString(instance, result, resultString); | ||
|
||
char formatRes[XR_MAX_RESULT_STRING_SIZE + 1024]; |
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.
Is the value 1024
just a place holder for testing or something that can be moved to a config parameter ?
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.
It cannot be retrieved from conf file because it has to be static. It is just a buffer for printing errors.
|
||
|
||
uint32_t output_viewCount = m_pimpl->views.size(); | ||
XrResult result = xrLocateViews(m_pimpl->session, &view_locate_info, &(m_pimpl->view_state), m_pimpl->views.size(), &output_viewCount, m_pimpl->views.data()); |
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.
Minor: Line length to be reduced
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.
Done in 34fd50d.
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.
@S-Dafarra I added some minor comment, feel free to ignore them.
LGTM, just that adding OpenXR driver related reference such a version used can be useful going further. Thanks!
Thank you @S-Dafarra and sorry if it took some time to review it. |
No problem, thank you for rewieving. I am squashing and merging. |
It implements a first basic skeleton to use OpenXr. I was not able to shrink it much. It turns out that setting up OpenXr requires quite a bit of code. In order to implement the first version I strongly used the following examples:
For the moment, it opens a window and draws the left part to green and the right to blue
I realized that the window is indeed useless. Differently from the Oculus SDK there is no way to mirror what the operator sees. It would be possible to see the layers, but not the composite frame. Nonetheless, this is not much of a deal as the runtimes already provide similar functionality:
Hence, I will probably remove the window in future PRs.