robotology / yarp

YARP - Yet Another Robot Platform
http://www.yarp.it
Other
529 stars 195 forks source link

Allow JoypadControlServer to run single thread #3101

Open S-Dafarra opened 7 months ago

S-Dafarra commented 7 months ago

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 https://github.com/robotology/yarp/pull/3100

cc @randaz81 @traversaro @Nicogene

randaz81 commented 7 months ago

@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?

sonarcloud[bot] commented 7 months ago

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud

S-Dafarra commented 7 months ago

@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 https://github.com/ami-iit/yarp-device-keyboard-joypad/pull/3#issuecomment-2041073183

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 commented 7 months ago

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.

S-Dafarra commented 6 months ago

I realized that in the single thread case I was not updating the variable with the last run time. Fixed with https://github.com/robotology/yarp/pull/3101/commits/b060a6e42d4eca026e030fd57a549789799a9414

sonarcloud[bot] commented 6 months ago

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarCloud