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

Allow visualizing layers from yarp ports #2

Merged
merged 4 commits into from
May 19, 2021
Merged

Allow visualizing layers from yarp ports #2

merged 4 commits into from
May 19, 2021

Conversation

S-Dafarra
Copy link
Member

This PR allows visualizing 2D images on the HMD reading from yarp ports.

In principle, it allows visualizing the robot cameras and to visualize other infos like the virtual robot (also considering the transparencies)

It is based on the firstVersion branch and needs #1 to be merged first. This is just to start the review process

Example of output
image

(Notice that the small robot on the bottom has no background)

#include <GL/gl.h>
#include <GL/glext.h>

#if defined(__APPLE__)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Using || for the macro check https://gcc.gnu.org/onlinedocs/gcc-9.2.0/cpp/Defined.html

Copy link
Member Author

@S-Dafarra S-Dafarra May 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just edited that file bringing back the setup for glfw that requires the three distinct cases.

@S-Dafarra
Copy link
Member Author

With 41299ba I avoid creating an additional window and I paint the background black.

S-Dafarra added 4 commits May 17, 2021 10:27
Added method to add head-fixed quad layer to the OpenXr interface.

First working result displaying yarp images on the eyes.

Avoid the use of manual flipping.

Fixing the aspect ratio according to the input image.

Avoid to use callback to read image.

Using alpha channel when the input type is RGBA.

Added possibility to get layer quaternion and position.

Added separate setters for quad position and orientation.

Fixed binding of textures.

The port is now a shared pointer.
Moved GLFW include where needed.

Removed duplicated macro

Cleanup before PR.
@S-Dafarra S-Dafarra changed the base branch from firstVersion to main May 17, 2021 08:32
@S-Dafarra
Copy link
Member Author

This PR is now ready to be merged @traversaro @Yeshasvitvs @kouroshD. Let me know if you are ok with that.

@traversaro
Copy link
Contributor

This PR is now ready to be merged @traversaro @Yeshasvitvs @kouroshD. Let me know if you are ok with that.

Ok!

@kouroshD
Copy link

I will review the PR today if it is OK for you.
Thanks

@S-Dafarra
Copy link
Member Author

I will review the PR today if it is OK for you.
Thanks

Sure, thanks!

@kouroshD
Copy link

@S-Dafarra is there any configuration file that we should check? Since, in this PR I cannot find any, but in the code we are checking/reading values of the config file and setting the parameters.

@S-Dafarra
Copy link
Member Author

S-Dafarra commented May 17, 2021

@S-Dafarra is there any configuration file that we should check? Since, in this PR I cannot find any, but in the code we are checking/reading values of the config file and setting the parameters.

No there are none. Configuration parameters can be passed as command line arguments with the -- prefix. See for example https://github.com/robotology/walking-teleoperation/blob/master/app/scripts/xprizeDemoVirtualizerXsensGlove.xml#L61

@kouroshD
Copy link

@S-Dafarra is there any configuration file that we should check? Since, in this PR I cannot find any, but in the code we are checking/reading values of the config file and setting the parameters.

No there are none. Configuration parameters can be passed as command line arguments with the -- prefix. See for example https://github.com/robotology/walking-teleoperation/blob/master/app/scripts/xprizeDemoVirtualizerXsensGlove.xml#L61

So, can you write down here the parameters to pass to yarpdev.

@S-Dafarra
Copy link
Member Author

S-Dafarra commented May 17, 2021

@S-Dafarra is there any configuration file that we should check? Since, in this PR I cannot find any, but in the code we are checking/reading values of the config file and setting the parameters.

No there are none. Configuration parameters can be passed as command line arguments with the -- prefix. See for example https://github.com/robotology/walking-teleoperation/blob/master/app/scripts/xprizeDemoVirtualizerXsensGlove.xml#L61

So, can you write down here the parameters to pass to yarpdev.

I usually prefer to add a README when I reach a stable version. Is that ok? If you want, you can try it with

yarpdev --device openxrheadset --gui_elements 1 --GUI_0::width 0.15 --GUI_0::height 0.15 --GUI_0::x 0.2 --GUI_0::y -0.2 --GUI_0::z -0.5

@kouroshD
Copy link

@S-Dafarra is there any configuration file that we should check? Since, in this PR I cannot find any, but in the code we are checking/reading values of the config file and setting the parameters.

No there are none. Configuration parameters can be passed as command line arguments with the -- prefix. See for example https://github.com/robotology/walking-teleoperation/blob/master/app/scripts/xprizeDemoVirtualizerXsensGlove.xml#L61

So, can you write down here the parameters to pass to yarpdev.

I usually prefer to add a README when I reach a stable version. Is that ok? If you want, you can try it with

yarpdev --device openxrheadset --gui_elements 1 --GUI_0::width 0.15 --GUI_0::height 0.15 --GUI_0::x 0.2 --GUI_0::y -0.2 --GUI_0::z -0.5

yes, thank you.

@S-Dafarra
Copy link
Member Author

Thank you all! Merging

@S-Dafarra S-Dafarra merged commit 117721a into main May 19, 2021
@S-Dafarra S-Dafarra deleted the eyesConnection branch May 24, 2021 09:42
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.

4 participants