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 JoypadControlServer to run single thread #3101

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

S-Dafarra
Copy link
Contributor

I developed a device that can emulate a joypad using a GUI (https://github.com/ami-iit/yarp-device-keyboard-joypad). Since on macOS the GUIs can be opened only from the main thread, I needed to allow the possibility of avoiding running the JoypadControlServer in a single threaded mode.

In order to do so, I had to implement the IService interface on both JoypadControlServer and DeviceBundler. This PR also includes the modifications of #3100

cc @randaz81 @traversaro @Nicogene

…the service interface

Apparently, when the signal handler was setting the static flag "terminated" to false, it was also attempting
to close immediately the terminator port, but this was receiving the termination message and some race condition
seemed to occur on Windows
traversaro
traversaro previously approved these changes Apr 8, 2024
@randaz81
Copy link
Member

randaz81 commented Apr 8, 2024

@S-Dafarra yarp already has a GUI with keybpord support to control the 2D direction of a robot: yarpmobilebasegui.
Can you attach a screenshot and maybe highlight the differences?

Copy link

sonarqubecloud bot commented Apr 8, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
22.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@S-Dafarra
Copy link
Contributor Author

@S-Dafarra yarp already has a GUI with keybpord support to control the 2D direction of a robot: yarpmobilebasegui. Can you attach a screenshot and maybe highlight the differences?

See ami-iit/yarp-device-keyboard-joypad#3 (comment)

I was not really aware of yarpmobilebasegui. I needed a drop in replacement for the SDLJoypad with a good degree of customization on the axis and buttons order

@randaz81
Copy link
Member

randaz81 commented Apr 8, 2024

The main problem here is that yarp::dev::IService was marked in my notes: "critically flawed, to be deprecated". However, I currently do not remember the exact reason. Please allow me some time to think about this.

Copy link
Member

@randaz81 randaz81 left a comment

Choose a reason for hiding this comment

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

on hold

@S-Dafarra
Copy link
Contributor Author

I realized that in the single thread case I was not updating the variable with the last run time. Fixed with b060a6e

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
22.7% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

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.

3 participants